]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/netinet6/in6_proto.c
Remove the XE_DEBUG define. It shouldn't be defined now that things
[FreeBSD/FreeBSD.git] / sys / netinet6 / in6_proto.c
1 /*      $FreeBSD$       */
2 /*      $KAME: in6_proto.c,v 1.64 2000/06/20 16:20:27 itojun Exp $      */
3
4 /*
5  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  * 1. Redistributions of source code must retain the above copyright
12  *    notice, this list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce the above copyright
14  *    notice, this list of conditions and the following disclaimer in the
15  *    documentation and/or other materials provided with the distribution.
16  * 3. Neither the name of the project nor the names of its contributors
17  *    may be used to endorse or promote products derived from this software
18  *    without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
21  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23  * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
24  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30  * SUCH DAMAGE.
31  */
32
33 /*
34  * Copyright (c) 1982, 1986, 1993
35  *      The Regents of the University of California.  All rights reserved.
36  *
37  * Redistribution and use in source and binary forms, with or without
38  * modification, are permitted provided that the following conditions
39  * are met:
40  * 1. Redistributions of source code must retain the above copyright
41  *    notice, this list of conditions and the following disclaimer.
42  * 2. Redistributions in binary form must reproduce the above copyright
43  *    notice, this list of conditions and the following disclaimer in the
44  *    documentation and/or other materials provided with the distribution.
45  * 3. All advertising materials mentioning features or use of this software
46  *    must display the following acknowledgement:
47  *      This product includes software developed by the University of
48  *      California, Berkeley and its contributors.
49  * 4. Neither the name of the University nor the names of its contributors
50  *    may be used to endorse or promote products derived from this software
51  *    without specific prior written permission.
52  *
53  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
54  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
55  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
56  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
57  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
58  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
59  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
60  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
61  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
62  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
63  * SUCH DAMAGE.
64  *
65  *      @(#)in_proto.c  8.1 (Berkeley) 6/10/93
66  */
67
68 #include "opt_inet.h"
69 #include "opt_inet6.h"
70 #include "opt_ipsec.h"
71
72 #include <sys/param.h>
73 #include <sys/socket.h>
74 #include <sys/socketvar.h>
75 #include <sys/protosw.h>
76 #include <sys/kernel.h>
77 #include <sys/domain.h>
78 #include <sys/mbuf.h>
79 #include <sys/systm.h>
80 #include <sys/sysctl.h>
81
82 #include <net/if.h>
83 #include <net/radix.h>
84 #include <net/route.h>
85
86 #include <netinet/in.h>
87 #include <netinet/in_systm.h>
88 #include <netinet/in_var.h>
89 #include <netinet/ip_encap.h>
90 #include <netinet/ip.h>
91 #include <netinet/ip_var.h>
92 #include <netinet/ip6.h>
93 #include <netinet6/ip6_var.h>
94 #include <netinet/icmp6.h>
95
96 #include <netinet/tcp.h>
97 #include <netinet/tcp_timer.h>
98 #include <netinet/tcp_var.h>
99 #include <netinet/udp.h>
100 #include <netinet/udp_var.h>
101 #include <netinet6/tcp6_var.h>
102
103 #include <netinet6/udp6_var.h>
104
105 #include <netinet6/pim6_var.h>
106
107 #include <netinet6/nd6.h>
108 #include <netinet6/in6_prefix.h>
109
110 #ifdef IPSEC
111 #include <netinet6/ipsec.h>
112 #include <netinet6/ipsec6.h>
113 #include <netinet6/ah.h>
114 #include <netinet6/ah6.h>
115 #ifdef IPSEC_ESP
116 #include <netinet6/esp.h>
117 #include <netinet6/esp6.h>
118 #endif
119 #include <netinet6/ipcomp.h>
120 #include <netinet6/ipcomp6.h>
121 #endif /*IPSEC*/
122
123 #include <netinet6/ip6protosw.h>
124
125 #include "gif.h"
126 #if NGIF > 0
127 #include <netinet6/in6_gif.h>
128 #endif
129
130 #include <net/net_osdep.h>
131
132 #define offsetof(type, member)  ((size_t)(&((type *)0)->member))
133
134 /*
135  * TCP/IP protocol family: IP6, ICMP6, UDP, TCP.
136  */
137
138 extern  struct domain inet6domain;
139 static struct pr_usrreqs nousrreqs;
140
141 struct ip6protosw inet6sw[] = {
142 { 0,            &inet6domain,   IPPROTO_IPV6,   0,
143   0,            0,              0,              0,
144   0,
145   ip6_init,     0,              frag6_slowtimo, frag6_drain,
146   &nousrreqs,
147 },
148 { SOCK_DGRAM,   &inet6domain,   IPPROTO_UDP,    PR_ATOMIC | PR_ADDR,
149   udp6_input,   0,              udp6_ctlinput,  ip6_ctloutput,
150   0,
151   0,            0,              0,              0,
152   &udp6_usrreqs,
153 },
154 { SOCK_STREAM,  &inet6domain,   IPPROTO_TCP,    PR_CONNREQUIRED | PR_WANTRCVD,
155   tcp6_input,   0,              tcp6_ctlinput,  tcp_ctloutput,
156   0,
157 #ifdef INET     /* don't call timeout routines twice */
158   tcp_init,     0,              0,              tcp_drain,
159 #else
160   tcp_init,     tcp_fasttimo,   tcp_slowtimo,   tcp_drain,
161 #endif
162   &tcp6_usrreqs,
163 },
164 { SOCK_RAW,     &inet6domain,   IPPROTO_RAW,    PR_ATOMIC | PR_ADDR,
165   rip6_input,   rip6_output,    rip6_ctlinput,  rip6_ctloutput,
166   0,
167   0,            0,              0,              0,
168   &rip6_usrreqs
169 },
170 { SOCK_RAW,     &inet6domain,   IPPROTO_ICMPV6, PR_ATOMIC | PR_ADDR,
171   icmp6_input,  rip6_output,    0,              rip6_ctloutput,
172   0,
173   icmp6_init,   icmp6_fasttimo, 0,              0,
174   &rip6_usrreqs
175 },
176 { SOCK_RAW,     &inet6domain,   IPPROTO_DSTOPTS,PR_ATOMIC|PR_ADDR,
177   dest6_input,  0,              0,              0,
178   0,    
179   0,            0,              0,              0,
180   &nousrreqs
181 },
182 { SOCK_RAW,     &inet6domain,   IPPROTO_ROUTING,PR_ATOMIC|PR_ADDR,
183   route6_input, 0,              0,              0,
184   0,    
185   0,            0,              0,              0,
186   &nousrreqs
187 },
188 { SOCK_RAW,     &inet6domain,   IPPROTO_FRAGMENT,PR_ATOMIC|PR_ADDR,
189   frag6_input,  0,              0,              0,
190   0,    
191   0,            0,              0,              0,
192   &nousrreqs
193 },
194 #ifdef IPSEC
195 { SOCK_RAW,     &inet6domain,   IPPROTO_AH,     PR_ATOMIC|PR_ADDR,
196   ah6_input,    0,              0,              0,
197   0,    
198   0,            0,              0,              0,
199   &nousrreqs,
200 },
201 #ifdef IPSEC_ESP
202 { SOCK_RAW,     &inet6domain,   IPPROTO_ESP,    PR_ATOMIC|PR_ADDR,
203   esp6_input,   0,              0,              0,
204   0,    
205   0,            0,              0,              0,
206   &nousrreqs,
207 },
208 #endif
209 { SOCK_RAW,     &inet6domain,   IPPROTO_IPCOMP, PR_ATOMIC|PR_ADDR,
210   ipcomp6_input, 0,             0,              0,
211   0,    
212   0,            0,              0,              0,
213   &nousrreqs,
214 },
215 #endif /* IPSEC */
216 #ifdef INET
217 { SOCK_RAW,     &inet6domain,   IPPROTO_IPV4,   PR_ATOMIC|PR_ADDR,
218   encap6_input, rip6_output,    0,              rip6_ctloutput,
219   0,
220   0,            0,              0,              0,
221   &rip6_usrreqs
222 },
223 #endif /*INET*/
224 { SOCK_RAW,     &inet6domain,   IPPROTO_IPV6,   PR_ATOMIC|PR_ADDR,
225   encap6_input, rip6_output,     0,     rip6_ctloutput,
226   0,
227 #ifndef INET
228   encap_init,   0,              0,              0,
229 #else
230   0,            0,              0,              0,
231 #endif
232   &rip6_usrreqs
233 },
234 { SOCK_RAW,     &inet6domain,   IPPROTO_PIM,    PR_ATOMIC|PR_ADDR,
235   pim6_input,    rip6_output,   0,              rip6_ctloutput,
236   0,
237   0,            0,              0,              0,
238   &rip6_usrreqs
239 },
240 /* raw wildcard */
241 { SOCK_RAW,     &inet6domain,   0,              PR_ATOMIC | PR_ADDR,
242   rip6_input,   rip6_output,    0,              rip6_ctloutput,
243   0, 0,
244   0,            0,              0,
245   &rip6_usrreqs
246 },
247 };
248
249 #if NGIF > 0
250 struct ip6protosw in6_gif_protosw =
251 { SOCK_RAW,     &inet6domain,   0/*IPPROTO_IPV[46]*/,   PR_ATOMIC|PR_ADDR,
252   in6_gif_input, rip6_output,   0,              rip6_ctloutput,
253   0,
254   0,            0,              0,              0,
255   &rip6_usrreqs
256 };
257 #endif /*NGIF*/
258
259 extern int in6_inithead __P((void **, int));
260
261 struct domain inet6domain =
262     { AF_INET6, "internet6", 0, 0, 0,
263       (struct protosw *)inet6sw,
264       (struct protosw *)&inet6sw[sizeof(inet6sw)/sizeof(inet6sw[0])], 0,
265       in6_inithead,
266       offsetof(struct sockaddr_in6, sin6_addr) << 3,
267       sizeof(struct sockaddr_in6) };
268
269 DOMAIN_SET(inet6);
270
271 /*
272  * Internet configuration info
273  */
274 #ifndef IPV6FORWARDING
275 #ifdef GATEWAY6
276 #define IPV6FORWARDING  1       /* forward IP6 packets not for us */
277 #else
278 #define IPV6FORWARDING  0       /* don't forward IP6 packets not for us */
279 #endif /* GATEWAY6 */
280 #endif /* !IPV6FORWARDING */
281
282 #ifndef IPV6_SENDREDIRECTS
283 #define IPV6_SENDREDIRECTS      1
284 #endif
285
286 int     ip6_forwarding = IPV6FORWARDING;        /* act as router? */
287 int     ip6_sendredirects = IPV6_SENDREDIRECTS;
288 int     ip6_defhlim = IPV6_DEFHLIM;
289 int     ip6_defmcasthlim = IPV6_DEFAULT_MULTICAST_HOPS;
290 int     ip6_accept_rtadv = 0;   /* "IPV6FORWARDING ? 0 : 1" is dangerous */
291 int     ip6_maxfragpackets = 200;
292 int     ip6_log_interval = 5;
293 int     ip6_hdrnestlimit = 50;  /* appropriate? */
294 int     ip6_dad_count = 1;      /* DupAddrDetectionTransmits */
295 u_int32_t ip6_flow_seq;
296 int     ip6_auto_flowlabel = 1;
297 #if NGIF > 0
298 int     ip6_gif_hlim = GIF_HLIM;
299 #else
300 int     ip6_gif_hlim = 0;
301 #endif
302 int     ip6_use_deprecated = 1; /* allow deprecated addr (RFC2462 5.5.4) */
303 int     ip6_rr_prune = 5;       /* router renumbering prefix
304                                  * walk list every 5 sec.    */
305 int     ip6_mapped_addr_on = 1;
306
307 u_int32_t ip6_id = 0UL;
308 int     ip6_keepfaith = 0;
309 time_t  ip6_log_time = (time_t)0L;
310
311 /* icmp6 */
312 /*
313  * BSDI4 defines these variables in in_proto.c...
314  * XXX: what if we don't define INET? Should we define pmtu6_expire
315  * or so? (jinmei@kame.net 19990310)
316  */
317 int pmtu_expire = 60*10;
318 int pmtu_probe = 60*2;
319
320 /* raw IP6 parameters */
321 /*
322  * Nominal space allocated to a raw ip socket.
323  */
324 #define RIPV6SNDQ       8192
325 #define RIPV6RCVQ       8192
326
327 u_long  rip6_sendspace = RIPV6SNDQ;
328 u_long  rip6_recvspace = RIPV6RCVQ;
329
330 /* ICMPV6 parameters */
331 int     icmp6_rediraccept = 1;          /* accept and process redirects */
332 int     icmp6_redirtimeout = 10 * 60;   /* 10 minutes */
333 struct timeval icmp6errratelim = { 0, 0 };      /* no ratelimit */
334 int     icmp6errppslim = 100;           /* 100pps */
335 int     icmp6_nodeinfo = 1;             /* enable/disable NI response */
336
337 #ifdef TCP6
338 /* TCP on IP6 parameters */
339 int     tcp6_sendspace = 1024 * 8;
340 int     tcp6_recvspace = 1024 * 8;
341 int     tcp6_mssdflt = TCP6_MSS;
342 int     tcp6_rttdflt = TCP6TV_SRTTDFLT / PR_SLOWHZ;
343 int     tcp6_do_rfc1323 = 1;
344 int     tcp6_conntimeo = TCP6TV_KEEP_INIT;      /* initial connection timeout */
345 int     tcp6_43maxseg = 0;
346 int     tcp6_pmtu = 0;
347
348 /*
349  * Parameters for keepalive option.
350  * Connections for which SO_KEEPALIVE is set will be probed
351  * after being idle for a time of tcp6_keepidle (in units of PR_SLOWHZ).
352  * Starting at that time, the connection is probed at intervals
353  * of tcp6_keepintvl (same units) until a response is received
354  * or until tcp6_keepcnt probes have been made, at which time
355  * the connection is dropped.  Note that a tcp6_keepidle value
356  * under 2 hours is nonconformant with RFC-1122, Internet Host Requirements.
357  */
358 int     tcp6_keepidle = TCP6TV_KEEP_IDLE;       /* time before probing idle */
359 int     tcp6_keepintvl = TCP6TV_KEEPINTVL;      /* interval betwn idle probes */
360 int     tcp6_keepcnt = TCP6TV_KEEPCNT;          /* max idle probes */
361 int     tcp6_maxpersistidle = TCP6TV_KEEP_IDLE; /* max idle time in persist */
362
363 #ifndef INET_SERVER
364 #define TCP6_LISTEN_HASH_SIZE   17
365 #define TCP6_CONN_HASH_SIZE     97
366 #define TCP6_SYN_HASH_SIZE      293
367 #define TCP6_SYN_BUCKET_SIZE    35
368 #else
369 #define TCP6_LISTEN_HASH_SIZE   97
370 #define TCP6_CONN_HASH_SIZE     9973
371 #define TCP6_SYN_HASH_SIZE      997
372 #define TCP6_SYN_BUCKET_SIZE    35
373 #endif
374 int     tcp6_listen_hash_size = TCP6_LISTEN_HASH_SIZE;
375 int     tcp6_conn_hash_size = TCP6_CONN_HASH_SIZE;
376 struct  tcp6_hash_list tcp6_listen_hash[TCP6_LISTEN_HASH_SIZE],
377         tcp6_conn_hash[TCP6_CONN_HASH_SIZE];
378
379 int     tcp6_syn_cache_size = TCP6_SYN_HASH_SIZE;
380 int     tcp6_syn_cache_limit = TCP6_SYN_HASH_SIZE*TCP6_SYN_BUCKET_SIZE;
381 int     tcp6_syn_bucket_limit = 3*TCP6_SYN_BUCKET_SIZE;
382 struct  syn_cache_head6 tcp6_syn_cache[TCP6_SYN_HASH_SIZE];
383 struct  syn_cache_head6 *tcp6_syn_cache_first;
384 int     tcp6_syn_cache_interval = 8;    /* runs timer every 4 seconds */
385 int     tcp6_syn_cache_timeo = TCP6TV_KEEP_INIT;
386
387 /*
388  * Parameters for computing a desirable data segment size
389  * given an upper bound (either interface MTU, or peer's MSS option)_.
390  * As applications tend to use a buffer size that is a multiple
391  * of kilobytes, try for something that divides evenly. However,
392  * do not round down too much.
393  *
394  * Round segment size down to a multiple of TCP6_ROUNDSIZE if this
395  * does not result in lowering by more than (size/TCP6_ROUNDFRAC).
396  * For example, round 536 to 512.  Older versions of the system
397  * effectively used MCLBYTES (1K or 2K) as TCP6_ROUNDSIZE, with
398  * a value of 1 for TCP6_ROUNDFRAC (eliminating its effect).
399  * We round to a multiple of 256 for SLIP.
400  */
401 #ifndef TCP6_ROUNDSIZE
402 #define TCP6_ROUNDSIZE  256     /* round to multiple of 256 */
403 #endif
404 #ifndef TCP6_ROUNDFRAC
405 #define TCP6_ROUNDFRAC  10      /* round down at most N/10, or 10% */
406 #endif
407
408 int     tcp6_roundsize = TCP6_ROUNDSIZE;
409 int     tcp6_roundfrac = TCP6_ROUNDFRAC;
410 #endif /*TCP6*/
411
412 /* UDP on IP6 parameters */
413 int     udp6_sendspace = 9216;          /* really max datagram size */
414 int     udp6_recvspace = 40 * (1024 + sizeof(struct sockaddr_in6));
415                                         /* 40 1K datagrams */
416
417 /*
418  * sysctl related items.
419  */
420 SYSCTL_NODE(_net,       PF_INET6,       inet6,  CTLFLAG_RW,     0,
421         "Internet6 Family");
422
423 /* net.inet6 */
424 SYSCTL_NODE(_net_inet6, IPPROTO_IPV6,   ip6,    CTLFLAG_RW, 0,  "IP6");
425 SYSCTL_NODE(_net_inet6, IPPROTO_ICMPV6, icmp6,  CTLFLAG_RW, 0,  "ICMP6");
426 SYSCTL_NODE(_net_inet6, IPPROTO_UDP,    udp6,   CTLFLAG_RW, 0,  "UDP6");
427 SYSCTL_NODE(_net_inet6, IPPROTO_TCP,    tcp6,   CTLFLAG_RW, 0,  "TCP6");
428 #ifdef IPSEC
429 SYSCTL_NODE(_net_inet6, IPPROTO_ESP,    ipsec6, CTLFLAG_RW, 0,  "IPSEC6");
430 #endif /* IPSEC */
431
432 /* net.inet6.ip6 */
433 static int
434 sysctl_ip6_forwarding(SYSCTL_HANDLER_ARGS)
435 {
436         int error = 0;
437         int old_ip6_forwarding;
438         int changed;
439
440         error = SYSCTL_OUT(req, arg1, sizeof(int));
441         if (error || !req->newptr)
442                 return (error);
443         old_ip6_forwarding = ip6_forwarding;
444         error = SYSCTL_IN(req, arg1, sizeof(int));
445         if (error != 0)
446                 return (error);
447         changed = (ip6_forwarding ? 1 : 0) ^ (old_ip6_forwarding ? 1 : 0);
448         if (changed == 0)
449                 return (error);
450         /*
451          * XXX while host->router removes prefix got from RA,
452          * router->host case nukes all the prefixes managed by in6_prefix.c
453          * (both RR and static).  therefore, switching from host->router->host
454          * will remove statically configured addresses/prefixes.
455          * not sure if it is intended behavior or not.
456          */
457         if (ip6_forwarding != 0) {      /* host becomes router */
458                 int s = splnet();
459                 struct nd_prefix *pr, *next;
460
461                 for (pr = nd_prefix.lh_first; pr; pr = next) {
462                         next = pr->ndpr_next;
463                         if (!IN6_IS_ADDR_UNSPECIFIED(&pr->ndpr_addr))
464                                 in6_ifdel(pr->ndpr_ifp, &pr->ndpr_addr);
465                         prelist_remove(pr);
466                 }
467                 splx(s);
468         } else {                        /* router becomes host */
469                 while(!LIST_EMPTY(&rr_prefix))
470                         delete_each_prefix(LIST_FIRST(&rr_prefix),
471                                            PR_ORIG_KERNEL);
472         }
473
474         return (error);
475 }
476
477 static int
478 sysctl_icmp6_ratelimit (SYSCTL_HANDLER_ARGS)
479 {
480         int rate_usec, error, s;
481
482         /*
483          * The sysctl specifies the rate in usec-between-icmp,
484          * so we must convert from/to a timeval.
485          */
486         rate_usec = (icmp6errratelim.tv_sec * 1000000) +
487             icmp6errratelim.tv_usec;
488         error = sysctl_handle_int(oidp, &rate_usec, 0, req);
489         if (error)
490                 return (error);
491         if (rate_usec < 0)
492                 return (EINVAL);
493         s = splnet();
494         icmp6errratelim.tv_sec = rate_usec / 1000000;
495         icmp6errratelim.tv_usec = rate_usec % 1000000;
496         splx(s);
497
498         return (0);
499 }
500
501 SYSCTL_OID(_net_inet6_ip6, IPV6CTL_FORWARDING, forwarding,
502            CTLTYPE_INT|CTLFLAG_RW, &ip6_forwarding, 0, sysctl_ip6_forwarding,
503            "I", "");
504 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_SENDREDIRECTS,
505         redirect, CTLFLAG_RW,           &ip6_sendredirects,     0, "");
506 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_DEFHLIM,
507         hlim, CTLFLAG_RW,               &ip6_defhlim,   0, "");
508 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MAXFRAGPACKETS,
509         maxfragpackets, CTLFLAG_RW,     &ip6_maxfragpackets,    0, "");
510 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_ACCEPT_RTADV,
511         accept_rtadv, CTLFLAG_RW,       &ip6_accept_rtadv,      0, "");
512 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_KEEPFAITH,
513         keepfaith, CTLFLAG_RW,          &ip6_keepfaith, 0, "");
514 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_LOG_INTERVAL,
515         log_interval, CTLFLAG_RW,       &ip6_log_interval,      0, "");
516 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_HDRNESTLIMIT,
517         hdrnestlimit, CTLFLAG_RW,       &ip6_hdrnestlimit,      0, "");
518 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_DAD_COUNT,
519         dad_count, CTLFLAG_RW,  &ip6_dad_count, 0, "");
520 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_AUTO_FLOWLABEL,
521         auto_flowlabel, CTLFLAG_RW,     &ip6_auto_flowlabel,    0, "");
522 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_DEFMCASTHLIM,
523         defmcasthlim, CTLFLAG_RW,       &ip6_defmcasthlim,      0, "");
524 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_GIF_HLIM,
525         gifhlim, CTLFLAG_RW,    &ip6_gif_hlim,                  0, "");
526 SYSCTL_STRING(_net_inet6_ip6, IPV6CTL_KAME_VERSION,
527         kame_version, CTLFLAG_RD,       __KAME_VERSION,         0, "");
528 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_USE_DEPRECATED,
529         use_deprecated, CTLFLAG_RW,     &ip6_use_deprecated,    0, "");
530 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_RR_PRUNE,
531         rr_prune, CTLFLAG_RW,   &ip6_rr_prune,                  0, "");
532 SYSCTL_INT(_net_inet6_ip6, IPV6CTL_MAPPED_ADDR,
533         mapped_addr, CTLFLAG_RW,        &ip6_mapped_addr_on,    0, "");
534
535 /* net.inet6.icmp6 */
536 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_REDIRACCEPT,
537         rediraccept, CTLFLAG_RW,        &icmp6_rediraccept,     0, "");
538 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_REDIRTIMEOUT,
539         redirtimeout, CTLFLAG_RW,       &icmp6_redirtimeout,    0, "");
540 SYSCTL_STRUCT(_net_inet6_icmp6, ICMPV6CTL_STATS, stats, CTLFLAG_RD,
541         &icmp6stat, icmp6stat, "");
542 SYSCTL_PROC(_net_inet6_icmp6, ICMPV6CTL_ERRRATELIMIT,
543         errratelimit, CTLTYPE_INT|CTLFLAG_RW,
544         0, sizeof(int), sysctl_icmp6_ratelimit, "I", "");
545 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_PRUNE,
546         nd6_prune, CTLFLAG_RW,          &nd6_prune,     0, "");
547 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_DELAY,
548         nd6_delay, CTLFLAG_RW,          &nd6_delay,     0, "");
549 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_UMAXTRIES,
550         nd6_umaxtries, CTLFLAG_RW,      &nd6_umaxtries, 0, "");
551 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_MMAXTRIES,
552         nd6_mmaxtries, CTLFLAG_RW,      &nd6_mmaxtries, 0, "");
553 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_USELOOPBACK,
554         nd6_useloopback, CTLFLAG_RW,    &nd6_useloopback, 0, "");
555 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_NODEINFO,
556         nodeinfo, CTLFLAG_RW,   &icmp6_nodeinfo,        0, "");
557 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ERRPPSLIMIT,
558         errppslimit, CTLFLAG_RW,        &icmp6errppslim,        0, "");
559 SYSCTL_INT(_net_inet6_icmp6, ICMPV6CTL_ND6_MAXNUDHINT,
560         nd6_maxnudhint, CTLFLAG_RW,     &nd6_maxnudhint, 0, "");