fix nul-termination for user/password copy in check_credentials()
[rofl0r-microsocks.git] / server.h
blob4b9f5902d3feabf039bebe6380e6259119e018a6
1 #ifndef SERVER_H
2 #define SERVER_H
4 #undef _POSIX_C_SOURCE
5 #define _POSIX_C_SOURCE 200809L
7 #include <sys/socket.h>
8 #include <netdb.h>
9 #include <netinet/in.h>
11 //RcB: DEP "server.c"
13 union sockaddr_union {
14 struct sockaddr_in v4;
15 struct sockaddr_in6 v6;
18 struct client {
19 union sockaddr_union addr;
20 int fd;
23 struct server {
24 union sockaddr_union bindaddr;
25 int fd;
26 socklen_t bindaddrsz;
29 int resolve(const char *host, unsigned short port, struct addrinfo** addr);
30 int server_bindtoip(const struct server *server, int fd);
31 int server_waitclient(struct server *server, struct client* client);
32 int server_setup(struct server *server, const char* listenip, unsigned short port);
34 #endif