Cygwin: unlink_nt: clean up debug output and comment
[newlib-cygwin.git] / newlib / libc / sys / rtems / include / netinet6 / in6.h
blob55be82fed46b681c54e81ebdcb91123b78835cc7
1 /*-
2 * SPDX-License-Identifier: BSD-3-Clause
4 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
5 * All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of the project nor the names of its contributors
16 * may be used to endorse or promote products derived from this software
17 * without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE.
31 * $KAME: in6.h,v 1.89 2001/05/27 13:28:35 itojun Exp $
34 /*-
35 * Copyright (c) 1982, 1986, 1990, 1993
36 * The Regents of the University of California. All rights reserved.
38 * Redistribution and use in source and binary forms, with or without
39 * modification, are permitted provided that the following conditions
40 * are met:
41 * 1. Redistributions of source code must retain the above copyright
42 * notice, this list of conditions and the following disclaimer.
43 * 2. Redistributions in binary form must reproduce the above copyright
44 * notice, this list of conditions and the following disclaimer in the
45 * documentation and/or other materials provided with the distribution.
46 * 3. Neither the name of the University nor the names of its contributors
47 * may be used to endorse or promote products derived from this software
48 * without specific prior written permission.
50 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
51 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
52 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
53 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
54 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
55 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
56 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
57 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
58 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
59 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
60 * SUCH DAMAGE.
62 * @(#)in.h 8.3 (Berkeley) 1/3/94
63 * $FreeBSD$
66 #ifndef __KAME_NETINET_IN_H_INCLUDED_
67 #error "do not include netinet6/in6.h directly, include netinet/in.h. see RFC2553"
68 #endif
70 #ifndef _NETINET6_IN6_H_
71 #define _NETINET6_IN6_H_
74 * Identification of the network protocol stack
75 * for *BSD-current/release: http://www.kame.net/dev/cvsweb.cgi/kame/COVERAGE
76 * has the table of implementation/integration differences.
78 #define __KAME__
79 #define __KAME_VERSION "FreeBSD"
82 * IPv6 port allocation rules should mirror the IPv4 rules and are controlled
83 * by the net.inet.ip.portrange sysctl tree. The following defines exist
84 * for compatibility with userland applications that need them.
86 #if __BSD_VISIBLE
87 #define IPV6PORT_RESERVED 1024
88 #define IPV6PORT_ANONMIN 49152
89 #define IPV6PORT_ANONMAX 65535
90 #define IPV6PORT_RESERVEDMIN 600
91 #define IPV6PORT_RESERVEDMAX (IPV6PORT_RESERVED-1)
92 #endif
95 * IPv6 address
97 struct in6_addr {
98 union {
99 uint8_t __u6_addr8[16];
100 uint16_t __u6_addr16[8];
101 uint32_t __u6_addr32[4];
102 } __u6_addr; /* 128-bit IP6 address */
105 #define s6_addr __u6_addr.__u6_addr8
107 #define INET6_ADDRSTRLEN 46
110 * XXX missing POSIX.1-2001 macro IPPROTO_IPV6.
114 * Socket address for IPv6
116 #if __BSD_VISIBLE
117 #define SIN6_LEN
118 #endif
120 struct sockaddr_in6 {
121 uint8_t sin6_len; /* length of this struct */
122 sa_family_t sin6_family; /* AF_INET6 */
123 in_port_t sin6_port; /* Transport layer port # */
124 uint32_t sin6_flowinfo; /* IP6 flow information */
125 struct in6_addr sin6_addr; /* IP6 address */
126 uint32_t sin6_scope_id; /* scope zone index */
130 * Definition of some useful macros to handle IP6 addresses
132 #if __BSD_VISIBLE
133 #define IN6ADDR_ANY_INIT \
134 {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
135 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }}}
136 #define IN6ADDR_LOOPBACK_INIT \
137 {{{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
138 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}}
139 #define IN6ADDR_NODELOCAL_ALLNODES_INIT \
140 {{{ 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
141 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}}
142 #define IN6ADDR_INTFACELOCAL_ALLNODES_INIT \
143 {{{ 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
144 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}}
145 #define IN6ADDR_LINKLOCAL_ALLNODES_INIT \
146 {{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
147 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }}}
148 #define IN6ADDR_LINKLOCAL_ALLROUTERS_INIT \
149 {{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
150 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02 }}}
151 #define IN6ADDR_LINKLOCAL_ALLV2ROUTERS_INIT \
152 {{{ 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
153 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16 }}}
154 #endif
156 extern const struct in6_addr in6addr_any;
157 extern const struct in6_addr in6addr_loopback;
158 #if __BSD_VISIBLE
159 extern const struct in6_addr in6addr_nodelocal_allnodes;
160 extern const struct in6_addr in6addr_linklocal_allnodes;
161 extern const struct in6_addr in6addr_linklocal_allrouters;
162 extern const struct in6_addr in6addr_linklocal_allv2routers;
163 #endif
166 * Equality
167 * NOTE: Some of kernel programming environment (for example, openbsd/sparc)
168 * does not supply memcmp(). For userland memcmp() is preferred as it is
169 * in ANSI standard.
171 #if __BSD_VISIBLE
172 #define IN6_ARE_ADDR_EQUAL(a, b) \
173 (memcmp(&(a)->s6_addr[0], &(b)->s6_addr[0], sizeof(struct in6_addr)) == 0)
174 #endif
177 * Unspecified
179 #define IN6_IS_ADDR_UNSPECIFIED(a) \
180 ((a)->__u6_addr.__u6_addr32[0] == 0 && \
181 (a)->__u6_addr.__u6_addr32[1] == 0 && \
182 (a)->__u6_addr.__u6_addr32[2] == 0 && \
183 (a)->__u6_addr.__u6_addr32[3] == 0)
186 * Loopback
188 #define IN6_IS_ADDR_LOOPBACK(a) \
189 ((a)->__u6_addr.__u6_addr32[0] == 0 && \
190 (a)->__u6_addr.__u6_addr32[1] == 0 && \
191 (a)->__u6_addr.__u6_addr32[2] == 0 && \
192 (a)->__u6_addr.__u6_addr32[3] == ntohl(1))
195 * IPv4 compatible
197 #define IN6_IS_ADDR_V4COMPAT(a) \
198 ((a)->__u6_addr.__u6_addr32[0] == 0 && \
199 (a)->__u6_addr.__u6_addr32[1] == 0 && \
200 (a)->__u6_addr.__u6_addr32[2] == 0 && \
201 (a)->__u6_addr.__u6_addr32[3] != 0 && \
202 (a)->__u6_addr.__u6_addr32[3] != ntohl(1))
205 * Mapped
207 #define IN6_IS_ADDR_V4MAPPED(a) \
208 ((a)->__u6_addr.__u6_addr32[0] == 0 && \
209 (a)->__u6_addr.__u6_addr32[1] == 0 && \
210 (a)->__u6_addr.__u6_addr32[2] == ntohl(0x0000ffff))
213 * KAME Scope Values
216 #ifndef _KERNEL
217 #define __IPV6_ADDR_SCOPE_NODELOCAL 0x01
218 #define __IPV6_ADDR_SCOPE_INTFACELOCAL 0x01
219 #define __IPV6_ADDR_SCOPE_LINKLOCAL 0x02
220 #define __IPV6_ADDR_SCOPE_SITELOCAL 0x05
221 #define __IPV6_ADDR_SCOPE_ORGLOCAL 0x08 /* just used in this file */
222 #define __IPV6_ADDR_SCOPE_GLOBAL 0x0e
223 #endif
226 * Unicast Scope
227 * Note that we must check topmost 10 bits only, not 16 bits (see RFC2373).
229 #define IN6_IS_ADDR_LINKLOCAL(a) \
230 (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0x80))
231 #define IN6_IS_ADDR_SITELOCAL(a) \
232 (((a)->s6_addr[0] == 0xfe) && (((a)->s6_addr[1] & 0xc0) == 0xc0))
235 * Multicast
237 #define IN6_IS_ADDR_MULTICAST(a) ((a)->s6_addr[0] == 0xff)
239 #ifndef _KERNEL
240 #define __IPV6_ADDR_MC_SCOPE(a) ((a)->s6_addr[1] & 0x0f)
241 #endif
244 * Multicast Scope
246 #ifndef _KERNEL
247 #define IN6_IS_ADDR_MC_NODELOCAL(a) \
248 (IN6_IS_ADDR_MULTICAST(a) && \
249 (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_NODELOCAL))
250 #define IN6_IS_ADDR_MC_LINKLOCAL(a) \
251 (IN6_IS_ADDR_MULTICAST(a) && \
252 (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_LINKLOCAL))
253 #define IN6_IS_ADDR_MC_SITELOCAL(a) \
254 (IN6_IS_ADDR_MULTICAST(a) && \
255 (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_SITELOCAL))
256 #define IN6_IS_ADDR_MC_ORGLOCAL(a) \
257 (IN6_IS_ADDR_MULTICAST(a) && \
258 (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_ORGLOCAL))
259 #define IN6_IS_ADDR_MC_GLOBAL(a) \
260 (IN6_IS_ADDR_MULTICAST(a) && \
261 (__IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_GLOBAL))
262 #endif
265 * IP6 route structure
267 #if __BSD_VISIBLE
268 struct nhop_object;
269 struct route_in6 {
270 #if __FreeBSD_version >= 1300092
271 struct nhop_object *ro_nh;
272 #else
273 struct rtentry *ro_rt;
274 #endif
275 struct llentry *ro_lle;
277 * ro_prepend and ro_plen are only used for bpf to pass in a
278 * preformed header. They are not cacheable.
280 char *ro_prepend;
281 uint16_t ro_plen;
282 uint16_t ro_flags;
283 uint16_t ro_mtu; /* saved ro_rt mtu */
284 uint16_t spare;
285 struct sockaddr_in6 ro_dst;
287 #endif
290 * Options for use with [gs]etsockopt at the IPV6 level.
291 * First word of comment is data type; bool is stored in int.
293 /* no hdrincl */
294 #if 0 /* the followings are relic in IPv4 and hence are disabled */
295 #define IPV6_OPTIONS 1 /* buf/ip6_opts; set/get IP6 options */
296 #define IPV6_RECVOPTS 5 /* bool; receive all IP6 opts w/dgram */
297 #define IPV6_RECVRETOPTS 6 /* bool; receive IP6 opts for response */
298 #define IPV6_RECVDSTADDR 7 /* bool; receive IP6 dst addr w/dgram */
299 #define IPV6_RETOPTS 8 /* ip6_opts; set/get IP6 options */
300 #endif
301 #define IPV6_SOCKOPT_RESERVED1 3 /* reserved for future use */
302 #define IPV6_UNICAST_HOPS 4 /* int; IP6 hops */
303 #define IPV6_MULTICAST_IF 9 /* u_int; set/get IP6 multicast i/f */
304 #define IPV6_MULTICAST_HOPS 10 /* int; set/get IP6 multicast hops */
305 #define IPV6_MULTICAST_LOOP 11 /* u_int; set/get IP6 multicast loopback */
306 #define IPV6_JOIN_GROUP 12 /* ipv6_mreq; join a group membership */
307 #define IPV6_LEAVE_GROUP 13 /* ipv6_mreq; leave a group membership */
308 #define IPV6_PORTRANGE 14 /* int; range to choose for unspec port */
309 #define ICMP6_FILTER 18 /* icmp6_filter; icmp6 filter */
311 #define IPV6_CHECKSUM 26 /* int; checksum offset for raw socket */
312 #define IPV6_V6ONLY 27 /* bool; make AF_INET6 sockets v6 only */
313 #ifndef _KERNEL
314 #define IPV6_BINDV6ONLY IPV6_V6ONLY
315 #endif
317 #define IPV6_IPSEC_POLICY 28 /* struct; get/set security policy */
318 /* 29; unused; was IPV6_FAITH */
319 #if 1 /* IPV6FIREWALL */
320 #define IPV6_FW_ADD 30 /* add a firewall rule to chain */
321 #define IPV6_FW_DEL 31 /* delete a firewall rule from chain */
322 #define IPV6_FW_FLUSH 32 /* flush firewall rule chain */
323 #define IPV6_FW_ZERO 33 /* clear single/all firewall counter(s) */
324 #define IPV6_FW_GET 34 /* get entire firewall rule chain */
325 #endif
327 /* new socket options introduced in RFC3542 */
328 #define IPV6_RTHDRDSTOPTS 35 /* ip6_dest; send dst option before rthdr */
330 #define IPV6_RECVPKTINFO 36 /* bool; recv if, dst addr */
331 #define IPV6_RECVHOPLIMIT 37 /* bool; recv hop limit */
332 #define IPV6_RECVRTHDR 38 /* bool; recv routing header */
333 #define IPV6_RECVHOPOPTS 39 /* bool; recv hop-by-hop option */
334 #define IPV6_RECVDSTOPTS 40 /* bool; recv dst option after rthdr */
336 #define IPV6_USE_MIN_MTU 42 /* bool; send packets at the minimum MTU */
337 #define IPV6_RECVPATHMTU 43 /* bool; notify an according MTU */
339 #define IPV6_PATHMTU 44 /* mtuinfo; get the current path MTU (sopt),
340 4 bytes int; MTU notification (cmsg) */
341 #if 0 /*obsoleted during 2292bis -> 3542*/
342 #define IPV6_REACHCONF 45 /* no data; ND reachability confirm
343 (cmsg only/not in of RFC3542) */
344 #endif
346 /* more new socket options introduced in RFC3542 */
347 #define IPV6_PKTINFO 46 /* in6_pktinfo; send if, src addr */
348 #define IPV6_HOPLIMIT 47 /* int; send hop limit */
349 #define IPV6_NEXTHOP 48 /* sockaddr; next hop addr */
350 #define IPV6_HOPOPTS 49 /* ip6_hbh; send hop-by-hop option */
351 #define IPV6_DSTOPTS 50 /* ip6_dest; send dst option befor rthdr */
352 #define IPV6_RTHDR 51 /* ip6_rthdr; send routing header */
353 #if 0
354 #define IPV6_PKTOPTIONS 52 /* buf/cmsghdr; set/get IPv6 options */
355 /* obsoleted by RFC3542 */
356 #endif
358 #define IPV6_RECVTCLASS 57 /* bool; recv traffic class values */
360 #define IPV6_AUTOFLOWLABEL 59 /* bool; attach flowlabel automagically */
362 #define IPV6_TCLASS 61 /* int; send traffic class value */
363 #define IPV6_DONTFRAG 62 /* bool; disable IPv6 fragmentation */
365 #define IPV6_PREFER_TEMPADDR 63 /* int; prefer temporary addresses as
366 * the source address.
369 #define IPV6_BINDANY 64 /* bool: allow bind to any address */
371 #define IPV6_BINDMULTI 65 /* bool; allow multibind to same addr/port */
372 #define IPV6_RSS_LISTEN_BUCKET 66 /* int; set RSS listen bucket */
373 #define IPV6_FLOWID 67 /* int; flowid of given socket */
374 #define IPV6_FLOWTYPE 68 /* int; flowtype of given socket */
375 #define IPV6_RSSBUCKETID 69 /* int; RSS bucket ID of given socket */
376 #define IPV6_RECVFLOWID 70 /* bool; receive IP6 flowid/flowtype w/ datagram */
377 #define IPV6_RECVRSSBUCKETID 71 /* bool; receive IP6 RSS bucket id w/ datagram */
379 #define IPV6_ORIGDSTADDR 72 /* bool: allow getting dstaddr /port info */
380 #define IPV6_RECVORIGDSTADDR IPV6_ORIGDSTADDR
383 * The following option is private; do not use it from user applications.
384 * It is deliberately defined to the same value as IP_MSFILTER.
386 #define IPV6_MSFILTER 74 /* struct __msfilterreq;
387 * set/get multicast source filter list.
390 /* The following option deals with the 802.1Q Ethernet Priority Code Point */
391 #define IPV6_VLAN_PCP 75 /* int; set/get PCP used for packet, */
392 /* -1 use interface default */
394 /* to define items, should talk with KAME guys first, for *BSD compatibility */
396 #define IPV6_RTHDR_LOOSE 0 /* this hop need not be a neighbor. XXX old spec */
397 #define IPV6_RTHDR_STRICT 1 /* this hop must be a neighbor. XXX old spec */
398 #define IPV6_RTHDR_TYPE_0 0 /* IPv6 routing header type 0 */
401 * Defaults and limits for options
403 #define IPV6_DEFAULT_MULTICAST_HOPS 1 /* normally limit m'casts to 1 hop */
404 #define IPV6_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */
407 * Limit for IPv6 multicast memberships
409 #define IPV6_MAX_MEMBERSHIPS 4095
412 * Default resource limits for IPv6 multicast source filtering.
413 * These may be modified by sysctl.
415 #define IPV6_MAX_GROUP_SRC_FILTER 512 /* sources per group */
416 #define IPV6_MAX_SOCK_SRC_FILTER 128 /* sources per socket/group */
419 * Argument structure for IPV6_JOIN_GROUP and IPV6_LEAVE_GROUP.
421 struct ipv6_mreq {
422 struct in6_addr ipv6mr_multiaddr;
423 unsigned int ipv6mr_interface;
427 * IPV6_PKTINFO: Packet information(RFC2292 sec 5)
429 struct in6_pktinfo {
430 struct in6_addr ipi6_addr; /* src/dst IPv6 address */
431 unsigned int ipi6_ifindex; /* send/recv interface index */
435 * Control structure for IPV6_RECVPATHMTU socket option.
437 struct ip6_mtuinfo {
438 struct sockaddr_in6 ip6m_addr; /* or sockaddr_storage? */
439 uint32_t ip6m_mtu;
443 * Argument for IPV6_PORTRANGE:
444 * - which range to search when port is unspecified at bind() or connect()
446 #define IPV6_PORTRANGE_DEFAULT 0 /* default range */
447 #define IPV6_PORTRANGE_HIGH 1 /* "high" - request firewall bypass */
448 #define IPV6_PORTRANGE_LOW 2 /* "low" - vouchsafe security */
450 #if __BSD_VISIBLE
452 * Definitions for inet6 sysctl operations.
454 * Third level is protocol number.
455 * Fourth level is desired variable within that protocol.
457 #define IPV6PROTO_MAXID (IPPROTO_PIM + 1) /* don't list to IPV6PROTO_MAX */
460 * Names for IP sysctl objects
462 #define IPV6CTL_FORWARDING 1 /* act as router */
463 #define IPV6CTL_SENDREDIRECTS 2 /* may send redirects when forwarding*/
464 #define IPV6CTL_DEFHLIM 3 /* default Hop-Limit */
465 #ifdef notyet
466 #define IPV6CTL_DEFMTU 4 /* default MTU */
467 #endif
468 #define IPV6CTL_FORWSRCRT 5 /* forward source-routed dgrams */
469 #define IPV6CTL_STATS 6 /* stats */
470 #define IPV6CTL_MRTSTATS 7 /* multicast forwarding stats */
471 #define IPV6CTL_MRTPROTO 8 /* multicast routing protocol */
472 #define IPV6CTL_MAXFRAGPACKETS 9 /* max packets reassembly queue */
473 #define IPV6CTL_SOURCECHECK 10 /* verify source route and intf */
474 #define IPV6CTL_SOURCECHECK_LOGINT 11 /* minimume logging interval */
475 #define IPV6CTL_ACCEPT_RTADV 12
476 /* 13; unused; was: IPV6CTL_KEEPFAITH */
477 #define IPV6CTL_LOG_INTERVAL 14
478 #define IPV6CTL_HDRNESTLIMIT 15
479 #define IPV6CTL_DAD_COUNT 16
480 #define IPV6CTL_AUTO_FLOWLABEL 17
481 #define IPV6CTL_DEFMCASTHLIM 18
482 #define IPV6CTL_GIF_HLIM 19 /* default HLIM for gif encap packet */
483 #define IPV6CTL_KAME_VERSION 20
484 #define IPV6CTL_USE_DEPRECATED 21 /* use deprecated addr (RFC2462 5.5.4) */
485 #define IPV6CTL_RR_PRUNE 22 /* walk timer for router renumbering */
486 #if 0 /* obsolete */
487 #define IPV6CTL_MAPPED_ADDR 23
488 #endif
489 #define IPV6CTL_V6ONLY 24
490 /* IPV6CTL_RTEXPIRE 25 deprecated */
491 /* IPV6CTL_RTMINEXPIRE 26 deprecated */
492 /* IPV6CTL_RTMAXCACHE 27 deprecated */
494 #define IPV6CTL_USETEMPADDR 32 /* use temporary addresses (RFC3041) */
495 #define IPV6CTL_TEMPPLTIME 33 /* preferred lifetime for tmpaddrs */
496 #define IPV6CTL_TEMPVLTIME 34 /* valid lifetime for tmpaddrs */
497 #define IPV6CTL_AUTO_LINKLOCAL 35 /* automatic link-local addr assign */
498 #define IPV6CTL_RIP6STATS 36 /* raw_ip6 stats */
499 #define IPV6CTL_PREFER_TEMPADDR 37 /* prefer temporary addr as src */
500 #define IPV6CTL_ADDRCTLPOLICY 38 /* get/set address selection policy */
501 #define IPV6CTL_USE_DEFAULTZONE 39 /* use default scope zone */
503 #define IPV6CTL_MAXFRAGS 41 /* max fragments */
504 #if 0
505 #define IPV6CTL_IFQ 42 /* ip6intrq node */
506 #define IPV6CTL_ISATAPRTR 43 /* isatap router */
507 #endif
508 #define IPV6CTL_MCAST_PMTU 44 /* enable pMTU discovery for multicast? */
510 /* New entries should be added here from current IPV6CTL_MAXID value. */
511 /* to define items, should talk with KAME guys first, for *BSD compatibility */
512 #define IPV6CTL_STEALTH 45
514 #define ICMPV6CTL_ND6_ONLINKNSRFC4861 47
515 #define IPV6CTL_NO_RADR 48 /* No defroute from RA */
516 #define IPV6CTL_NORBIT_RAIF 49 /* Disable R-bit in NA on RA
517 * receiving IF. */
518 #define IPV6CTL_RFC6204W3 50 /* Accept defroute even when forwarding
519 enabled */
520 #define IPV6CTL_INTRQMAXLEN 51 /* max length of IPv6 netisr queue */
521 #define IPV6CTL_INTRDQMAXLEN 52 /* max length of direct IPv6 netisr
522 * queue */
523 #define IPV6CTL_MAXFRAGSPERPACKET 53 /* Max fragments per packet */
524 #define IPV6CTL_MAXFRAGBUCKETSIZE 54 /* Max reassembly queues per bucket */
525 #define IPV6CTL_MAXID 55
526 #endif /* __BSD_VISIBLE */
529 * Since both netinet/ and netinet6/ call into netipsec/ and netpfil/,
530 * the protocol specific mbuf flags are shared between them.
532 #define M_FASTFWD_OURS M_PROTO1 /* changed dst to local */
533 #define M_IP6_NEXTHOP M_PROTO2 /* explicit ip nexthop */
534 #define M_IP_NEXTHOP M_PROTO2 /* explicit ip nexthop */
535 #define M_SKIP_FIREWALL M_PROTO3 /* skip firewall processing */
536 #define M_AUTHIPHDR M_PROTO4
537 #define M_DECRYPTED M_PROTO5
538 #define M_LOOP M_PROTO6
539 #define M_AUTHIPDGM M_PROTO7
540 #define M_RTALERT_MLD M_PROTO8
541 #define M_FRAGMENTED M_PROTO9 /* contained fragment header */
543 #ifndef _SIZE_T_DECLARED
544 typedef __size_t size_t;
545 #define _SIZE_T_DECLARED
546 #endif
548 #ifndef _SOCKLEN_T_DECLARED
549 typedef __socklen_t socklen_t;
550 #define _SOCKLEN_T_DECLARED
551 #endif
553 #if __BSD_VISIBLE
555 __BEGIN_DECLS
556 struct cmsghdr;
558 extern int inet6_option_space(int);
559 extern int inet6_option_init(void *, struct cmsghdr **, int);
560 extern int inet6_option_append(struct cmsghdr *, const uint8_t *,
561 int, int);
562 extern uint8_t *inet6_option_alloc(struct cmsghdr *, int, int, int);
563 extern int inet6_option_next(const struct cmsghdr *, uint8_t **);
564 extern int inet6_option_find(const struct cmsghdr *, uint8_t **, int);
566 extern size_t inet6_rthdr_space(int, int);
567 extern struct cmsghdr *inet6_rthdr_init(void *, int);
568 extern int inet6_rthdr_add(struct cmsghdr *, const struct in6_addr *,
569 unsigned int);
570 extern int inet6_rthdr_lasthop(struct cmsghdr *, unsigned int);
571 #if 0 /* not implemented yet */
572 extern int inet6_rthdr_reverse(const struct cmsghdr *, struct cmsghdr *);
573 #endif
574 extern int inet6_rthdr_segments(const struct cmsghdr *);
575 extern struct in6_addr *inet6_rthdr_getaddr(struct cmsghdr *, int);
576 extern int inet6_rthdr_getflags(const struct cmsghdr *, int);
578 extern int inet6_opt_init(void *, socklen_t);
579 extern int inet6_opt_append(void *, socklen_t, int, uint8_t, socklen_t,
580 uint8_t, void **);
581 extern int inet6_opt_finish(void *, socklen_t, int);
582 extern int inet6_opt_set_val(void *, int, void *, socklen_t);
584 extern int inet6_opt_next(void *, socklen_t, int, uint8_t *, socklen_t *,
585 void **);
586 extern int inet6_opt_find(void *, socklen_t, int, uint8_t, socklen_t *,
587 void **);
588 extern int inet6_opt_get_val(void *, int, void *, socklen_t);
589 extern socklen_t inet6_rth_space(int, int);
590 extern void *inet6_rth_init(void *, socklen_t, int, int);
591 extern int inet6_rth_add(void *, const struct in6_addr *);
592 extern int inet6_rth_reverse(const void *, void *);
593 extern int inet6_rth_segments(const void *);
594 extern struct in6_addr *inet6_rth_getaddr(const void *, int);
595 __END_DECLS
597 #endif /* __BSD_VISIBLE */
599 #ifdef _KERNEL
600 /* Header file provided outside of Newlib */
601 #include <machine/_kernel_in6.h>
602 #endif
603 #endif /* !_NETINET6_IN6_H_ */