Fix Windows headers for IPv6
authorBruce Cran <bcran@fusionio.com>
Tue, 28 Jan 2014 19:54:17 +0000 (12:54 -0700)
committerJens Axboe <axboe@kernel.dk>
Tue, 28 Jan 2014 20:04:36 +0000 (13:04 -0700)
MinGW includes all the necessary IPv6 definitions, so include ws2tcpip.h
and remove the custom definitions.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
os/windows/posix/include/arpa/inet.h
os/windows/posix/include/netinet/in.h

index 59c50ad15eabb1fe42b10322ab1650eb0525d19a..30498c673a2b1f0f5ce1f666996d291b33371a03 100644 (file)
@@ -1,21 +1,14 @@
 #ifndef ARPA_INET_H
 #define ARPA_INET_H
 
-#include <winsock2.h>
+#include <ws2tcpip.h>
 #include <inttypes.h>
 
 typedef int socklen_t;
 typedef int in_addr_t;
 
-#define IP_MULTICAST_IF 2
-#define IP_MULTICAST_TTL 3
-#define IP_ADD_MEMBERSHIP 5
-
-struct ip_mreq
-{
-       struct in_addr imr_multiaddr;
-       struct in_addr imr_interface;
-};
+/* EAI_SYSTEM isn't used on Windows, so map it to EAI_FAIL */
+#define EAI_SYSTEM EAI_FAIL
 
 in_addr_t inet_network(const char *cp);
 
index b58c209f2ec0dc34de8c5fdf73e30de5116157be..f7e24197cee96efcc2a09928c5d280e670106d0e 100644 (file)
@@ -4,18 +4,5 @@
 #include <inttypes.h>
 #include <sys/un.h>
 
-struct in6_addr
-{
-       uint8_t s6_addr[16];
-};
-
-struct sockaddr_in6
-{
-       sa_family_t             sin6_family;   /* AF_INET6 */
-       in_port_t               sin6_port;     /* Port number */
-       uint32_t                sin6_flowinfo; /* IPv6 traffic class and flow information */
-       struct in6_addr sin6_addr;     /* IPv6 address */
-       uint32_t                sin6_scope_id; /* Set of interfaces for a scope */
-};
 
 #endif /* NETINET_IN_H */