X-Git-Url: http://git.pk910.de/?p=TransparentIRC.git;a=blobdiff_plain;f=src%2FIOHandler.h;fp=src%2FIOHandler.h;h=6d57ca541901329f2d485523279db163cc3f1078;hp=76fb2cf82c89dd492352ea622a12f416e8065785;hb=526bf10a06332efc4505bee2d2cff7b959a169b8;hpb=79b5ee62665a460214046003cdbe1b4b4f1fa39e diff --git a/src/IOHandler.h b/src/IOHandler.h index 76fb2cf..6d57ca5 100644 --- a/src/IOHandler.h +++ b/src/IOHandler.h @@ -20,6 +20,7 @@ struct IODescriptor; struct IOEvent; +struct IOSSLNode; #define IOHANDLER_CALLBACK(NAME) void NAME(UNUSED_ARG(struct IOEvent *io_event)) typedef IOHANDLER_CALLBACK(iohandler_callback); @@ -36,7 +37,8 @@ enum IOStatus { IO_CLOSED, /* descriptor is dead (socket waiting for removal or timer) */ IO_LISTENING, /* descriptor is waiting for connections (server socket) */ IO_CONNECTING, /* descriptor is waiting for connection approval (connecting client socket) */ - IO_CONNECTED /* descriptor is connected (connected client socket) */ + IO_CONNECTED, /* descriptor is connected (connected client socket) */ + IO_SSLWAIT /* waiting for SSL backend (e.g. handshake) */ }; enum IOEventType { @@ -47,7 +49,8 @@ enum IOEventType { IOEVENT_NOTCONNECTED, /* client socket could not connect (errid valid) */ IOEVENT_CLOSED, /* client socket lost connection (errid valid) */ IOEVENT_ACCEPT, /* server socket accepted new connection (accept_fd valid) */ - IOEVENT_TIMEOUT /* timer timed out */ + IOEVENT_TIMEOUT, /* timer timed out */ + IOEVENT_SSLFAILED /* failed to initialize SSL session */ }; struct IOBuffer { @@ -66,6 +69,10 @@ struct IODescriptor { void *data; int read_lines : 1; int ssl : 1; + int ssl_active : 1; + int ssl_hs_read : 1; + int ssl_hs_write : 1; + struct IOSSLNode *sslnode; struct IODescriptor *next, *prev; }; @@ -83,7 +90,7 @@ struct IOEvent { struct IODescriptor *iohandler_add(int sockfd, enum IOType type, struct timeval *timeout, iohandler_callback *callback); struct IODescriptor *iohandler_timer(struct timeval timeout, iohandler_callback *callback); struct IODescriptor *iohandler_connect(const char *hostname, unsigned int port, int ssl, const char *bind, iohandler_callback *callback); -struct IODescriptor *iohandler_listen(const char *hostname, unsigned int port, int ssl, iohandler_callback *callback); +struct IODescriptor *iohandler_listen(const char *hostname, unsigned int port, iohandler_callback *callback); void iohandler_write(struct IODescriptor *iofd, const char *line); void iohandler_send(struct IODescriptor *iofd, const char *data, size_t datalen); void iohandler_printf(struct IODescriptor *iofd, const char *text, ...);