xref: /openbsd-src/usr.sbin/ldapd/evbuffer_tls.h (revision 57f46873c67a82fa8b8d5c74c84beca518011997)
1*57f46873Sjmatthew /*	$OpenBSD: evbuffer_tls.h,v 1.1 2016/05/01 00:32:37 jmatthew Exp $ */
2*57f46873Sjmatthew 
3*57f46873Sjmatthew /*
4*57f46873Sjmatthew  * Copyright (c) 2014-2015 Alexander Bluhm <bluhm@openbsd.org>
5*57f46873Sjmatthew  *
6*57f46873Sjmatthew  * Permission to use, copy, modify, and distribute this software for any
7*57f46873Sjmatthew  * purpose with or without fee is hereby granted, provided that the above
8*57f46873Sjmatthew  * copyright notice and this permission notice appear in all copies.
9*57f46873Sjmatthew  *
10*57f46873Sjmatthew  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11*57f46873Sjmatthew  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12*57f46873Sjmatthew  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13*57f46873Sjmatthew  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14*57f46873Sjmatthew  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15*57f46873Sjmatthew  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16*57f46873Sjmatthew  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17*57f46873Sjmatthew  */
18*57f46873Sjmatthew 
19*57f46873Sjmatthew #ifndef _EVBUFFER_TLS_H_
20*57f46873Sjmatthew #define _EVBUFFER_TLS_H_
21*57f46873Sjmatthew 
22*57f46873Sjmatthew #define EVBUFFER_HANDSHAKE	0x04
23*57f46873Sjmatthew 
24*57f46873Sjmatthew struct bufferevent;
25*57f46873Sjmatthew struct tls;
26*57f46873Sjmatthew 
27*57f46873Sjmatthew struct buffertls {
28*57f46873Sjmatthew 	struct bufferevent	*bt_bufev;
29*57f46873Sjmatthew 	struct tls		*bt_ctx;
30*57f46873Sjmatthew };
31*57f46873Sjmatthew 
32*57f46873Sjmatthew void	buffertls_set(struct buffertls *, struct bufferevent *, struct tls *,
33*57f46873Sjmatthew     int);
34*57f46873Sjmatthew void	buffertls_accept(struct buffertls *, int);
35*57f46873Sjmatthew void	buffertls_connect(struct buffertls *, int);
36*57f46873Sjmatthew 
37*57f46873Sjmatthew #endif /* _EVBUFFER_TLS_H_ */
38