Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 1 | #ifndef _NETINET_IN_H |
| 2 | #define _NETINET_IN_H |
| 3 | |
Rich Felker | 3ed8c9f | 2011-11-10 20:40:06 -0500 | [diff] [blame] | 4 | #ifdef __cplusplus |
| 5 | extern "C" { |
| 6 | #endif |
| 7 | |
Szabolcs Nagy | 119645b | 2013-01-11 01:54:53 +0100 | [diff] [blame] | 8 | #include <features.h> |
Rich Felker | 9448b05 | 2013-07-22 11:22:36 -0400 | [diff] [blame] | 9 | #include <inttypes.h> |
| 10 | #include <sys/socket.h> |
Szabolcs Nagy | 119645b | 2013-01-11 01:54:53 +0100 | [diff] [blame] | 11 | |
Rich Felker | 9448b05 | 2013-07-22 11:22:36 -0400 | [diff] [blame] | 12 | typedef uint16_t in_port_t; |
| 13 | typedef uint32_t in_addr_t; |
| 14 | struct in_addr { in_addr_t s_addr; }; |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 15 | |
| 16 | struct sockaddr_in |
| 17 | { |
| 18 | sa_family_t sin_family; |
| 19 | in_port_t sin_port; |
| 20 | struct in_addr sin_addr; |
| 21 | uint8_t sin_zero[8]; |
| 22 | }; |
| 23 | |
| 24 | struct in6_addr |
| 25 | { |
| 26 | union { |
| 27 | uint8_t __s6_addr[16]; |
Rich Felker | ca2d3c6 | 2012-05-03 22:12:46 -0400 | [diff] [blame] | 28 | uint16_t __s6_addr16[8]; |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 29 | uint32_t __s6_addr32[4]; |
| 30 | } __in6_union; |
| 31 | }; |
| 32 | #define s6_addr __in6_union.__s6_addr |
Rich Felker | ca2d3c6 | 2012-05-03 22:12:46 -0400 | [diff] [blame] | 33 | #define s6_addr16 __in6_union.__s6_addr16 |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 34 | #define s6_addr32 __in6_union.__s6_addr32 |
| 35 | |
| 36 | struct sockaddr_in6 |
| 37 | { |
| 38 | sa_family_t sin6_family; |
| 39 | in_port_t sin6_port; |
| 40 | uint32_t sin6_flowinfo; |
| 41 | struct in6_addr sin6_addr; |
| 42 | uint32_t sin6_scope_id; |
| 43 | }; |
| 44 | |
| 45 | struct ipv6_mreq |
| 46 | { |
| 47 | struct in6_addr ipv6mr_multiaddr; |
| 48 | unsigned ipv6mr_interface; |
| 49 | }; |
| 50 | |
| 51 | #define INADDR_ANY ((in_addr_t) 0x00000000) |
| 52 | #define INADDR_BROADCAST ((in_addr_t) 0xffffffff) |
| 53 | #define INADDR_NONE ((in_addr_t) 0xffffffff) |
| 54 | #define INADDR_LOOPBACK ((in_addr_t) 0x7f000001) |
| 55 | |
Rich Felker | c91ad4f | 2013-12-20 11:42:03 -0500 | [diff] [blame] | 56 | #define INADDR_UNSPEC_GROUP ((in_addr_t) 0xe0000000) |
| 57 | #define INADDR_ALLHOSTS_GROUP ((in_addr_t) 0xe0000001) |
| 58 | #define INADDR_ALLRTRS_GROUP ((in_addr_t) 0xe0000002) |
| 59 | #define INADDR_MAX_LOCAL_GROUP ((in_addr_t) 0xe00000ff) |
| 60 | |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 61 | #define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } } |
| 62 | #define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } } |
| 63 | |
| 64 | extern const struct in6_addr in6addr_any, in6addr_loopback; |
| 65 | |
| 66 | #undef INET_ADDRSTRLEN |
| 67 | #undef INET6_ADDRSTRLEN |
| 68 | #define INET_ADDRSTRLEN 16 |
| 69 | #define INET6_ADDRSTRLEN 46 |
| 70 | |
| 71 | uint32_t htonl(uint32_t); |
| 72 | uint16_t htons(uint16_t); |
| 73 | uint32_t ntohl(uint32_t); |
| 74 | uint16_t ntohs(uint16_t); |
| 75 | |
| 76 | #define IPPROTO_IP 0 |
Rich Felker | b10d023 | 2012-09-08 19:52:51 -0400 | [diff] [blame] | 77 | #define IPPROTO_HOPOPTS 0 |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 78 | #define IPPROTO_ICMP 1 |
| 79 | #define IPPROTO_IGMP 2 |
| 80 | #define IPPROTO_IPIP 4 |
| 81 | #define IPPROTO_TCP 6 |
| 82 | #define IPPROTO_EGP 8 |
| 83 | #define IPPROTO_PUP 12 |
| 84 | #define IPPROTO_UDP 17 |
| 85 | #define IPPROTO_IDP 22 |
| 86 | #define IPPROTO_TP 29 |
Rich Felker | 5d893e5 | 2013-01-01 20:19:20 -0500 | [diff] [blame] | 87 | #define IPPROTO_DCCP 33 |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 88 | #define IPPROTO_IPV6 41 |
| 89 | #define IPPROTO_ROUTING 43 |
| 90 | #define IPPROTO_FRAGMENT 44 |
| 91 | #define IPPROTO_RSVP 46 |
| 92 | #define IPPROTO_GRE 47 |
| 93 | #define IPPROTO_ESP 50 |
| 94 | #define IPPROTO_AH 51 |
| 95 | #define IPPROTO_ICMPV6 58 |
| 96 | #define IPPROTO_NONE 59 |
| 97 | #define IPPROTO_DSTOPTS 60 |
| 98 | #define IPPROTO_MTP 92 |
Szabolcs Nagy | 0dc630e | 2013-09-15 02:41:36 +0000 | [diff] [blame] | 99 | #define IPPROTO_BEETPH 94 |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 100 | #define IPPROTO_ENCAP 98 |
| 101 | #define IPPROTO_PIM 103 |
| 102 | #define IPPROTO_COMP 108 |
Rich Felker | 5d893e5 | 2013-01-01 20:19:20 -0500 | [diff] [blame] | 103 | #define IPPROTO_SCTP 132 |
Szabolcs Nagy | 0dc630e | 2013-09-15 02:41:36 +0000 | [diff] [blame] | 104 | #define IPPROTO_MH 135 |
Rich Felker | 5d893e5 | 2013-01-01 20:19:20 -0500 | [diff] [blame] | 105 | #define IPPROTO_UDPLITE 136 |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 106 | #define IPPROTO_RAW 255 |
Rich Felker | f59cedb | 2012-09-08 19:43:34 -0400 | [diff] [blame] | 107 | #define IPPROTO_MAX 256 |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 108 | |
| 109 | #define IN6_IS_ADDR_UNSPECIFIED(a) \ |
| 110 | (((uint32_t *) (a))[0] == 0 && ((uint32_t *) (a))[1] == 0 && \ |
| 111 | ((uint32_t *) (a))[2] == 0 && ((uint32_t *) (a))[3] == 0) |
| 112 | |
| 113 | #define IN6_IS_ADDR_LOOPBACK(a) \ |
| 114 | (((uint32_t *) (a))[0] == 0 && ((uint32_t *) (a))[1] == 0 && \ |
| 115 | ((uint32_t *) (a))[2] == 0 && \ |
| 116 | ((uint8_t *) (a))[12] == 0 && ((uint8_t *) (a))[13] == 0 && \ |
| 117 | ((uint8_t *) (a))[14] == 0 && ((uint8_t *) (a))[15] == 1 ) |
| 118 | |
| 119 | #define IN6_IS_ADDR_MULTICAST(a) (((uint8_t *) (a))[0] == 0xff) |
| 120 | |
| 121 | #define IN6_IS_ADDR_LINKLOCAL(a) \ |
| 122 | ((((uint8_t *) (a))[0]) == 0xfe && (((uint8_t *) (a))[1] & 0xc0) == 0x80) |
| 123 | |
| 124 | #define IN6_IS_ADDR_SITELOCAL(a) \ |
| 125 | ((((uint8_t *) (a))[0]) == 0xfe && (((uint8_t *) (a))[1] & 0xc0) == 0xc0) |
| 126 | |
| 127 | #define IN6_IS_ADDR_V4MAPPED(a) \ |
| 128 | (((uint32_t *) (a))[0] == 0 && ((uint32_t *) (a))[1] == 0 && \ |
| 129 | ((uint8_t *) (a))[8] == 0 && ((uint8_t *) (a))[9] == 0 && \ |
| 130 | ((uint8_t *) (a))[10] == 0xff && ((uint8_t *) (a))[11] == 0xff) |
| 131 | |
| 132 | #define IN6_IS_ADDR_V4COMPAT(a) \ |
| 133 | (((uint32_t *) (a))[0] == 0 && ((uint32_t *) (a))[1] == 0 && \ |
| 134 | ((uint32_t *) (a))[2] == 0 && ((uint8_t *) (a))[15] > 1) |
| 135 | |
| 136 | #define IN6_IS_ADDR_MC_NODELOCAL(a) \ |
| 137 | (IN6_IS_ADDR_MULTICAST(a) && ((((uint8_t *) (a))[1] & 0xf) == 0x1)) |
| 138 | |
| 139 | #define IN6_IS_ADDR_MC_LINKLOCAL(a) \ |
| 140 | (IN6_IS_ADDR_MULTICAST(a) && ((((uint8_t *) (a))[1] & 0xf) == 0x2)) |
| 141 | |
| 142 | #define IN6_IS_ADDR_MC_SITELOCAL(a) \ |
| 143 | (IN6_IS_ADDR_MULTICAST(a) && ((((uint8_t *) (a))[1] & 0xf) == 0x5)) |
| 144 | |
| 145 | #define IN6_IS_ADDR_MC_ORGLOCAL(a) \ |
| 146 | (IN6_IS_ADDR_MULTICAST(a) && ((((uint8_t *) (a))[1] & 0xf) == 0x8)) |
| 147 | |
| 148 | #define IN6_IS_ADDR_MC_GLOBAL(a) \ |
| 149 | (IN6_IS_ADDR_MULTICAST(a) && ((((uint8_t *) (a))[1] & 0xf) == 0xe)) |
| 150 | |
Rich Felker | b47fdcd | 2012-05-11 11:05:41 -0400 | [diff] [blame] | 151 | #define __ARE_4_EQUAL(a,b) \ |
Szabolcs Nagy | e74f3b0 | 2014-02-11 18:02:06 +0100 | [diff] [blame] | 152 | (!( (0[a]-0[b]) | (1[a]-1[b]) | (2[a]-2[b]) | (3[a]-3[b]) )) |
Rich Felker | b47fdcd | 2012-05-11 11:05:41 -0400 | [diff] [blame] | 153 | #define IN6_ARE_ADDR_EQUAL(a,b) \ |
| 154 | __ARE_4_EQUAL((const uint32_t *)(a), (const uint32_t *)(b)) |
| 155 | |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 156 | #define IN_CLASSA(a) ((((in_addr_t)(a)) & 0x80000000) == 0) |
| 157 | #define IN_CLASSA_NET 0xff000000 |
| 158 | #define IN_CLASSA_NSHIFT 24 |
| 159 | #define IN_CLASSA_HOST (0xffffffff & ~IN_CLASSA_NET) |
| 160 | #define IN_CLASSA_MAX 128 |
| 161 | #define IN_CLASSB(a) ((((in_addr_t)(a)) & 0xc0000000) == 0x80000000) |
| 162 | #define IN_CLASSB_NET 0xffff0000 |
| 163 | #define IN_CLASSB_NSHIFT 16 |
| 164 | #define IN_CLASSB_HOST (0xffffffff & ~IN_CLASSB_NET) |
| 165 | #define IN_CLASSB_MAX 65536 |
| 166 | #define IN_CLASSC(a) ((((in_addr_t)(a)) & 0xe0000000) == 0xc0000000) |
| 167 | #define IN_CLASSC_NET 0xffffff00 |
| 168 | #define IN_CLASSC_NSHIFT 8 |
| 169 | #define IN_CLASSC_HOST (0xffffffff & ~IN_CLASSC_NET) |
| 170 | #define IN_CLASSD(a) ((((in_addr_t)(a)) & 0xf0000000) == 0xe0000000) |
| 171 | #define IN_MULTICAST(a) IN_CLASSD(a) |
| 172 | #define IN_EXPERIMENTAL(a) ((((in_addr_t)(a)) & 0xe0000000) == 0xe0000000) |
| 173 | #define IN_BADCLASS(a) ((((in_addr_t)(a)) & 0xf0000000) == 0xf0000000) |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 174 | |
Rich Felker | 2b55a61 | 2011-04-06 15:44:39 -0400 | [diff] [blame] | 175 | #define IN_LOOPBACKNET 127 |
| 176 | |
Rich Felker | c817566 | 2011-09-18 15:31:44 -0400 | [diff] [blame] | 177 | |
| 178 | #define IP_TOS 1 |
| 179 | #define IP_TTL 2 |
| 180 | #define IP_HDRINCL 3 |
| 181 | #define IP_OPTIONS 4 |
| 182 | #define IP_ROUTER_ALERT 5 |
| 183 | #define IP_RECVOPTS 6 |
| 184 | #define IP_RETOPTS 7 |
| 185 | #define IP_PKTINFO 8 |
| 186 | #define IP_PKTOPTIONS 9 |
| 187 | #define IP_PMTUDISC 10 |
| 188 | #define IP_MTU_DISCOVER 10 |
| 189 | #define IP_RECVERR 11 |
| 190 | #define IP_RECVTTL 12 |
| 191 | #define IP_RECVTOS 13 |
| 192 | #define IP_MTU 14 |
| 193 | #define IP_FREEBIND 15 |
| 194 | #define IP_IPSEC_POLICY 16 |
| 195 | #define IP_XFRM_POLICY 17 |
| 196 | #define IP_PASSSEC 18 |
| 197 | #define IP_TRANSPARENT 19 |
| 198 | #define IP_ORIGDSTADDR 20 |
| 199 | #define IP_RECVORIGDSTADDR IP_ORIGDSTADDR |
| 200 | #define IP_MINTTL 21 |
Szabolcs Nagy | c350468 | 2014-05-30 14:15:48 +0200 | [diff] [blame] | 201 | #define IP_NODEFRAG 22 |
Szabolcs Nagy | 1bfeb1d | 2015-04-14 21:56:37 +0000 | [diff] [blame] | 202 | #define IP_CHECKSUM 23 |
Rich Felker | c817566 | 2011-09-18 15:31:44 -0400 | [diff] [blame] | 203 | #define IP_MULTICAST_IF 32 |
| 204 | #define IP_MULTICAST_TTL 33 |
| 205 | #define IP_MULTICAST_LOOP 34 |
| 206 | #define IP_ADD_MEMBERSHIP 35 |
| 207 | #define IP_DROP_MEMBERSHIP 36 |
| 208 | #define IP_UNBLOCK_SOURCE 37 |
| 209 | #define IP_BLOCK_SOURCE 38 |
| 210 | #define IP_ADD_SOURCE_MEMBERSHIP 39 |
| 211 | #define IP_DROP_SOURCE_MEMBERSHIP 40 |
| 212 | #define IP_MSFILTER 41 |
Szabolcs Nagy | 119645b | 2013-01-11 01:54:53 +0100 | [diff] [blame] | 213 | #define IP_MULTICAST_ALL 49 |
| 214 | #define IP_UNICAST_IF 50 |
| 215 | |
Rich Felker | c817566 | 2011-09-18 15:31:44 -0400 | [diff] [blame] | 216 | #define IP_RECVRETOPTS IP_RETOPTS |
| 217 | |
| 218 | #define IP_PMTUDISC_DONT 0 |
| 219 | #define IP_PMTUDISC_WANT 1 |
| 220 | #define IP_PMTUDISC_DO 2 |
| 221 | #define IP_PMTUDISC_PROBE 3 |
Szabolcs Nagy | d82db85 | 2014-02-25 00:28:31 +0100 | [diff] [blame] | 222 | #define IP_PMTUDISC_INTERFACE 4 |
Szabolcs Nagy | c350468 | 2014-05-30 14:15:48 +0200 | [diff] [blame] | 223 | #define IP_PMTUDISC_OMIT 5 |
Rich Felker | c817566 | 2011-09-18 15:31:44 -0400 | [diff] [blame] | 224 | |
Rich Felker | c817566 | 2011-09-18 15:31:44 -0400 | [diff] [blame] | 225 | #define IP_DEFAULT_MULTICAST_TTL 1 |
| 226 | #define IP_DEFAULT_MULTICAST_LOOP 1 |
| 227 | #define IP_MAX_MEMBERSHIPS 20 |
| 228 | |
| 229 | struct ip_opts |
| 230 | { |
| 231 | struct in_addr ip_dst; |
| 232 | char ip_opts[40]; |
| 233 | }; |
| 234 | |
Rich Felker | acde013 | 2014-01-08 18:54:33 -0500 | [diff] [blame] | 235 | #if defined(_GNU_SOURCE) || defined(_BSD_SOURCE) |
| 236 | |
| 237 | #define MCAST_JOIN_GROUP 42 |
| 238 | #define MCAST_BLOCK_SOURCE 43 |
| 239 | #define MCAST_UNBLOCK_SOURCE 44 |
| 240 | #define MCAST_LEAVE_GROUP 45 |
| 241 | #define MCAST_JOIN_SOURCE_GROUP 46 |
| 242 | #define MCAST_LEAVE_SOURCE_GROUP 47 |
| 243 | #define MCAST_MSFILTER 48 |
| 244 | |
| 245 | #define MCAST_EXCLUDE 0 |
| 246 | #define MCAST_INCLUDE 1 |
| 247 | |
Rich Felker | c817566 | 2011-09-18 15:31:44 -0400 | [diff] [blame] | 248 | struct ip_mreq |
| 249 | { |
| 250 | struct in_addr imr_multiaddr; |
| 251 | struct in_addr imr_interface; |
| 252 | }; |
| 253 | |
| 254 | struct ip_mreqn |
| 255 | { |
| 256 | struct in_addr imr_multiaddr; |
| 257 | struct in_addr imr_address; |
| 258 | int imr_ifindex; |
| 259 | }; |
| 260 | |
Timo Teräs | 7c0ca4d | 2013-07-31 12:05:14 +0300 | [diff] [blame] | 261 | struct ip_mreq_source { |
| 262 | struct in_addr imr_multiaddr; |
| 263 | struct in_addr imr_interface; |
| 264 | struct in_addr imr_sourceaddr; |
| 265 | }; |
| 266 | |
| 267 | struct ip_msfilter { |
| 268 | struct in_addr imsf_multiaddr; |
| 269 | struct in_addr imsf_interface; |
| 270 | uint32_t imsf_fmode; |
| 271 | uint32_t imsf_numsrc; |
| 272 | struct in_addr imsf_slist[1]; |
| 273 | }; |
| 274 | #define IP_MSFILTER_SIZE(numsrc) \ |
| 275 | (sizeof(struct ip_msfilter) - sizeof(struct in_addr) \ |
| 276 | + (numsrc) * sizeof(struct in_addr)) |
| 277 | |
Timo Teräs | 7c0ca4d | 2013-07-31 12:05:14 +0300 | [diff] [blame] | 278 | struct group_req { |
| 279 | uint32_t gr_interface; |
| 280 | struct sockaddr_storage gr_group; |
| 281 | }; |
| 282 | |
| 283 | struct group_source_req { |
| 284 | uint32_t gsr_interface; |
| 285 | struct sockaddr_storage gsr_group; |
| 286 | struct sockaddr_storage gsr_source; |
| 287 | }; |
| 288 | |
| 289 | struct group_filter { |
| 290 | uint32_t gf_interface; |
| 291 | struct sockaddr_storage gf_group; |
| 292 | uint32_t gf_fmode; |
| 293 | uint32_t gf_numsrc; |
| 294 | struct sockaddr_storage gf_slist[1]; |
| 295 | }; |
| 296 | #define GROUP_FILTER_SIZE(numsrc) \ |
| 297 | (sizeof(struct group_filter) - sizeof(struct sockaddr_storage) \ |
| 298 | + (numsrc) * sizeof(struct sockaddr_storage)) |
Timo Teräs | 7c0ca4d | 2013-07-31 12:05:14 +0300 | [diff] [blame] | 299 | |
Rich Felker | c817566 | 2011-09-18 15:31:44 -0400 | [diff] [blame] | 300 | struct in_pktinfo |
| 301 | { |
| 302 | int ipi_ifindex; |
| 303 | struct in_addr ipi_spec_dst; |
| 304 | struct in_addr ipi_addr; |
| 305 | }; |
| 306 | |
| 307 | struct in6_pktinfo |
| 308 | { |
| 309 | struct in6_addr ipi6_addr; |
| 310 | unsigned ipi6_ifindex; |
| 311 | }; |
| 312 | |
Rich Felker | fd9e01e | 2011-09-20 20:02:48 -0400 | [diff] [blame] | 313 | struct ip6_mtuinfo |
Rich Felker | c817566 | 2011-09-18 15:31:44 -0400 | [diff] [blame] | 314 | { |
| 315 | struct sockaddr_in6 ip6m_addr; |
| 316 | uint32_t ip6m_mtu; |
| 317 | }; |
Rich Felker | acde013 | 2014-01-08 18:54:33 -0500 | [diff] [blame] | 318 | #endif |
Rich Felker | c817566 | 2011-09-18 15:31:44 -0400 | [diff] [blame] | 319 | |
| 320 | #define IPV6_ADDRFORM 1 |
| 321 | #define IPV6_2292PKTINFO 2 |
| 322 | #define IPV6_2292HOPOPTS 3 |
| 323 | #define IPV6_2292DSTOPTS 4 |
| 324 | #define IPV6_2292RTHDR 5 |
| 325 | #define IPV6_2292PKTOPTIONS 6 |
| 326 | #define IPV6_CHECKSUM 7 |
| 327 | #define IPV6_2292HOPLIMIT 8 |
Rich Felker | c817566 | 2011-09-18 15:31:44 -0400 | [diff] [blame] | 328 | #define IPV6_NEXTHOP 9 |
| 329 | #define IPV6_AUTHHDR 10 |
| 330 | #define IPV6_UNICAST_HOPS 16 |
| 331 | #define IPV6_MULTICAST_IF 17 |
| 332 | #define IPV6_MULTICAST_HOPS 18 |
| 333 | #define IPV6_MULTICAST_LOOP 19 |
| 334 | #define IPV6_JOIN_GROUP 20 |
| 335 | #define IPV6_LEAVE_GROUP 21 |
| 336 | #define IPV6_ROUTER_ALERT 22 |
| 337 | #define IPV6_MTU_DISCOVER 23 |
| 338 | #define IPV6_MTU 24 |
| 339 | #define IPV6_RECVERR 25 |
| 340 | #define IPV6_V6ONLY 26 |
| 341 | #define IPV6_JOIN_ANYCAST 27 |
| 342 | #define IPV6_LEAVE_ANYCAST 28 |
| 343 | #define IPV6_IPSEC_POLICY 34 |
| 344 | #define IPV6_XFRM_POLICY 35 |
| 345 | |
| 346 | #define IPV6_RECVPKTINFO 49 |
| 347 | #define IPV6_PKTINFO 50 |
| 348 | #define IPV6_RECVHOPLIMIT 51 |
| 349 | #define IPV6_HOPLIMIT 52 |
| 350 | #define IPV6_RECVHOPOPTS 53 |
| 351 | #define IPV6_HOPOPTS 54 |
| 352 | #define IPV6_RTHDRDSTOPTS 55 |
| 353 | #define IPV6_RECVRTHDR 56 |
| 354 | #define IPV6_RTHDR 57 |
| 355 | #define IPV6_RECVDSTOPTS 58 |
| 356 | #define IPV6_DSTOPTS 59 |
Szabolcs Nagy | c350468 | 2014-05-30 14:15:48 +0200 | [diff] [blame] | 357 | #define IPV6_RECVPATHMTU 60 |
| 358 | #define IPV6_PATHMTU 61 |
| 359 | #define IPV6_DONTFRAG 62 |
Rich Felker | c817566 | 2011-09-18 15:31:44 -0400 | [diff] [blame] | 360 | #define IPV6_RECVTCLASS 66 |
| 361 | #define IPV6_TCLASS 67 |
Szabolcs Nagy | a0c90b9 | 2014-10-01 22:17:53 +0200 | [diff] [blame] | 362 | #define IPV6_AUTOFLOWLABEL 70 |
Szabolcs Nagy | c350468 | 2014-05-30 14:15:48 +0200 | [diff] [blame] | 363 | #define IPV6_ADDR_PREFERENCES 72 |
| 364 | #define IPV6_MINHOPCOUNT 73 |
| 365 | #define IPV6_ORIGDSTADDR 74 |
| 366 | #define IPV6_RECVORIGDSTADDR IPV6_ORIGDSTADDR |
| 367 | #define IPV6_TRANSPARENT 75 |
| 368 | #define IPV6_UNICAST_IF 76 |
Rich Felker | c817566 | 2011-09-18 15:31:44 -0400 | [diff] [blame] | 369 | |
| 370 | #define IPV6_ADD_MEMBERSHIP IPV6_JOIN_GROUP |
| 371 | #define IPV6_DROP_MEMBERSHIP IPV6_LEAVE_GROUP |
| 372 | #define IPV6_RXHOPOPTS IPV6_HOPOPTS |
| 373 | #define IPV6_RXDSTOPTS IPV6_DSTOPTS |
| 374 | |
Rich Felker | c817566 | 2011-09-18 15:31:44 -0400 | [diff] [blame] | 375 | #define IPV6_PMTUDISC_DONT 0 |
| 376 | #define IPV6_PMTUDISC_WANT 1 |
| 377 | #define IPV6_PMTUDISC_DO 2 |
| 378 | #define IPV6_PMTUDISC_PROBE 3 |
Szabolcs Nagy | c350468 | 2014-05-30 14:15:48 +0200 | [diff] [blame] | 379 | #define IPV6_PMTUDISC_INTERFACE 4 |
| 380 | #define IPV6_PMTUDISC_OMIT 5 |
| 381 | |
| 382 | #define IPV6_PREFER_SRC_TMP 0x0001 |
| 383 | #define IPV6_PREFER_SRC_PUBLIC 0x0002 |
| 384 | #define IPV6_PREFER_SRC_PUBTMP_DEFAULT 0x0100 |
| 385 | #define IPV6_PREFER_SRC_COA 0x0004 |
| 386 | #define IPV6_PREFER_SRC_HOME 0x0400 |
| 387 | #define IPV6_PREFER_SRC_CGA 0x0008 |
| 388 | #define IPV6_PREFER_SRC_NONCGA 0x0800 |
Rich Felker | c817566 | 2011-09-18 15:31:44 -0400 | [diff] [blame] | 389 | |
Rich Felker | c817566 | 2011-09-18 15:31:44 -0400 | [diff] [blame] | 390 | #define IPV6_RTHDR_LOOSE 0 |
| 391 | #define IPV6_RTHDR_STRICT 1 |
| 392 | |
| 393 | #define IPV6_RTHDR_TYPE_0 0 |
| 394 | |
Rich Felker | 3ed8c9f | 2011-11-10 20:40:06 -0500 | [diff] [blame] | 395 | #ifdef __cplusplus |
| 396 | } |
| 397 | #endif |
| 398 | |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 399 | #endif |