1/*++
2/* NAME
3/*	tlsproxy 3h
4/* SUMMARY
5/*	tlsproxy internal interfaces
6/* SYNOPSIS
7/*	#include <tlsproxy.h>
8/* DESCRIPTION
9/* .nf
10
11 /*
12  * Utility library.
13  */
14#include <vstream.h>
15#include <nbbio.h>
16
17 /*
18  * TLS library.
19  */
20#include <tls.h>
21
22 /*
23  * Internal interface.
24  */
25typedef struct {
26    int     flags;			/* see below */
27    int     req_flags;			/* request flags, see tls_proxy.h */
28    char   *service;			/* argv[0] */
29    VSTREAM *plaintext_stream;		/* local peer: postscreen(8), etc. */
30    NBBIO  *plaintext_buf;		/* plaintext buffer */
31    int     ciphertext_fd;		/* remote peer */
32    EVENT_NOTIFY_FN ciphertext_timer;	/* kludge */
33    int     timeout;			/* read/write time limit */
34    char   *remote_endpt;		/* printable remote endpoint */
35    char   *server_id;			/* cache management */
36    TLS_SESS_STATE *tls_context;	/* llibtls state */
37    int     ssl_last_err;		/* TLS I/O state */
38} TLSP_STATE;
39
40#define TLSP_FLAG_DO_HANDSHAKE	(1<<0)
41
42extern TLSP_STATE *tlsp_state_create(const char *, VSTREAM *);
43extern void tlsp_state_free(TLSP_STATE *);
44
45/* LICENSE
46/* .ad
47/* .fi
48/*	The Secure Mailer license must be distributed with this software.
49/* AUTHOR(S)
50/*	Wietse Venema
51/*	IBM T.J. Watson Research
52/*	P.O. Box 704
53/*	Yorktown Heights, NY 10598, USA
54/*--*/
55