1 //==========================================================================
3 // src/sys/netinet6/in6_proto.c
5 //==========================================================================
6 //####BSDCOPYRIGHTBEGIN####
8 // -------------------------------------------
10 // Portions of this software may have been derived from OpenBSD,
11 // FreeBSD or other sources, and are covered by the appropriate
12 // copyright disclaimers included herein.
14 // Portions created by Red Hat are
15 // Copyright (C) 2002 Red Hat, Inc. All Rights Reserved.
17 // -------------------------------------------
19 //####BSDCOPYRIGHTEND####
20 //==========================================================================
22 /* $KAME: in6_proto.c,v 1.111 2001/12/21 03:32:34 itojun Exp $ */
25 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
26 * All rights reserved.
28 * Redistribution and use in source and binary forms, with or without
29 * modification, are permitted provided that the following conditions
31 * 1. Redistributions of source code must retain the above copyright
32 * notice, this list of conditions and the following disclaimer.
33 * 2. Redistributions in binary form must reproduce the above copyright
34 * notice, this list of conditions and the following disclaimer in the
35 * documentation and/or other materials provided with the distribution.
36 * 3. Neither the name of the project nor the names of its contributors
37 * may be used to endorse or promote products derived from this software
38 * without specific prior written permission.
40 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
41 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
43 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
44 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
45 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
46 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
48 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
49 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
54 * Copyright (c) 1982, 1986, 1993
55 * The Regents of the University of California. All rights reserved.
57 * Redistribution and use in source and binary forms, with or without
58 * modification, are permitted provided that the following conditions
60 * 1. Redistributions of source code must retain the above copyright
61 * notice, this list of conditions and the following disclaimer.
62 * 2. Redistributions in binary form must reproduce the above copyright
63 * notice, this list of conditions and the following disclaimer in the
64 * documentation and/or other materials provided with the distribution.
65 * 3. All advertising materials mentioning features or use of this software
66 * must display the following acknowledgement:
67 * This product includes software developed by the University of
68 * California, Berkeley and its contributors.
69 * 4. Neither the name of the University nor the names of its contributors
70 * may be used to endorse or promote products derived from this software
71 * without specific prior written permission.
73 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
74 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
75 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
76 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
77 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
78 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
79 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
80 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
81 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
82 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
85 * @(#)in_proto.c 8.1 (Berkeley) 6/10/93
88 #include <sys/param.h>
89 #include <sys/socket.h>
90 #include <sys/socketvar.h>
91 #include <sys/protosw.h>
92 #include <sys/domain.h>
94 #include <sys/sysctl.h>
97 #include <net/radix.h>
99 #include <net/radix_art.h>
100 #elif defined(RADIX_MPATH)
101 #include <net/radix_mpath.h>
103 #include <net/route.h>
105 #include <netinet/in.h>
106 #include <netinet/in_systm.h>
107 #include <netinet/in_var.h>
108 #include <netinet/ip_encap.h>
109 #if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || (defined(__NetBSD__) && !defined(TCP6)) || defined(__OpenBSD__) || (defined(__bsdi__) && _BSDI_VERSION >= 199802)
110 #include <netinet/ip.h>
111 #include <netinet/ip_var.h>
113 #if (defined(__NetBSD__) && !defined(TCP6)) || defined(__OpenBSD__) || (defined(__bsdi__) && _BSDI_VERSION >= 199802)
114 #include <netinet/in_pcb.h>
116 #include <netinet/ip6.h>
117 #include <netinet6/ip6_var.h>
118 #include <netinet/icmp6.h>
119 #if !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(__OpenBSD__) && !(defined(__bsdi__) && _BSDI_VERSION >= 199802)
120 #include <netinet6/in6_pcb.h>
123 #if (defined(__FreeBSD__) && __FreeBSD__ >= 3) || defined(__OpenBSD__) || (defined(__bsdi__) && _BSDI_VERSION >= 199802)
124 #include <netinet/tcp.h>
125 #include <netinet/tcp_timer.h>
126 #include <netinet/tcp_var.h>
127 #include <netinet/udp.h>
128 #include <netinet/udp_var.h>
129 #if (defined(__FreeBSD__) && __FreeBSD__ >= 4)
130 #include <netinet6/tcp6_var.h>
133 #if defined(__NetBSD__) && !defined(TCP6)
134 #include <netinet/tcp.h>
135 #include <netinet/tcp_fsm.h>
136 #include <netinet/tcp_seq.h>
137 #include <netinet/tcp_timer.h>
138 #include <netinet/tcp_var.h>
139 #include <netinet/tcpip.h>
140 #include <netinet/tcp_debug.h>
142 #include <netinet6/tcp6.h>
143 #include <netinet6/tcp6_fsm.h>
144 #include <netinet6/tcp6_seq.h>
145 #include <netinet6/tcp6_timer.h>
146 #include <netinet6/tcp6_var.h>
151 #include <netinet6/raw_ip6.h>
154 #if !defined(__OpenBSD__) && !(defined(__bsdi__) && _BSDI_VERSION >= 199802)
155 #if !(defined(__FreeBSD__) && __FreeBSD__ >= 4)
156 #include <netinet6/udp6.h>
158 #include <netinet6/udp6_var.h>
161 #include <netinet6/pim6_var.h>
163 #include <netinet6/nd6.h>
167 #include <netinet/ip_ipsp.h>
168 #include <netinet/ip_ah.h>
169 #include <netinet/ip_esp.h>
170 #include <netinet/ip_ipip.h>
172 #include <netinet6/ipsec.h>
173 #include <netinet6/ah.h>
175 #include <netinet6/esp.h>
177 #include <netinet6/ipcomp.h>
181 #include <netinet6/ip6protosw.h>
184 #include <netinet6/mip6.h>
188 #define offsetof(type, member) ((size_t)(&((type *)0)->member))
192 * TCP/IP protocol family: IP6, ICMP6, UDP, TCP.
195 extern struct domain inet6domain;
196 #if defined(__FreeBSD__) && __FreeBSD__ >= 3
197 static struct pr_usrreqs nousrreqs;
203 #if !defined(__NetBSD__) && !defined(__OpenBSD__)
204 #define PR_ABRTACPTDIS 0
210 struct ip6protosw inet6sw[] = {
211 { 0, &inet6domain, IPPROTO_IPV6, 0,
214 ip6_init, 0, frag6_slowtimo, frag6_drain,
218 # if __FreeBSD__ >= 3
223 { SOCK_DGRAM, &inet6domain, IPPROTO_UDP, PR_ATOMIC|PR_ADDR,
224 udp6_input, 0, udp6_ctlinput, ip6_ctloutput,
225 #if defined(__FreeBSD__) && __FreeBSD__ >= 3
227 #elif defined(HAVE_NRL_INPCB)
230 udp6_usrreq, udp6_init,
234 #ifdef HAVE_NRL_INPCB
240 # if __FreeBSD__ >= 3
246 { SOCK_STREAM, &inet6domain, IPPROTO_TCP, PR_CONNREQUIRED|PR_WANTRCVD|PR_LISTEN|PR_ABRTACPTDIS,
247 tcp6_input, 0, tcp6_ctlinput, tcp6_ctloutput,
249 tcp6_init, tcp6_fasttimo, tcp6_slowtimo, tcp6_drain,
253 # if __FreeBSD__ >= 3
259 { SOCK_STREAM, &inet6domain, IPPROTO_TCP, PR_CONNREQUIRED|PR_WANTRCVD|PR_LISTEN,
260 tcp6_input, 0, tcp6_ctlinput, tcp_ctloutput,
261 #if defined(__FreeBSD__) && __FreeBSD__ >= 3
263 #elif defined(HAVE_NRL_INPCB)
268 #ifdef INET /* don't call initialization and timeout routines twice */
271 tcp_init, tcp_fasttimo, tcp_slowtimo, tcp_drain,
276 # if __FreeBSD__ >= 3
282 { SOCK_RAW, &inet6domain, IPPROTO_RAW, PR_ATOMIC|PR_ADDR,
283 rip6_input, rip6_output, rip6_ctlinput, rip6_ctloutput,
284 #if defined(__FreeBSD__) && __FreeBSD__ >= 3
290 #if defined(__FreeBSD__) && __FreeBSD__ >= 3
294 { SOCK_RAW, &inet6domain, IPPROTO_ICMPV6, PR_ATOMIC|PR_ADDR|PR_LASTHDR,
295 icmp6_input, rip6_output, rip6_ctlinput, rip6_ctloutput,
296 #if defined(__FreeBSD__) && __FreeBSD__ >= 3
301 icmp6_init, icmp6_fasttimo, 0, 0,
305 # if __FreeBSD__ >= 3
310 { SOCK_RAW, &inet6domain, IPPROTO_DSTOPTS,PR_ATOMIC|PR_ADDR,
311 dest6_input, 0, 0, 0,
314 #if defined(__FreeBSD__) && __FreeBSD__ >= 3
318 { SOCK_RAW, &inet6domain, IPPROTO_ROUTING,PR_ATOMIC|PR_ADDR,
319 route6_input, 0, 0, 0,
322 #if defined(__FreeBSD__) && __FreeBSD__ >= 3
326 { SOCK_RAW, &inet6domain, IPPROTO_FRAGMENT,PR_ATOMIC|PR_ADDR,
327 frag6_input, 0, 0, 0,
330 #if defined(__FreeBSD__) && __FreeBSD__ >= 3
335 { SOCK_RAW, &inet6domain, IPPROTO_AH, PR_ATOMIC|PR_ADDR,
347 #elif !defined(__FreeBSD__)
350 # if __FreeBSD__ >= 3
356 { SOCK_RAW, &inet6domain, IPPROTO_ESP, PR_ATOMIC|PR_ADDR,
364 #elif !defined(__FreeBSD__)
367 # if __FreeBSD__ >= 3
374 { SOCK_RAW, &inet6domain, IPPROTO_IPCOMP, PR_ATOMIC|PR_ADDR,
375 ipcomp6_input, 0, 0, 0,
381 # if __FreeBSD__ >= 3
386 #endif /* !OpenBSD */
389 { SOCK_RAW, &inet6domain, IPPROTO_IPV4, PR_ATOMIC|PR_ADDR|PR_LASTHDR,
390 encap6_input, rip6_output, encap6_ctlinput, rip6_ctloutput,
391 #if defined(__FreeBSD__) && __FreeBSD__ >= 3
397 #if defined(__FreeBSD__) && __FreeBSD__ >= 3
402 { SOCK_RAW, &inet6domain, IPPROTO_IPV6, PR_ATOMIC|PR_ADDR|PR_LASTHDR,
403 encap6_input, rip6_output, encap6_ctlinput, rip6_ctloutput,
404 #if defined(__FreeBSD__) && __FreeBSD__ >= 3
410 #if defined(__FreeBSD__) && __FreeBSD__ >= 3
414 #if defined(__NetBSD__) && defined(ISO)
415 { SOCK_RAW, &inet6domain, IPPROTO_EON, PR_ATOMIC|PR_ADDR|PR_LASTHDR,
416 encap6_input, rip6_output, encap6_ctlinput, rip6_ctloutput,
417 rip6_usrreq, /* XXX */
421 { SOCK_RAW, &inet6domain, IPPROTO_PIM, PR_ATOMIC|PR_ADDR|PR_LASTHDR,
422 pim6_input, rip6_output, 0, rip6_ctloutput,
423 #if defined(__FreeBSD__) && __FreeBSD__ >= 3
429 #if defined(__FreeBSD__) && __FreeBSD__ >= 3
434 { SOCK_RAW, &inet6domain, 0, PR_ATOMIC|PR_ADDR,
435 rip6_input, rip6_output, 0, rip6_ctloutput,
436 #if defined(__FreeBSD__) && __FreeBSD__ >= 3
439 rip6_usrreq, rip6_init,
442 #if defined(__FreeBSD__) && __FreeBSD__ >= 3
449 struct ip6protosw mip6_tunnel_protosw =
450 { SOCK_RAW, &inet6domain, IPPROTO_IPV6, PR_ATOMIC|PR_ADDR,
451 mip6_tunnel_input, rip6_output, 0, rip6_ctloutput,
452 #if defined(__FreeBSD__) && __FreeBSD__ >= 3
458 #if defined(__FreeBSD__) && __FreeBSD__ >= 3
465 extern int in6_inithead __P((void **, int));
468 struct domain inet6domain =
469 { AF_INET6, "internet6", 0, 0, 0,
470 (struct protosw *)inet6sw,
471 (struct protosw *)&inet6sw[sizeof(inet6sw)/sizeof(inet6sw[0])], 0,
477 #elif defined(RADIX_MPATH)
483 offsetof(struct sockaddr_in6, sin6_addr) << 3,
484 sizeof(struct sockaddr_in6) };
491 * Internet configuration info
493 #ifndef IPV6FORWARDING
495 #define IPV6FORWARDING 1 /* forward IP6 packets not for us */
497 #define IPV6FORWARDING 0 /* don't forward IP6 packets not for us */
498 #endif /* GATEWAY6 */
499 #endif /* !IPV6FORWARDING */
501 #ifndef IPV6_SENDREDIRECTS
502 #define IPV6_SENDREDIRECTS 1
505 int ip6_forwarding = IPV6FORWARDING; /* act as router? */
506 int ip6_sendredirects = IPV6_SENDREDIRECTS;
507 int ip6_defhlim = IPV6_DEFHLIM;
508 int ip6_defmcasthlim = IPV6_DEFAULT_MULTICAST_HOPS;
509 int ip6_accept_rtadv = 1; // was 0; /* "IPV6FORWARDING ? 0 : 1" is dangerous */
510 #if defined(__FreeBSD__) && __FreeBSD__ >= 4
511 int ip6_maxfragpackets; /* initialized in frag6.c:frag6_init() */
513 int ip6_maxfragpackets = 200;
515 int ip6_log_interval = 5;
516 int ip6_hdrnestlimit = 50; /* appropriate? */
517 int ip6_dad_count = 1; /* DupAddrDetectionTransmits */
518 u_int32_t ip6_flow_seq;
519 int ip6_auto_flowlabel = 1;
520 int ip6_use_deprecated = 1; /* allow deprecated addr (RFC2462 5.5.4) */
521 int ip6_rr_prune = 5; /* router renumbering prefix
522 * walk list every 5 sec. */
523 #if defined(__NetBSD__)
525 #elif defined(__OpenBSD__) || (defined(__FreeBSD__) && __FreeBSD__ == 2) || (defined(__bsdi__) && _BSDI_VERSION < 199802) || defined(TCP6)
526 const int ip6_v6only = 1;
531 u_int32_t ip6_id = 0UL;
532 int ip6_keepfaith = 0;
533 time_t ip6_log_time = (time_t)0L;
538 * BSDI4 defines these variables in in_proto.c...
539 * XXX: what if we don't define INET? Should we define pmtu6_expire
540 * or so? (jinmei@kame.net 19990310)
542 int pmtu_expire = 60*10;
543 int pmtu_probe = 60*2;
546 /* raw IP6 parameters */
548 * Nominal space allocated to a raw ip socket.
550 #define RIPV6SNDQ 8192
551 #define RIPV6RCVQ 8192
553 u_long rip6_sendspace = RIPV6SNDQ;
554 u_long rip6_recvspace = RIPV6RCVQ;
556 /* ICMPV6 parameters */
557 int icmp6_rediraccept = 1; /* accept and process redirects */
558 int icmp6_redirtimeout = 10 * 60; /* 10 minutes */
559 int icmp6errppslim = 100; /* 100pps */
560 int icmp6_nodeinfo = 3; /* enable/disable NI response */
563 /* TCP on IP6 parameters */
564 int tcp6_sendspace = 1024 * 8;
565 int tcp6_recvspace = 1024 * 8;
566 int tcp6_mssdflt = TCP6_MSS;
567 int tcp6_rttdflt = TCP6TV_SRTTDFLT / PR_SLOWHZ;
568 int tcp6_do_rfc1323 = 1;
569 int tcp6_conntimeo = TCP6TV_KEEP_INIT; /* initial connection timeout */
570 int tcp6_43maxseg = 0;
574 * Parameters for keepalive option.
575 * Connections for which SO_KEEPALIVE is set will be probed
576 * after being idle for a time of tcp6_keepidle (in units of PR_SLOWHZ).
577 * Starting at that time, the connection is probed at intervals
578 * of tcp6_keepintvl (same units) until a response is received
579 * or until tcp6_keepcnt probes have been made, at which time
580 * the connection is dropped. Note that a tcp6_keepidle value
581 * under 2 hours is nonconformant with RFC-1122, Internet Host Requirements.
583 int tcp6_keepidle = TCP6TV_KEEP_IDLE; /* time before probing idle */
584 int tcp6_keepintvl = TCP6TV_KEEPINTVL; /* interval betwn idle probes */
585 int tcp6_keepcnt = TCP6TV_KEEPCNT; /* max idle probes */
586 int tcp6_maxpersistidle = TCP6TV_KEEP_IDLE; /* max idle time in persist */
589 #define TCP6_LISTEN_HASH_SIZE 17
590 #define TCP6_CONN_HASH_SIZE 97
591 #define TCP6_SYN_HASH_SIZE 293
592 #define TCP6_SYN_BUCKET_SIZE 35
594 #define TCP6_LISTEN_HASH_SIZE 97
595 #define TCP6_CONN_HASH_SIZE 9973
596 #define TCP6_SYN_HASH_SIZE 997
597 #define TCP6_SYN_BUCKET_SIZE 35
599 int tcp6_listen_hash_size = TCP6_LISTEN_HASH_SIZE;
600 int tcp6_conn_hash_size = TCP6_CONN_HASH_SIZE;
601 struct tcp6_hash_list tcp6_listen_hash[TCP6_LISTEN_HASH_SIZE],
602 tcp6_conn_hash[TCP6_CONN_HASH_SIZE];
604 int tcp6_syn_cache_size = TCP6_SYN_HASH_SIZE;
605 int tcp6_syn_cache_limit = TCP6_SYN_HASH_SIZE*TCP6_SYN_BUCKET_SIZE;
606 int tcp6_syn_bucket_limit = 3*TCP6_SYN_BUCKET_SIZE;
607 struct syn_cache_head6 tcp6_syn_cache[TCP6_SYN_HASH_SIZE];
608 struct syn_cache_head6 *tcp6_syn_cache_first;
609 int tcp6_syn_cache_interval = 8; /* runs timer every 4 seconds */
610 int tcp6_syn_cache_timeo = TCP6TV_KEEP_INIT;
613 * Parameters for computing a desirable data segment size
614 * given an upper bound (either interface MTU, or peer's MSS option)_.
615 * As applications tend to use a buffer size that is a multiple
616 * of kilobytes, try for something that divides evenly. However,
617 * do not round down too much.
619 * Round segment size down to a multiple of TCP6_ROUNDSIZE if this
620 * does not result in lowering by more than (size/TCP6_ROUNDFRAC).
621 * For example, round 536 to 512. Older versions of the system
622 * effectively used MCLBYTES (1K or 2K) as TCP6_ROUNDSIZE, with
623 * a value of 1 for TCP6_ROUNDFRAC (eliminating its effect).
624 * We round to a multiple of 256 for SLIP.
626 #ifndef TCP6_ROUNDSIZE
627 #define TCP6_ROUNDSIZE 256 /* round to multiple of 256 */
629 #ifndef TCP6_ROUNDFRAC
630 #define TCP6_ROUNDFRAC 10 /* round down at most N/10, or 10% */
633 int tcp6_roundsize = TCP6_ROUNDSIZE;
634 int tcp6_roundfrac = TCP6_ROUNDFRAC;
637 /* UDP on IP6 parameters */
638 int udp6_sendspace = 9216; /* really max datagram size */
639 int udp6_recvspace = 40 * (1024 + sizeof(struct sockaddr_in6));
640 /* 40 1K datagrams */
642 * sysctl related items.
644 SYSCTL_NODE(_net, PF_INET6, inet6, CTLFLAG_RW, 0,
648 SYSCTL_NODE(_net_inet6, IPPROTO_IPV6, ip6, CTLFLAG_RW, 0, "IP6");
649 SYSCTL_NODE(_net_inet6, IPPROTO_ICMPV6, icmp6, CTLFLAG_RW, 0, "ICMP6");
650 SYSCTL_NODE(_net_inet6, IPPROTO_UDP, udp6, CTLFLAG_RW, 0, "UDP6");
651 SYSCTL_NODE(_net_inet6, IPPROTO_TCP, tcp6, CTLFLAG_RW, 0, "TCP6");
653 SYSCTL_NODE(_net_inet6, IPPROTO_ESP, ipsec6, CTLFLAG_RW, 0, "IPSEC6");
656 #ifdef CYGPKG_NET_FREEBSD_SYSCTL
659 sysctl_ip6_temppltime(SYSCTL_HANDLER_ARGS)
664 error = SYSCTL_OUT(req, arg1, sizeof(int));
665 if (error || !req->newptr)
667 old = ip6_temp_preferred_lifetime;
668 error = SYSCTL_IN(req, arg1, sizeof(int));
669 if (ip6_temp_preferred_lifetime <
670 ip6_desync_factor + ip6_temp_regen_advance) {
671 ip6_temp_preferred_lifetime = old;
678 sysctl_ip6_tempvltime(SYSCTL_HANDLER_ARGS)
683 error = SYSCTL_OUT(req, arg1, sizeof(int));
684 if (error || !req->newptr)
686 old = ip6_temp_valid_lifetime;
687 error = SYSCTL_IN(req, arg1, sizeof(int));
688 if (ip6_temp_valid_lifetime < ip6_temp_preferred_lifetime) {
689 ip6_temp_preferred_lifetime = old;
695 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_FORWARDING,
696 forwarding, CTLFLAG_RW, &ip6_forwarding, 0, "");
697 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_SENDREDIRECTS,
698 redirect, CTLFLAG_RW, &ip6_sendredirects, 0, "");
699 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_DEFHLIM,
700 hlim, CTLFLAG_RW, &ip6_defhlim, 0, "");
701 SYSCTL_STRUCT(_net_inet6_ip6, IPV6CTL_STATS, stats, CTLFLAG_RD,
702 &ip6stat, ip6stat, "");
703 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MAXFRAGPACKETS,
704 maxfragpackets, CTLFLAG_RW, &ip6_maxfragpackets, 0, "");
705 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_ACCEPT_RTADV,
706 accept_rtadv, CTLFLAG_RW, &ip6_accept_rtadv, 0, "");
707 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_KEEPFAITH,
708 keepfaith, CTLFLAG_RW, &ip6_keepfaith, 0, "");
709 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_LOG_INTERVAL,
710 log_interval, CTLFLAG_RW, &ip6_log_interval, 0, "");
711 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_HDRNESTLIMIT,
712 hdrnestlimit, CTLFLAG_RW, &ip6_hdrnestlimit, 0, "");
713 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_DAD_COUNT,
714 dad_count, CTLFLAG_RW, &ip6_dad_count, 0, "");
715 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_AUTO_FLOWLABEL,
716 auto_flowlabel, CTLFLAG_RW, &ip6_auto_flowlabel, 0, "");
717 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_DEFMCASTHLIM,
718 defmcasthlim, CTLFLAG_RW, &ip6_defmcasthlim, 0, "");
719 #ifndef __ECOS /* We don't support gif at the moment */
720 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_GIF_HLIM,
721 gifhlim, CTLFLAG_RW, &ip6_gif_hlim, 0, "");
723 SYSCTL_STRING(_net_inet6_ip6, IPV6CTL_KAME_VERSION,
724 kame_version, CTLFLAG_RD, __KAME_VERSION, 0, "");
725 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_USE_DEPRECATED,
726 use_deprecated, CTLFLAG_RW, &ip6_use_deprecated, 0, "");
727 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_RR_PRUNE,
728 rr_prune, CTLFLAG_RW, &ip6_rr_prune, 0, "");
729 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_USETEMPADDR,
730 use_tempaddr, CTLFLAG_RW, &ip6_use_tempaddr, 0, "");
731 SYSCTL_OID(_net_inet6_ip6, IPV6CTL_TEMPPLTIME, temppltime,
732 CTLTYPE_INT|CTLFLAG_RW, &ip6_temp_preferred_lifetime, 0,
733 sysctl_ip6_temppltime, "I", "");
734 SYSCTL_OID(_net_inet6_ip6, IPV6CTL_TEMPVLTIME, tempvltime,
735 CTLTYPE_INT|CTLFLAG_RW, &ip6_temp_valid_lifetime, 0,
736 sysctl_ip6_tempvltime, "I", "");
737 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_V6ONLY,
738 v6only, CTLFLAG_RW, &ip6_v6only, 0, "");
739 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_AUTO_LINKLOCAL,
740 auto_linklocal, CTLFLAG_RW, &ip6_auto_linklocal, 0, "");
741 SYSCTL_STRUCT(_net_inet6_ip6, IPV6CTL_RIP6STATS, rip6stats, CTLFLAG_RD,
742 &rip6stat, rip6stat, "");
744 /* net.inet6.icmp6 */
745 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_REDIRACCEPT,
746 rediraccept, CTLFLAG_RW, &icmp6_rediraccept, 0, "");
747 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_REDIRTIMEOUT,
748 redirtimeout, CTLFLAG_RW, &icmp6_redirtimeout, 0, "");
749 SYSCTL_STRUCT(_net_inet6_icmp6, ICMPV6CTL_STATS, stats, CTLFLAG_RD,
750 &icmp6stat, icmp6stat, "");
751 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_PRUNE,
752 nd6_prune, CTLFLAG_RW, &nd6_prune, 0, "");
753 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_DELAY,
754 nd6_delay, CTLFLAG_RW, &nd6_delay, 0, "");
755 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_UMAXTRIES,
756 nd6_umaxtries, CTLFLAG_RW, &nd6_umaxtries, 0, "");
757 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_MMAXTRIES,
758 nd6_mmaxtries, CTLFLAG_RW, &nd6_mmaxtries, 0, "");
759 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_USELOOPBACK,
760 nd6_useloopback, CTLFLAG_RW, &nd6_useloopback, 0, "");
761 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_NODEINFO,
762 nodeinfo, CTLFLAG_RW, &icmp6_nodeinfo, 0, "");
763 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ERRPPSLIMIT,
764 errppslimit, CTLFLAG_RW, &icmp6errppslim, 0, "");
765 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_MAXNUDHINT,
766 nd6_maxnudhint, CTLFLAG_RW, &nd6_maxnudhint, 0, "");
767 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_DEBUG,
768 nd6_debug, CTLFLAG_RW, &nd6_debug, 0, "");