xref: /netbsd-src/external/ibm-public/postfix/dist/src/tls/tls_scache.h (revision 413d532bcc3f62d122e56d92e13ac64825a40baf)
1 /*	$NetBSD: tls_scache.h,v 1.1.1.1 2009/06/23 10:08:57 tron Exp $	*/
2 
3 #ifndef _TLS_SCACHE_H_INCLUDED_
4 #define _TLS_SCACHE_H_INCLUDED_
5 
6 /*++
7 /* NAME
8 /*	tls_scache 3h
9 /* SUMMARY
10 /*	TLS session cache manager
11 /* SYNOPSIS
12 /*	#include <tls_scache.h>
13 /* DESCRIPTION
14 /* .nf
15 
16  /*
17   * Utility library.
18   */
19 #include <dict.h>
20 #include <vstring.h>
21 
22  /*
23   * External interface.
24   */
25 typedef struct {
26     int     flags;			/* see below */
27     DICT   *db;				/* database handle */
28     char   *cache_label;		/* "smtpd", "smtp" or "lmtp" */
29     int     verbose;			/* enable verbose logging */
30     int     timeout;			/* smtp(d)_tls_session_cache_timeout */
31     char   *saved_cursor;		/* cursor cache ID */
32 } TLS_SCACHE;
33 
34 #define TLS_SCACHE_FLAG_DEL_SAVED_CURSOR	(1<<0)
35 
36 extern TLS_SCACHE *tls_scache_open(const char *, const char *, int, int);
37 extern void tls_scache_close(TLS_SCACHE *);
38 extern int tls_scache_lookup(TLS_SCACHE *, const char *, VSTRING *);
39 extern int tls_scache_update(TLS_SCACHE *, const char *, const char *, ssize_t);
40 extern int tls_scache_delete(TLS_SCACHE *, const char *);
41 extern int tls_scache_sequence(TLS_SCACHE *, int, char **, VSTRING *);
42 
43 #define TLS_SCACHE_DONT_NEED_CACHE_ID		((char **) 0)
44 #define TLS_SCACHE_DONT_NEED_SESSION		((VSTRING *) 0)
45 
46 #define TLS_SCACHE_SEQUENCE_NOTHING \
47 	TLS_SCACHE_DONT_NEED_CACHE_ID, TLS_SCACHE_DONT_NEED_SESSION
48 
49 /* LICENSE
50 /* .ad
51 /* .fi
52 /*	The Secure Mailer license must be distributed with this software.
53 /* AUTHOR(S)
54 /*	Wietse Venema
55 /*	IBM T.J. Watson Research
56 /*	P.O. Box 704
57 /*	Yorktown Heights, NY 10598, USA
58 /*--*/
59 
60 #endif
61