]> Zhao Yanbai Git Server - minix.git/commitdiff
Add IPv6-related header definitions
authorErik van der Kouwe <erik@minix3.org>
Mon, 25 Jan 2010 18:13:23 +0000 (18:13 +0000)
committerErik van der Kouwe <erik@minix3.org>
Mon, 25 Jan 2010 18:13:23 +0000 (18:13 +0000)
include/netinet/in.h
include/sys/socket.h

index 7d4ee8044d9f26735921db395807d617f7916394..bf6473db0f4ae7c14d933f71b8aba4707042f993 100644 (file)
@@ -64,6 +64,27 @@ struct ip_mreq
        struct  in_addr imr_interface;
 };
 
+/* 
+ * IPv6 is not supportedn, but some programs need these declarations 
+ * nevertheless; these declarations are based on
+ * http://www.opengroup.org/onlinepubs/000095399/basedefs/netinet/in.h.html
+ */
+struct in6_addr
+{
+       uint8_t s6_addr[16];
+};
+
+struct sockaddr_in6
+{
+       sa_family_t     sin6_family;
+       in_port_t       sin6_port;
+       uint32_t        sin6_flowinfo;
+       struct in6_addr sin6_addr;
+       uint32_t        sin6_scope_id;
+};
+
+#define        INET6_ADDRSTRLEN        46
+
 /* Definitions that are not part of the Open Group Base Specifications */
 #define IN_CLASSA(i)   (((uint32_t)(i) & 0x80000000) == 0)
 #define IN_CLASSA_NET  0xff000000
index 35da6e43443e9c71ba7fd2b6c8125b89f84355d4..85e16960d845b34103767bcde0a66c9e16ff91e0 100644 (file)
@@ -87,4 +87,17 @@ _PROTOTYPE( int socket, (int _domain, int _type, int _protocol)              );
 #define PF_UNIX                AF_UNIX
 #define PF_UNSPEC      AF_UNSPEC
 
+/* based on http://tools.ietf.org/html/rfc2553 */
+struct sockaddr_storage
+{
+       sa_family_t     __ss_family;
+       char            __ss_pad1[6];
+#ifdef __LONG_LONG_SUPPORTED
+       int64_t         __ss_align;
+#else
+       int32_t         __ss_align[2];
+#endif
+       char            __ss_pad2[112];
+};
+
 #endif /* SYS_SOCKET_H */