#ifndef SOCKETS_H_INCLUDED #define SOCKETS_H_INCLUDED #include #include #include #include #include #include #include #include #include #include #include #include #include #define BACKLOG 10 // maximum length to which the queue of pending connections for sockfd may grow // get sockaddr, IPv4 or IPv6: void *get_in_addr(struct sockaddr *sa); // Create socket to connect to real IRC server int createserversocket(char *host, char *port); // Create listening socket to listen for bouncer client connections int createclientsocket(char *listenport); void init_openssl(); void cleanup_openssl(); SSL_CTX *create_context(); void configure_context(SSL_CTX *ctx, char *certfile, char *keyfile); // Read from a socket, whether or not using TLS int sockread(SSL *fd, char *buf, int bufsize, int tls); // Write to a socket, whether or not using TLS int socksend(SSL *fd, char *buf, int bufsize, int tls); #endif