5359edc160de518d8e43fdd3448365c15b912c3c galt Mon Jul 22 11:48:10 2019 -0700 Added ipv6 support. Listening processes us hybrid dual stack feature of OS to simplify implementation and use a single listening socket. Works with both TCP and UDP. Parasol working. geoIp also updated and ready for IPv6. Should be invisible to most users, while providing connections via ipv6 where available. Supports both ipv4 and ipv6. diff --git src/inc/net.h src/inc/net.h index c8690a9..e24ba07 100644 --- src/inc/net.h +++ src/inc/net.h @@ -19,44 +19,41 @@ /* Set read and write timeouts on socket sd * Return -1 if there are any errors, 0 if successful. */ /* add a failure to connFailures[] * which can save time and avoid more timeouts */ int netConnect(char *hostName, int port); /* Start connection with a server having resolved port. Return < 0 if error. */ int netMustConnect(char *hostName, int port); /* Start connection with server or die. */ int netMustConnectTo(char *hostName, char *portName); /* Start connection with a server and a port that needs to be converted to integer */ int netAcceptingSocket(int port, int queueSize); -/* Create a socket for to accept connections. */ - -int netAcceptingSocketFrom(int port, int queueSize, char *host); -/* Create a socket that can accept connections from a - * IP address on the current machine if the current machine - * has multiple IP addresses. */ +/* Create an IPV6 socket that can accept connections from + * both IPV4 and IPV6 clients on the current machine. */ int netAccept(int sd); /* Accept incoming connection from socket descriptor. */ int netAcceptFrom(int acceptor, struct cidr *subnet); /* Wait for incoming connection from socket descriptor * from IP address in subnet. Subnet is something - * returned from netParseDottedQuad. */ + * returned from internetParseSubnetCidr. + * Subnet may be NULL. */ FILE *netFileFromSocket(int socket); /* Wrap a FILE around socket. This should be fclose'd * and separately the socket close'd. */ int netWaitForData(int sd, int microseconds); /* Wait for descriptor to have some data to read, up to given number of * microseconds. Returns amount of data there or zero if timed out. */ void netBlockBrokenPipes(); /* Make it so a broken pipe doesn't kill us. */ ssize_t netReadAll(int sd, void *vBuf, ssize_t size); /* Read given number of bytes into buffer. * Don't give up on first read! */