summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-09-18 15:31:44 -0400
committerRich Felker <dalias@aerifal.cx>2011-09-18 15:31:44 -0400
commitc8175666f22952d1b0ea280b217d8896f0c24bec (patch)
tree34461bc163a2f846ba97c0baaec2e62d52fb37ae
parent3f72cdac73030761120cf32aeef44e7d03e2f1fa (diff)
downloadmusl-c8175666f22952d1b0ea280b217d8896f0c24bec.tar.gz
musl-c8175666f22952d1b0ea280b217d8896f0c24bec.tar.bz2
musl-c8175666f22952d1b0ea280b217d8896f0c24bec.tar.xz
musl-c8175666f22952d1b0ea280b217d8896f0c24bec.zip
move invariant netinet/in.h stuff out of bits/in.h
-rw-r--r--arch/i386/bits/in.h145
-rw-r--r--arch/x86_64/bits/in.h145
-rw-r--r--include/netinet/in.h149
3 files changed, 147 insertions, 292 deletions
diff --git a/arch/i386/bits/in.h b/arch/i386/bits/in.h
deleted file mode 100644
index 9d9e8183..00000000
--- a/arch/i386/bits/in.h
+++ /dev/null
@@ -1,145 +0,0 @@
-#define IP_TOS 1
-#define IP_TTL 2
-#define IP_HDRINCL 3
-#define IP_OPTIONS 4
-#define IP_ROUTER_ALERT 5
-#define IP_RECVOPTS 6
-#define IP_RETOPTS 7
-#define IP_PKTINFO 8
-#define IP_PKTOPTIONS 9
-#define IP_PMTUDISC 10
-#define IP_MTU_DISCOVER 10
-#define IP_RECVERR 11
-#define IP_RECVTTL 12
-#define IP_RECVTOS 13
-#define IP_MTU 14
-#define IP_FREEBIND 15
-#define IP_IPSEC_POLICY 16
-#define IP_XFRM_POLICY 17
-#define IP_PASSSEC 18
-#define IP_TRANSPARENT 19
-#define IP_ORIGDSTADDR 20
-#define IP_RECVORIGDSTADDR IP_ORIGDSTADDR
-#define IP_MINTTL 21
-#define IP_MULTICAST_IF 32
-#define IP_MULTICAST_TTL 33
-#define IP_MULTICAST_LOOP 34
-#define IP_ADD_MEMBERSHIP 35
-#define IP_DROP_MEMBERSHIP 36
-#define IP_UNBLOCK_SOURCE 37
-#define IP_BLOCK_SOURCE 38
-#define IP_ADD_SOURCE_MEMBERSHIP 39
-#define IP_DROP_SOURCE_MEMBERSHIP 40
-#define IP_MSFILTER 41
-
-#define IP_RECVRETOPTS IP_RETOPTS
-
-#define IP_PMTUDISC_DONT 0
-#define IP_PMTUDISC_WANT 1
-#define IP_PMTUDISC_DO 2
-#define IP_PMTUDISC_PROBE 3
-
-#define SOL_IP 0
-
-#define IP_DEFAULT_MULTICAST_TTL 1
-#define IP_DEFAULT_MULTICAST_LOOP 1
-#define IP_MAX_MEMBERSHIPS 20
-
-struct ip_opts
-{
- struct in_addr ip_dst;
- char ip_opts[40];
-};
-
-struct ip_mreq
-{
- struct in_addr imr_multiaddr;
- struct in_addr imr_interface;
-};
-
-struct ip_mreqn
-{
- struct in_addr imr_multiaddr;
- struct in_addr imr_address;
- int imr_ifindex;
-};
-
-struct in_pktinfo
-{
- int ipi_ifindex;
- struct in_addr ipi_spec_dst;
- struct in_addr ipi_addr;
-};
-
-struct in6_pktinfo
-{
- struct in6_addr ipi6_addr;
- unsigned ipi6_ifindex;
-};
-
-struct in6_mutinfo
-{
- struct sockaddr_in6 ip6m_addr;
- uint32_t ip6m_mtu;
-};
-
-#define IPV6_ADDRFORM 1
-#define IPV6_2292PKTINFO 2
-#define IPV6_2292HOPOPTS 3
-#define IPV6_2292DSTOPTS 4
-#define IPV6_2292RTHDR 5
-#define IPV6_2292PKTOPTIONS 6
-#define IPV6_CHECKSUM 7
-#define IPV6_2292HOPLIMIT 8
-#define SCM_SRCRT IPV6_RXSRCRT
-#define IPV6_NEXTHOP 9
-#define IPV6_AUTHHDR 10
-#define IPV6_UNICAST_HOPS 16
-#define IPV6_MULTICAST_IF 17
-#define IPV6_MULTICAST_HOPS 18
-#define IPV6_MULTICAST_LOOP 19
-#define IPV6_JOIN_GROUP 20
-#define IPV6_LEAVE_GROUP 21
-#define IPV6_ROUTER_ALERT 22
-#define IPV6_MTU_DISCOVER 23
-#define IPV6_MTU 24
-#define IPV6_RECVERR 25
-#define IPV6_V6ONLY 26
-#define IPV6_JOIN_ANYCAST 27
-#define IPV6_LEAVE_ANYCAST 28
-#define IPV6_IPSEC_POLICY 34
-#define IPV6_XFRM_POLICY 35
-
-#define IPV6_RECVPKTINFO 49
-#define IPV6_PKTINFO 50
-#define IPV6_RECVHOPLIMIT 51
-#define IPV6_HOPLIMIT 52
-#define IPV6_RECVHOPOPTS 53
-#define IPV6_HOPOPTS 54
-#define IPV6_RTHDRDSTOPTS 55
-#define IPV6_RECVRTHDR 56
-#define IPV6_RTHDR 57
-#define IPV6_RECVDSTOPTS 58
-#define IPV6_DSTOPTS 59
-
-#define IPV6_RECVTCLASS 66
-#define IPV6_TCLASS 67
-
-#define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP
-#define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP
-#define IPV6_RXHOPOPTS IPV6_HOPOPTS
-#define IPV6_RXDSTOPTS IPV6_DSTOPTS
-
-
-#define IPV6_PMTUDISC_DONT 0
-#define IPV6_PMTUDISC_WANT 1
-#define IPV6_PMTUDISC_DO 2
-#define IPV6_PMTUDISC_PROBE 3
-
-#define SOL_IPV6 41
-#define SOL_ICMPV6 58
-
-#define IPV6_RTHDR_LOOSE 0
-#define IPV6_RTHDR_STRICT 1
-
-#define IPV6_RTHDR_TYPE_0 0
diff --git a/arch/x86_64/bits/in.h b/arch/x86_64/bits/in.h
deleted file mode 100644
index 9d9e8183..00000000
--- a/arch/x86_64/bits/in.h
+++ /dev/null
@@ -1,145 +0,0 @@
-#define IP_TOS 1
-#define IP_TTL 2
-#define IP_HDRINCL 3
-#define IP_OPTIONS 4
-#define IP_ROUTER_ALERT 5
-#define IP_RECVOPTS 6
-#define IP_RETOPTS 7
-#define IP_PKTINFO 8
-#define IP_PKTOPTIONS 9
-#define IP_PMTUDISC 10
-#define IP_MTU_DISCOVER 10
-#define IP_RECVERR 11
-#define IP_RECVTTL 12
-#define IP_RECVTOS 13
-#define IP_MTU 14
-#define IP_FREEBIND 15
-#define IP_IPSEC_POLICY 16
-#define IP_XFRM_POLICY 17
-#define IP_PASSSEC 18
-#define IP_TRANSPARENT 19
-#define IP_ORIGDSTADDR 20
-#define IP_RECVORIGDSTADDR IP_ORIGDSTADDR
-#define IP_MINTTL 21
-#define IP_MULTICAST_IF 32
-#define IP_MULTICAST_TTL 33
-#define IP_MULTICAST_LOOP 34
-#define IP_ADD_MEMBERSHIP 35
-#define IP_DROP_MEMBERSHIP 36
-#define IP_UNBLOCK_SOURCE 37
-#define IP_BLOCK_SOURCE 38
-#define IP_ADD_SOURCE_MEMBERSHIP 39
-#define IP_DROP_SOURCE_MEMBERSHIP 40
-#define IP_MSFILTER 41
-
-#define IP_RECVRETOPTS IP_RETOPTS
-
-#define IP_PMTUDISC_DONT 0
-#define IP_PMTUDISC_WANT 1
-#define IP_PMTUDISC_DO 2
-#define IP_PMTUDISC_PROBE 3
-
-#define SOL_IP 0
-
-#define IP_DEFAULT_MULTICAST_TTL 1
-#define IP_DEFAULT_MULTICAST_LOOP 1
-#define IP_MAX_MEMBERSHIPS 20
-
-struct ip_opts
-{
- struct in_addr ip_dst;
- char ip_opts[40];
-};
-
-struct ip_mreq
-{
- struct in_addr imr_multiaddr;
- struct in_addr imr_interface;
-};
-
-struct ip_mreqn
-{
- struct in_addr imr_multiaddr;
- struct in_addr imr_address;
- int imr_ifindex;
-};
-
-struct in_pktinfo
-{
- int ipi_ifindex;
- struct in_addr ipi_spec_dst;
- struct in_addr ipi_addr;
-};
-
-struct in6_pktinfo
-{
- struct in6_addr ipi6_addr;
- unsigned ipi6_ifindex;
-};
-
-struct in6_mutinfo
-{
- struct sockaddr_in6 ip6m_addr;
- uint32_t ip6m_mtu;
-};
-
-#define IPV6_ADDRFORM 1
-#define IPV6_2292PKTINFO 2
-#define IPV6_2292HOPOPTS 3
-#define IPV6_2292DSTOPTS 4
-#define IPV6_2292RTHDR 5
-#define IPV6_2292PKTOPTIONS 6
-#define IPV6_CHECKSUM 7
-#define IPV6_2292HOPLIMIT 8
-#define SCM_SRCRT IPV6_RXSRCRT
-#define IPV6_NEXTHOP 9
-#define IPV6_AUTHHDR 10
-#define IPV6_UNICAST_HOPS 16
-#define IPV6_MULTICAST_IF 17
-#define IPV6_MULTICAST_HOPS 18
-#define IPV6_MULTICAST_LOOP 19
-#define IPV6_JOIN_GROUP 20
-#define IPV6_LEAVE_GROUP 21
-#define IPV6_ROUTER_ALERT 22
-#define IPV6_MTU_DISCOVER 23
-#define IPV6_MTU 24
-#define IPV6_RECVERR 25
-#define IPV6_V6ONLY 26
-#define IPV6_JOIN_ANYCAST 27
-#define IPV6_LEAVE_ANYCAST 28
-#define IPV6_IPSEC_POLICY 34
-#define IPV6_XFRM_POLICY 35
-
-#define IPV6_RECVPKTINFO 49
-#define IPV6_PKTINFO 50
-#define IPV6_RECVHOPLIMIT 51
-#define IPV6_HOPLIMIT 52
-#define IPV6_RECVHOPOPTS 53
-#define IPV6_HOPOPTS 54
-#define IPV6_RTHDRDSTOPTS 55
-#define IPV6_RECVRTHDR 56
-#define IPV6_RTHDR 57
-#define IPV6_RECVDSTOPTS 58
-#define IPV6_DSTOPTS 59
-
-#define IPV6_RECVTCLASS 66
-#define IPV6_TCLASS 67
-
-#define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP
-#define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP
-#define IPV6_RXHOPOPTS IPV6_HOPOPTS
-#define IPV6_RXDSTOPTS IPV6_DSTOPTS
-
-
-#define IPV6_PMTUDISC_DONT 0
-#define IPV6_PMTUDISC_WANT 1
-#define IPV6_PMTUDISC_DO 2
-#define IPV6_PMTUDISC_PROBE 3
-
-#define SOL_IPV6 41
-#define SOL_ICMPV6 58
-
-#define IPV6_RTHDR_LOOSE 0
-#define IPV6_RTHDR_STRICT 1
-
-#define IPV6_RTHDR_TYPE_0 0
diff --git a/include/netinet/in.h b/include/netinet/in.h
index 0336b104..44018f14 100644
--- a/include/netinet/in.h
+++ b/include/netinet/in.h
@@ -132,8 +132,6 @@ uint16_t ntohs(uint16_t);
#define IN6_IS_ADDR_MC_GLOBAL(a) \
(IN6_IS_ADDR_MULTICAST(a) && ((((uint8_t *) (a))[1] & 0xf) == 0xe))
-#include <bits/in.h>
-
#define IN_CLASSA(a) ((((in_addr_t)(a)) & 0x80000000) == 0)
#define IN_CLASSA_NET 0xff000000
#define IN_CLASSA_NSHIFT 24
@@ -155,4 +153,151 @@ uint16_t ntohs(uint16_t);
#define IN_LOOPBACKNET 127
+
+#define IP_TOS 1
+#define IP_TTL 2
+#define IP_HDRINCL 3
+#define IP_OPTIONS 4
+#define IP_ROUTER_ALERT 5
+#define IP_RECVOPTS 6
+#define IP_RETOPTS 7
+#define IP_PKTINFO 8
+#define IP_PKTOPTIONS 9
+#define IP_PMTUDISC 10
+#define IP_MTU_DISCOVER 10
+#define IP_RECVERR 11
+#define IP_RECVTTL 12
+#define IP_RECVTOS 13
+#define IP_MTU 14
+#define IP_FREEBIND 15
+#define IP_IPSEC_POLICY 16
+#define IP_XFRM_POLICY 17
+#define IP_PASSSEC 18
+#define IP_TRANSPARENT 19
+#define IP_ORIGDSTADDR 20
+#define IP_RECVORIGDSTADDR IP_ORIGDSTADDR
+#define IP_MINTTL 21
+#define IP_MULTICAST_IF 32
+#define IP_MULTICAST_TTL 33
+#define IP_MULTICAST_LOOP 34
+#define IP_ADD_MEMBERSHIP 35
+#define IP_DROP_MEMBERSHIP 36
+#define IP_UNBLOCK_SOURCE 37
+#define IP_BLOCK_SOURCE 38
+#define IP_ADD_SOURCE_MEMBERSHIP 39
+#define IP_DROP_SOURCE_MEMBERSHIP 40
+#define IP_MSFILTER 41
+
+#define IP_RECVRETOPTS IP_RETOPTS
+
+#define IP_PMTUDISC_DONT 0
+#define IP_PMTUDISC_WANT 1
+#define IP_PMTUDISC_DO 2
+#define IP_PMTUDISC_PROBE 3
+
+#define SOL_IP 0
+
+#define IP_DEFAULT_MULTICAST_TTL 1
+#define IP_DEFAULT_MULTICAST_LOOP 1
+#define IP_MAX_MEMBERSHIPS 20
+
+struct ip_opts
+{
+ struct in_addr ip_dst;
+ char ip_opts[40];
+};
+
+struct ip_mreq
+{
+ struct in_addr imr_multiaddr;
+ struct in_addr imr_interface;
+};
+
+struct ip_mreqn
+{
+ struct in_addr imr_multiaddr;
+ struct in_addr imr_address;
+ int imr_ifindex;
+};
+
+struct in_pktinfo
+{
+ int ipi_ifindex;
+ struct in_addr ipi_spec_dst;
+ struct in_addr ipi_addr;
+};
+
+struct in6_pktinfo
+{
+ struct in6_addr ipi6_addr;
+ unsigned ipi6_ifindex;
+};
+
+struct in6_mutinfo
+{
+ struct sockaddr_in6 ip6m_addr;
+ uint32_t ip6m_mtu;
+};
+
+#define IPV6_ADDRFORM 1
+#define IPV6_2292PKTINFO 2
+#define IPV6_2292HOPOPTS 3
+#define IPV6_2292DSTOPTS 4
+#define IPV6_2292RTHDR 5
+#define IPV6_2292PKTOPTIONS 6
+#define IPV6_CHECKSUM 7
+#define IPV6_2292HOPLIMIT 8
+#define SCM_SRCRT IPV6_RXSRCRT
+#define IPV6_NEXTHOP 9
+#define IPV6_AUTHHDR 10
+#define IPV6_UNICAST_HOPS 16
+#define IPV6_MULTICAST_IF 17
+#define IPV6_MULTICAST_HOPS 18
+#define IPV6_MULTICAST_LOOP 19
+#define IPV6_JOIN_GROUP 20
+#define IPV6_LEAVE_GROUP 21
+#define IPV6_ROUTER_ALERT 22
+#define IPV6_MTU_DISCOVER 23
+#define IPV6_MTU 24
+#define IPV6_RECVERR 25
+#define IPV6_V6ONLY 26
+#define IPV6_JOIN_ANYCAST 27
+#define IPV6_LEAVE_ANYCAST 28
+#define IPV6_IPSEC_POLICY 34
+#define IPV6_XFRM_POLICY 35
+
+#define IPV6_RECVPKTINFO 49
+#define IPV6_PKTINFO 50
+#define IPV6_RECVHOPLIMIT 51
+#define IPV6_HOPLIMIT 52
+#define IPV6_RECVHOPOPTS 53
+#define IPV6_HOPOPTS 54
+#define IPV6_RTHDRDSTOPTS 55
+#define IPV6_RECVRTHDR 56
+#define IPV6_RTHDR 57
+#define IPV6_RECVDSTOPTS 58
+#define IPV6_DSTOPTS 59
+
+#define IPV6_RECVTCLASS 66
+#define IPV6_TCLASS 67
+
+#define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP
+#define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP
+#define IPV6_RXHOPOPTS IPV6_HOPOPTS
+#define IPV6_RXDSTOPTS IPV6_DSTOPTS
+
+
+#define IPV6_PMTUDISC_DONT 0
+#define IPV6_PMTUDISC_WANT 1
+#define IPV6_PMTUDISC_DO 2
+#define IPV6_PMTUDISC_PROBE 3
+
+#define SOL_IPV6 41
+#define SOL_ICMPV6 58
+
+#define IPV6_RTHDR_LOOSE 0
+#define IPV6_RTHDR_STRICT 1
+
+#define IPV6_RTHDR_TYPE_0 0
+
#endif