From af724dd1126f97c276259060f618b29f95a68bde Mon Sep 17 00:00:00 2001 From: Pengyu Lv Date: Mon, 6 Mar 2023 11:56:10 +0800 Subject: [PATCH] ssl_cache: Add getter access to timeout field Signed-off-by: Pengyu Lv --- include/mbedtls/ssl_cache.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/mbedtls/ssl_cache.h b/include/mbedtls/ssl_cache.h index 08f98b5591..b1b42505a8 100644 --- a/include/mbedtls/ssl_cache.h +++ b/include/mbedtls/ssl_cache.h @@ -160,6 +160,20 @@ int mbedtls_ssl_cache_remove(void *data, * \param timeout cache entry timeout in seconds */ void mbedtls_ssl_cache_set_timeout(mbedtls_ssl_cache_context *cache, int timeout); + +/** + * \brief Get the cache timeout + * + * A timeout of 0 indicates no timeout. + * + * \param cache SSL cache context + * + * \return cache entry timeout in seconds + */ +static inline int mbedtls_ssl_cache_get_timeout(mbedtls_ssl_cache_context *cache) +{ + return cache->MBEDTLS_PRIVATE(timeout); +} #endif /* MBEDTLS_HAVE_TIME */ /**