PolarSSL v1.3.8
ssl_cache.h
Go to the documentation of this file.
1 
27 #ifndef POLARSSL_SSL_CACHE_H
28 #define POLARSSL_SSL_CACHE_H
29 
30 #include "ssl.h"
31 
32 #if defined(POLARSSL_THREADING_C)
33 #include "threading.h"
34 #endif
35 
44 #if !defined(SSL_CACHE_DEFAULT_TIMEOUT)
45 #define SSL_CACHE_DEFAULT_TIMEOUT 86400
46 #endif
47 
48 #if !defined(SSL_CACHE_DEFAULT_MAX_ENTRIES)
49 #define SSL_CACHE_DEFAULT_MAX_ENTRIES 50
50 #endif
51 
52 /* \} name SECTION: Module settings */
53 
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
57 
60 
65 {
66 #if defined(POLARSSL_HAVE_TIME)
67  time_t timestamp;
68 #endif
70 #if defined(POLARSSL_X509_CRT_PARSE_C)
72 #endif
74 };
75 
80 {
82  int timeout;
84 #if defined(POLARSSL_THREADING_C)
85  threading_mutex_t mutex;
86 #endif
87 };
88 
94 void ssl_cache_init( ssl_cache_context *cache );
95 
103 int ssl_cache_get( void *data, ssl_session *session );
104 
112 int ssl_cache_set( void *data, const ssl_session *session );
113 
114 #if defined(POLARSSL_HAVE_TIME)
115 
124 void ssl_cache_set_timeout( ssl_cache_context *cache, int timeout );
125 #endif /* POLARSSL_HAVE_TIME */
126 
134 void ssl_cache_set_max_entries( ssl_cache_context *cache, int max );
135 
141 void ssl_cache_free( ssl_cache_context *cache );
142 
143 #ifdef __cplusplus
144 }
145 #endif
146 
147 #endif /* ssl_cache.h */