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