5 #define _POSIX_C_SOURCE 200809L
7 #include <sys/socket.h>
9 #include <netinet/in.h>
13 union sockaddr_union
{
14 struct sockaddr_in v4
;
15 struct sockaddr_in6 v6
;
19 union sockaddr_union addr
;
24 union sockaddr_union bindaddr
;
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
);