#ifndef POTD_SERVER_H #define POTD_SERVER_H 1 #include "socket.h" #include "forward.h" #define POTD_MAXFD 32 #define POTD_MAXEVENTS 64 typedef struct server_ctx { forward_ctx *fwd_ctx; psocket sock; char host_buf[NI_MAXHOST], service_buf[NI_MAXSERV]; } server_ctx; void server_init_ctx(server_ctx **ctx, forward_ctx *fwd_ctx); int server_setup(server_ctx *ctx, const char *listen_addr, const char *listen_port); int server_validate_ctx(const server_ctx *ctx); int server_setup_epoll(server_ctx *ctx[], size_t siz); int server_mainloop_epoll(int epoll_fd, server_ctx *ctx[], size_t siz); #endif