1 /**
2     D header file for DragonFlyBSD's extensions to POSIX's netinet/in.h.
3 
4     Copyright: Copyright 2017 -
5     License: $(WEB www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
6     Authors: $(HTTP jmdavisprog.com, Jonathan M Davis) and Diederik de Groot
7  */
8 module core.sys.dragonflybsd.netinet.in_;
9 
10 version (DragonFlyBSD):
11 
12 import core.sys.dragonflybsd.sys.cdefs;
13 
14 public import core.sys.posix.netinet.in_;
15 
16 extern(C) nothrow @nogc @system:
17 
18 enum IPPROTO_HOPOPTS   = 0;
19 
20 enum IPPROTO_IPV4      = 4;
21 enum IPPROTO_IPIP      = IPPROTO_IPV4;
22 enum IPPROTO_ST        = 7;
23 enum IPPROTO_EGP       = 8;
24 enum IPPROTO_PIGP      = 9;
25 enum IPPROTO_RCCMON    = 10;
26 enum IPPROTO_NVPII     = 11;
27 
28 enum IPPROTO_ARGUS     = 13;
29 enum IPPROTO_EMCON     = 14;
30 enum IPPROTO_XNET      = 15;
31 enum IPPROTO_CHAOS     = 16;
32 enum IPPROTO_MUX       = 18;
33 enum IPPROTO_MEAS      = 19;
34 enum IPPROTO_HMP       = 20;
35 enum IPPROTO_PRM       = 21;
36 
37 enum IPPROTO_TRUNK1    = 23;
38 enum IPPROTO_TRUNK2    = 24;
39 enum IPPROTO_LEAF1     = 25;
40 enum IPPROTO_LEAF2     = 26;
41 enum IPPROTO_RDP       = 27;
42 enum IPPROTO_IRTP      = 28;
43 enum IPPROTO_TP        = 29;
44 enum IPPROTO_BLT       = 30;
45 enum IPPROTO_NSP       = 31;
46 enum IPPROTO_INP       = 32;
47 enum IPPROTO_SEP       = 33;
48 enum IPPROTO_3PC       = 34;
49 enum IPPROTO_IDPR      = 35;
50 enum IPPROTO_XTP       = 36;
51 enum IPPROTO_DDP       = 37;
52 enum IPPROTO_CMTP      = 38;
53 enum IPPROTO_TPXX      = 39;
54 enum IPPROTO_IL        = 40;
55 enum IPPROTO_SDRP      = 42;
56 enum IPPROTO_ROUTING   = 43;
57 enum IPPROTO_FRAGMENT  = 44;
58 enum IPPROTO_IDRP      = 45;
59 enum IPPROTO_RSVP      = 46;
60 enum IPPROTO_GRE       = 47;
61 enum IPPROTO_MHRP      = 48;
62 enum IPPROTO_BHA       = 49;
63 enum IPPROTO_ESP       = 50;
64 enum IPPROTO_AH        = 51;
65 enum IPPROTO_INLSP     = 52;
66 enum IPPROTO_SWIPE     = 53;
67 enum IPPROTO_NHRP      = 54;
68 enum IPPROTO_MOBILE    = 55;
69 enum IPPROTO_TLSP      = 56;
70 enum IPPROTO_SKIP      = 57;
71 enum IPPROTO_ICMPV6    = 58;
72 enum IPPROTO_NONE      = 59;
73 enum IPPROTO_DSTOPTS   = 60;
74 enum IPPROTO_AHIP      = 61;
75 enum IPPROTO_CFTP      = 62;
76 enum IPPROTO_HELLO     = 63;
77 enum IPPROTO_SATEXPAK  = 64;
78 enum IPPROTO_KRYPTOLAN = 65;
79 enum IPPROTO_RVD       = 66;
80 enum IPPROTO_IPPC      = 67;
81 enum IPPROTO_ADFS      = 68;
82 enum IPPROTO_SATMON    = 69;
83 enum IPPROTO_VISA      = 70;
84 enum IPPROTO_IPCV      = 71;
85 enum IPPROTO_CPNX      = 72;
86 enum IPPROTO_CPHB      = 73;
87 enum IPPROTO_WSN       = 74;
88 enum IPPROTO_PVP       = 75;
89 enum IPPROTO_BRSATMON  = 76;
90 
91 enum IPPROTO_WBMON     = 78;
92 enum IPPROTO_WBEXPAK   = 79;
93 enum IPPROTO_EON       = 80;
94 enum IPPROTO_VMTP      = 81;
95 enum IPPROTO_SVMTP     = 82;
96 enum IPPROTO_VINES     = 83;
97 enum IPPROTO_TTP       = 84;
98 enum IPPROTO_IGP       = 85;
99 enum IPPROTO_DGP       = 86;
100 enum IPPROTO_TCF       = 87;
101 enum IPPROTO_IGRP      = 88;
102 enum IPPROTO_OSPFIGP   = 89;
103 enum IPPROTO_SRPC      = 90;
104 enum IPPROTO_LARP      = 91;
105 enum IPPROTO_MTP       = 92;
106 enum IPPROTO_AX25      = 93;
107 enum IPPROTO_IPEIP     = 94;
108 enum IPPROTO_MICP      = 95;
109 enum IPPROTO_SCCSP     = 96;
110 enum IPPROTO_ETHERIP   = 97;
111 enum IPPROTO_ENCAP     = 98;
112 enum IPPROTO_APES      = 99;
113 enum IPPROTO_GMTP      = 100;
114 enum IPPROTO_IPCOMP    = 108;
115 enum IPPROTO_SCTP      = 132;
116 enum IPPROTO_MH        = 135;
117 enum IPPROTO_UDPLITE   = 136;
118 enum IPPROTO_HIP       = 139;
119 enum IPPROTO_SHIM6     = 140;
120 
121 enum IPPROTO_PIM          = 103;
122 enum IPPROTO_CARP         = 112;
123 enum IPPROTO_PGM          = 113;
124 enum IPPROTO_MPLS         = 137;
125 enum IPPROTO_PFSYNC       = 240;
126 enum IPPROTO_RESERVED_253 = 253;
127 enum IPPROTO_RESERVED_254 = 254;
128 
129 enum IPPROTO_DONE = 257;
130 
131 enum IPPORT_RESERVED = 1024;
132 
133 enum IPPORT_EPHEMERALFIRST = 10000;
134 enum IPPORT_EPHEMERALLAST  = 65535;
135 
136 enum IPPORT_HIFIRSTAUTO = 49152;
137 enum IPPORT_HILASTAUTO  = 65535;
138 
139 enum IPPORT_RESERVEDSTART = 600;
140 
141 enum IPPORT_MAX = 65535;
142 
143 extern(D) bool IN_CLASSA(in_addr_t i) pure @safe { return (i & 0x80000000) == 0; }
144 enum IN_CLASSA_NET    = 0xff000000;
145 enum IN_CLASSA_NSHIFT = 24;
146 enum IN_CLASSA_HOST   = 0x00ffffff;
147 enum IN_CLASSA_MAX    = 128;
148 
149 extern(D) bool IN_CLASSB(in_addr_t i) pure @safe { return (i & 0xc0000000) == 0x80000000; }
150 enum IN_CLASSB_NET    = 0xffff0000;
151 enum IN_CLASSB_NSHIFT = 16;
152 enum IN_CLASSB_HOST   = 0x0000ffff;
153 enum IN_CLASSB_MAX    = 65536;
154 
155 extern(D) bool IN_CLASSC(in_addr_t i) pure @safe { return (i & 0xe0000000) == 0xc0000000; }
156 enum IN_CLASSC_NET    = 0xffffff00;
157 enum IN_CLASSC_NSHIFT = 8;
158 enum IN_CLASSC_HOST   = 0x000000ff;
159 
160 extern(D) bool IN_CLASSD(in_addr_t i) pure @safe { return (i & 0xf0000000) == 0xe0000000; }
161 enum IN_CLASSD_NET     = 0xf0000000;
162 enum IN_CLASSD_NSHIFT  = 28;
163 enum IN_CLASSD_HOST    = 0x0fffffff;
164 extern(D) bool IN_MULTICAST(in_addr_t i) { return IN_CLASSD(i); }
165 
166 // The fact that these are identical looks suspicious (they're not quite
167 // identical on Linux). However, this _is_ how they're defined in DragonFlyBSD
168 // and on OS X. So, while it _might_ be a bug, if it is, it's an upstream
169 // one, and we're compatible with it.
170 extern(D) bool IN_EXPERIMENTAL(in_addr_t i) pure @safe { return (i & 0xf0000000) == 0xf0000000; }
171 extern(D) bool IN_BADCLASS(in_addr_t i) pure @safe { return (i & 0xf0000000) == 0xf0000000; }
172 
173 extern(D) bool IN_LINKLOCAL(in_addr_t i) pure @safe { return (i & 0xffff0000) == 0xa9fe0000; }
174 extern(D) bool IN_LOOPBACK(in_addr_t i) pure @safe { return (i & 0xff000000) == 0x7f000000; }
175 extern(D) bool IN_ZERONET(in_addr_t i) pure @safe { return (i & 0xff000000) == 0; }
176 
177 extern(D) bool IN_PRIVATE(in_addr_t i) pure @safe
178 {
179     return  (i & 0xff000000) == 0x0a000000 ||
180             (i & 0xfff00000) == 0xac100000 ||
181             (i & 0xffff0000) == 0xc0a80000;
182 }
183 
184 extern(D) bool IN_LOCAL_GROUP(in_addr_t i) pure @safe { return (i & 0xffffff00) == 0xe0000000; }
185 
186 extern(D) bool IN_ANY_LOCAL(in_addr_t i) pure @safe { return IN_LINKLOCAL(i) || IN_LOCAL_GROUP(i); }
187 
188 enum INADDR_UNSPEC_GROUP    = 0xe0000000;
189 enum INADDR_ALLHOSTS_GROUP  = 0xe0000001;
190 enum INADDR_ALLRTRS_GROUP   = 0xe0000002;
191 enum INADDR_ALLRPTS_GROUP   = 0xe0000016;
192 enum INADDR_CARP_GROUP      = 0xe0000012;
193 enum INADDR_PFSYNC_GROUP    = 0xe00000f0;
194 enum INADDR_ALLMDNS_GROUP   = 0xe00000fb;
195 enum INADDR_MAX_LOCAL_GROUP = 0xe00000ff;
196 
197 enum IN_LOOPBACKNET = 127;
198 
199 enum IN_RFC3021_MASK = 0xfffffffe;
200 
201 enum IP_OPTIONS      = 1;
202 enum IP_HDRINCL      = 2;
203 enum IP_TOS          = 3;
204 enum IP_TTL          = 4;
205 enum IP_RECVOPTS     = 5;
206 enum IP_RECVRETOPTS  = 6;
207 enum IP_RECVDSTADDR  = 7;
208 enum IP_SENDSRCADDR  = IP_RECVDSTADDR;
209 enum IP_RETOPTS      = 8;
210 enum IP_MULTICAST_IF = 9;
211 
212 enum IP_MULTICAST_TTL   = 10;
213 enum IP_MULTICAST_LOOP  = 11;
214 enum IP_ADD_MEMBERSHIP  = 12;
215 enum IP_DROP_MEMBERSHIP = 13;
216 enum IP_MULTICAST_VIF   = 14;
217 enum IP_RSVP_ON         = 15;
218 enum IP_RSVP_OFF        = 16;
219 enum IP_RSVP_VIF_ON     = 17;
220 enum IP_RSVP_VIF_OFF    = 18;
221 enum IP_PORTRANGE       = 19;
222 enum IP_RECVIF          = 20;
223 
224 enum IP_IPSEC_POLICY = 21;
225 
226 enum IP_ONESBCAST         = 23;
227 enum IP_BINDANY           = 24;
228 enum IP_BINDMULTI         = 25;
229 enum IP_RSS_LISTEN_BUCKET = 26;
230 enum IP_ORIGDSTADDR       = 27;
231 enum IP_RECVORIGDSTADDR   = IP_ORIGDSTADDR;
232 
233 enum IP_FW3       = 48;
234 enum IP_DUMMYNET3 = 49;
235 
236 enum IP_ADD_SOURCE_MEMBERSHIP  = 70;
237 enum IP_DROP_SOURCE_MEMBERSHIP = 71;
238 enum IP_BLOCK_SOURCE           = 72;
239 enum IP_UNBLOCK_SOURCE         = 73;
240 
241 enum MCAST_JOIN_GROUP         = 80;
242 enum MCAST_LEAVE_GROUP        = 81;
243 enum MCAST_JOIN_SOURCE_GROUP  = 82;
244 enum MCAST_LEAVE_SOURCE_GROUP = 83;
245 enum MCAST_BLOCK_SOURCE       = 84;
246 enum MCAST_UNBLOCK_SOURCE     = 85;
247 
248 enum IP_FLOWID          = 90;
249 enum IP_FLOWTYPE        = 91;
250 enum IP_RSSBUCKETID     = 92;
251 enum IP_RECVFLOWID      = 93;
252 enum IP_RECVRSSBUCKETID = 94;
253 
254 enum IP_DEFAULT_MULTICAST_TTL  = 1;
255 enum IP_DEFAULT_MULTICAST_LOOP = 1;
256 
257 enum IP_MIN_MEMBERSHIPS   = 31;
258 enum IP_MAX_MEMBERSHIPS   = 4095;
259 
260 enum IP_MAX_GROUP_SRC_FILTER = 512;
261 enum IP_MAX_SOCK_SRC_FILTER  = 128;
262 
263 struct ip_mreq
264 {
265     in_addr imr_multiaddr;
266     in_addr imr_interface;
267 }
268 
269 struct ip_mreqn
270 {
271     in_addr imr_multiaddr;
272     in_addr imr_address;
273     int     imr_ifindex;
274 }
275 
276 struct ip_mreq_source
277 {
278     in_addr imr_multiaddr;
279     in_addr imr_sourceaddr;
280     in_addr imr_interface;
281 }
282 
283 struct group_req
284 {
285     uint gr_interface;
286     sockaddr_storage gr_group;
287 }
288 
289 struct group_source_req
290 {
291     uint gsr_interface;
292     sockaddr_storage gsr_group;
293     sockaddr_storage gsr_source;
294 }
295 
296 int setipv4sourcefilter(int, in_addr, in_addr, uint, uint, in_addr*);
297 int getipv4sourcefilter(int, in_addr, in_addr, uint*, uint*, in_addr*);
298 int setsourcefilter(int, uint, sockaddr*, socklen_t, uint, uint, sockaddr_storage*);
299 int getsourcefilter(int, uint, sockaddr*, socklen_t, uint*, uint*, sockaddr_storage*);
300 
301 enum MCAST_UNDEFINED = 0;
302 enum MCAST_INCLUDE   = 1;
303 enum MCAST_EXCLUDE   = 2;
304 
305 enum IP_PORTRANGE_DEFAULT = 0;
306 enum IP_PORTRANGE_HIGH    = 1;
307 enum IP_PORTRANGE_LOW     = 2;
308 
309 enum IPCTL_FORWARDING        = 1;
310 enum IPCTL_SENDREDIRECTS     = 2;
311 enum IPCTL_DEFTTL            = 3;
312 enum IPCTL_DEFMTU            = 4;
313 enum IPCTL_SOURCEROUTE       = 8;
314 enum IPCTL_DIRECTEDBROADCAST = 9;
315 enum IPCTL_INTRQMAXLEN       = 10;
316 enum IPCTL_INTRQDROPS        = 11;
317 enum IPCTL_STATS             = 12;
318 enum IPCTL_ACCEPTSOURCEROUTE = 13;
319 enum IPCTL_FASTFORWARDING    = 14;
320 enum IPCTL_GIF_TTL           = 16;
321 enum IPCTL_INTRDQMAXLEN      = 17;
322 enum IPCTL_INTRDQDROPS       = 18;
323 
324 // =============================================================================
325 // What follows is from netinet6/in6.h, but since netinet6/in6.h specifically
326 // says that it should only be #included by #including netinet/in.h, it makes
327 // more sense to put them in here so that the way they're imported corresponds
328 // with the correct way of #including them in C/C++.
329 // =============================================================================
330 
331 // The #if was around the #include of in6.h at the end of in.h.
332 enum IPV6PORT_RESERVED    = 1024;
333 enum IPV6PORT_ANONMIN     = 49152;
334 enum IPV6PORT_ANONMAX     = 65535;
335 enum IPV6PORT_RESERVEDMIN = 600;
336 enum IPV6PORT_RESERVEDMAX = IPV6PORT_RESERVED - 1;
337 
338 enum IN6ADDR_ANY_INIT = in6_addr.init;
339 enum IN6ADDR_LOOPBACK_INIT = in6_addr([0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
340                                        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01]);
341 enum IN6ADDR_NODELOCAL_ALLNODES_INIT = in6_addr([0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
342                                                  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01]);
343 enum IN6ADDR_INTFACELOCAL_ALLNODES_INIT = in6_addr([0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
344                                                     0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01]);
345 enum IN6ADDR_LINKLOCAL_ALLNODES_INIT = in6_addr([0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
346                                                  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01]);
347 enum IN6ADDR_LINKLOCAL_ALLROUTERS_INIT = in6_addr([0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
348                                                    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02]);
349 enum IN6ADDR_LINKLOCAL_ALLV2ROUTERS_INIT = in6_addr([0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
350                                                      0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16]);
351 
352 __gshared const in6_addr in6addr_nodelocal_allnodes;
353 __gshared const in6_addr in6addr_linklocal_allnodes;
354 __gshared const in6_addr in6addr_linklocal_allrouters;
355 __gshared const in6_addr in6addr_linklocal_allv2routers;
356 
357 extern(D) bool IN6_ARE_ADDR_EQUAL(in6_addr* a, in6_addr* b) pure @safe { return *a == *b; }
358 
359 enum __IPV6_ADDR_SCOPE_NODELOCAL    = 0x01;
360 enum __IPV6_ADDR_SCOPE_INTFACELOCAL = 0x01;
361 enum __IPV6_ADDR_SCOPE_LINKLOCAL    = 0x02;
362 enum __IPV6_ADDR_SCOPE_SITELOCAL    = 0x05;
363 enum __IPV6_ADDR_SCOPE_GLOBAL       = 0x0e;
364 
365 // TODO - requires declarations from elsewhere that we don't currently have bindings for.
366 /+
367     struct route_in6
368     {
369         rtentry* ro_rt;
370         llentry* ro_lle;
371         char*    ro_prepend;
372         ushort   ro_plen;
373         ushort   ro_flags;
374         ushort   ro_mtu;
375         ushort   spare;
376         sockaddr_in6 ro_dst;
377     };
378 +/
379 
380 enum IPV6_SOCKOPT_RESERVED1 = 3;
381 enum IPV6_PORTRANGE         = 14;
382 enum ICMP6_FILTER           = 18;
383 
384 enum IPV6_CHECKSUM = 26;
385 
386 enum IPV6_IPSEC_POLICY = 28;
387 
388 enum IPV6_FW_ADD   = 30;
389 enum IPV6_FW_DEL   = 31;
390 enum IPV6_FW_FLUSH = 32;
391 enum IPV6_FW_ZERO  = 33;
392 enum IPV6_FW_GET   = 34;
393 
394 enum IPV6_RTHDRDSTOPTS = 35;
395 
396 enum IPV6_RECVPKTINFO  = 36;
397 enum IPV6_RECVHOPLIMIT = 37;
398 enum IPV6_RECVRTHDR    = 38;
399 enum IPV6_RECVHOPOPTS  = 39;
400 enum IPV6_RECVDSTOPTS  = 40;
401 
402 enum IPV6_USE_MIN_MTU = 42;
403 enum IPV6_RECVPATHMTU = 43;
404 
405 enum IPV6_PATHMTU = 44;
406 
407 enum IPV6_PKTINFO  = 46;
408 enum IPV6_HOPLIMIT = 47;
409 enum IPV6_NEXTHOP  = 48;
410 enum IPV6_HOPOPTS  = 49;
411 enum IPV6_DSTOPTS  = 50;
412 enum IPV6_RTHDR    = 51;
413 
414 enum IPV6_RECVTCLASS = 57;
415 
416 enum IPV6_AUTOFLOWLABEL = 59;
417 
418 enum IPV6_TCLASS   = 61;
419 enum IPV6_DONTFRAG = 62;
420 
421 enum IPV6_PREFER_TEMPADDR = 63;
422 
423 enum IPV6_BINDANY   = 64;
424 
425 enum IPV6_BINDMULTI         = 65;
426 enum IPV6_RSS_LISTEN_BUCKET = 66;
427 enum IPV6_FLOWID            = 67;
428 enum IPV6_FLOWTYPE          = 68;
429 enum IPV6_RSSBUCKETID       = 69;
430 enum IPV6_RECVFLOWID        = 70;
431 enum IPV6_RECVRSSBUCKETID   = 71;
432 
433 enum IPV6_ORIGDSTADDR     = 72;
434 enum IPV6_RECVORIGDSTADDR = IPV6_ORIGDSTADDR;
435 
436 enum IPV6_RTHDR_LOOSE  = 0;
437 enum IPV6_RTHDR_STRICT = 1;
438 enum IPV6_RTHDR_TYPE_0 = 0;
439 
440 enum IPV6_DEFAULT_MULTICAST_HOPS = 1;
441 enum IPV6_DEFAULT_MULTICAST_LOOP = 1;
442 
443 enum IPV6_MIN_MEMBERSHIPS = 31;
444 enum IPV6_MAX_MEMBERSHIPS = 4095;
445 
446 enum IPV6_MAX_GROUP_SRC_FILTER = 512;
447 enum IPV6_MAX_SOCK_SRC_FILTER  = 128;
448 
449 struct in6_pktinfo
450 {
451     in6_addr ipi6_addr;
452     uint     ipi6_ifindex;
453 }
454 
455 struct ip6_mtuinfo
456 {
457     sockaddr_in6 ip6m_addr;
458     uint         ip6m_mtu;
459 }
460 
461 enum IPV6_PORTRANGE_DEFAULT = 0;
462 enum IPV6_PORTRANGE_HIGH    = 1;
463 enum IPV6_PORTRANGE_LOW     = 2;
464 
465 enum IPV6PROTO_MAXID =  IPPROTO_PIM + 1;
466 
467 enum IPV6CTL_FORWARDING         = 1;
468 enum IPV6CTL_SENDREDIRECTS      = 2;
469 enum IPV6CTL_DEFHLIM            = 3;
470 enum IPV6CTL_DEFMTU             = 4;
471 enum IPV6CTL_FORWSRCRT          = 5;
472 enum IPV6CTL_STATS              = 6;
473 enum IPV6CTL_MRTSTATS           = 7;
474 enum IPV6CTL_MRTPROTO           = 8;
475 enum IPV6CTL_MAXFRAGPACKETS     = 9;
476 enum IPV6CTL_SOURCECHECK        = 10;
477 enum IPV6CTL_SOURCECHECK_LOGINT = 11;
478 enum IPV6CTL_ACCEPT_RTADV       = 12;
479 
480 enum IPV6CTL_LOG_INTERVAL   = 14;
481 enum IPV6CTL_HDRNESTLIMIT   = 15;
482 enum IPV6CTL_DAD_COUNT      = 16;
483 enum IPV6CTL_AUTO_FLOWLABEL = 17;
484 enum IPV6CTL_DEFMCASTHLIM   = 18;
485 enum IPV6CTL_GIF_HLIM       = 19;
486 enum IPV6CTL_KAME_VERSION   = 20;
487 enum IPV6CTL_USE_DEPRECATED = 21;
488 enum IPV6CTL_RR_PRUNE       = 22;
489 enum IPV6CTL_V6ONLY         = 24;
490 
491 enum IPV6CTL_USETEMPADDR     = 32;
492 enum IPV6CTL_TEMPPLTIME      = 33;
493 enum IPV6CTL_TEMPVLTIME      = 34;
494 enum IPV6CTL_AUTO_LINKLOCAL  = 35;
495 enum IPV6CTL_RIP6STATS       = 36;
496 enum IPV6CTL_PREFER_TEMPADDR = 37;
497 enum IPV6CTL_ADDRCTLPOLICY   = 38;
498 enum IPV6CTL_USE_DEFAULTZONE = 39;
499 
500 enum IPV6CTL_MAXFRAGS   = 41;
501 enum IPV6CTL_MCAST_PMTU = 44;
502 
503 enum IPV6CTL_STEALTH = 45;
504 
505 enum ICMPV6CTL_ND6_ONLINKNSRFC4861 = 47;
506 enum IPV6CTL_NO_RADR     = 48;
507 enum IPV6CTL_NORBIT_RAIF = 49;
508 
509 enum IPV6CTL_RFC6204W3 = 50;
510 
511 enum IPV6CTL_INTRQMAXLEN  = 51;
512 enum IPV6CTL_INTRDQMAXLEN = 52;
513 
514 enum IPV6CTL_MAXID = 53;
515 
516 // TODO - require declarations from elsewhere that we don't currently have bindings for.
517 /+
518 enum M_FASTFWD_OURS  = M_PROTO1;
519 enum M_IP6_NEXTHOP   = M_PROTO2;
520 enum M_IP_NEXTHOP    = M_PROTO2;
521 enum M_SKIP_FIREWALL = M_PROTO3;
522 enum M_AUTHIPHDR     = M_PROTO4;
523 enum M_DECRYPTED     = M_PROTO5;
524 enum M_LOOP          = M_PROTO6;
525 enum M_AUTHIPDGM     = M_PROTO7;
526 enum M_RTALERT_MLD   = M_PROTO8;
527 +/
528 
529 size_t inet6_rthdr_space(int, int) @trusted;
530 cmsghdr* inet6_rthdr_init(void*, int);
531 int inet6_rthdr_add(cmsghdr*, const in6_addr*, uint);
532 int inet6_rthdr_lasthop(cmsghdr*, uint);
533 int inet6_rthdr_segments(const cmsghdr*);
534 in6_addr* inet6_rthdr_getaddr(cmsghdr*, int);
535 int inet6_rthdr_getflags(const cmsghdr*, int);
536 
537 int inet6_opt_init(void*, socklen_t);
538 int inet6_opt_append(void*, socklen_t, int, ubyte, socklen_t, ubyte, void**);
539 int inet6_opt_finish(void*, socklen_t, int);
540 int inet6_opt_set_val(void*, int, void*, socklen_t);
541 
542 int inet6_opt_next(void*, socklen_t, int, ubyte*, socklen_t*, void**);
543 int inet6_opt_find(void*, socklen_t, int, ubyte, socklen_t*, void**);
544 int inet6_opt_get_val(void*, int, void*, socklen_t);
545 socklen_t inet6_rth_space(int, int) @trusted;
546 void* inet6_rth_init(void*, socklen_t, int, int);
547 int inet6_rth_add(void*, const in6_addr*);
548 int inet6_rth_reverse(const void*, void*);
549 int inet6_rth_segments(const void*);
550 in6_addr* inet6_rth_getaddr(const void*, int);