- switch the lifetime struct to time_t and provide compatibility for the old ioctl.diff -r1.143 -r1.144 src/sys/netinet6/in6.c
(christos)
--- src/sys/netinet6/in6.c 2008/12/19 18:49:39 1.143
+++ src/sys/netinet6/in6.c 2009/01/15 18:20:48 1.144
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: in6.c,v 1.143 2008/12/19 18:49:39 cegger Exp $ */ | 1 | /* $NetBSD: in6.c,v 1.144 2009/01/15 18:20:48 christos Exp $ */ | |
2 | /* $KAME: in6.c,v 1.198 2001/07/18 09:12:38 itojun Exp $ */ | 2 | /* $KAME: in6.c,v 1.198 2001/07/18 09:12:38 itojun Exp $ */ | |
3 | 3 | |||
4 | /* | 4 | /* | |
5 | * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. | 5 | * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. | |
6 | * All rights reserved. | 6 | * All rights reserved. | |
7 | * | 7 | * | |
8 | * Redistribution and use in source and binary forms, with or without | 8 | * Redistribution and use in source and binary forms, with or without | |
9 | * modification, are permitted provided that the following conditions | 9 | * modification, are permitted provided that the following conditions | |
10 | * are met: | 10 | * are met: | |
11 | * 1. Redistributions of source code must retain the above copyright | 11 | * 1. Redistributions of source code must retain the above copyright | |
12 | * notice, this list of conditions and the following disclaimer. | 12 | * notice, this list of conditions and the following disclaimer. | |
13 | * 2. Redistributions in binary form must reproduce the above copyright | 13 | * 2. Redistributions in binary form must reproduce the above copyright | |
14 | * notice, this list of conditions and the following disclaimer in the | 14 | * notice, this list of conditions and the following disclaimer in the | |
@@ -52,30 +52,31 @@ | @@ -52,30 +52,31 @@ | |||
52 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | 52 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
53 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | 53 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
54 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | 54 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
55 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | 55 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
56 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | 56 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
57 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | 57 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
58 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 58 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
59 | * SUCH DAMAGE. | 59 | * SUCH DAMAGE. | |
60 | * | 60 | * | |
61 | * @(#)in.c 8.2 (Berkeley) 11/15/93 | 61 | * @(#)in.c 8.2 (Berkeley) 11/15/93 | |
62 | */ | 62 | */ | |
63 | 63 | |||
64 | #include <sys/cdefs.h> | 64 | #include <sys/cdefs.h> | |
65 | __KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.143 2008/12/19 18:49:39 cegger Exp $"); | 65 | __KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.144 2009/01/15 18:20:48 christos Exp $"); | |
66 | 66 | |||
67 | #include "opt_inet.h" | 67 | #include "opt_inet.h" | |
68 | #include "opt_pfil_hooks.h" | 68 | #include "opt_pfil_hooks.h" | |
69 | #include "opt_compat_netbsd.h" | |||
69 | 70 | |||
70 | #include <sys/param.h> | 71 | #include <sys/param.h> | |
71 | #include <sys/ioctl.h> | 72 | #include <sys/ioctl.h> | |
72 | #include <sys/errno.h> | 73 | #include <sys/errno.h> | |
73 | #include <sys/malloc.h> | 74 | #include <sys/malloc.h> | |
74 | #include <sys/socket.h> | 75 | #include <sys/socket.h> | |
75 | #include <sys/socketvar.h> | 76 | #include <sys/socketvar.h> | |
76 | #include <sys/sockio.h> | 77 | #include <sys/sockio.h> | |
77 | #include <sys/systm.h> | 78 | #include <sys/systm.h> | |
78 | #include <sys/proc.h> | 79 | #include <sys/proc.h> | |
79 | #include <sys/time.h> | 80 | #include <sys/time.h> | |
80 | #include <sys/kernel.h> | 81 | #include <sys/kernel.h> | |
81 | #include <sys/syslog.h> | 82 | #include <sys/syslog.h> | |
@@ -93,26 +94,29 @@ __KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.14 | @@ -93,26 +94,29 @@ __KERNEL_RCSID(0, "$NetBSD: in6.c,v 1.14 | |||
93 | #include <netinet/ip6.h> | 94 | #include <netinet/ip6.h> | |
94 | #include <netinet6/ip6_var.h> | 95 | #include <netinet6/ip6_var.h> | |
95 | #include <netinet6/nd6.h> | 96 | #include <netinet6/nd6.h> | |
96 | #include <netinet6/mld6_var.h> | 97 | #include <netinet6/mld6_var.h> | |
97 | #include <netinet6/ip6_mroute.h> | 98 | #include <netinet6/ip6_mroute.h> | |
98 | #include <netinet6/in6_ifattach.h> | 99 | #include <netinet6/in6_ifattach.h> | |
99 | #include <netinet6/scope6_var.h> | 100 | #include <netinet6/scope6_var.h> | |
100 | 101 | |||
101 | #include <net/net_osdep.h> | 102 | #include <net/net_osdep.h> | |
102 | 103 | |||
103 | #ifdef PFIL_HOOKS | 104 | #ifdef PFIL_HOOKS | |
104 | #include <net/pfil.h> | 105 | #include <net/pfil.h> | |
105 | #endif | 106 | #endif | |
107 | #ifdef COMPAT_50 | |||
108 | #include <compat/netinet6/in6_var.h> | |||
109 | #endif | |||
106 | 110 | |||
107 | MALLOC_DEFINE(M_IP6OPT, "ip6_options", "IPv6 options"); | 111 | MALLOC_DEFINE(M_IP6OPT, "ip6_options", "IPv6 options"); | |
108 | 112 | |||
109 | /* enable backward compatibility code for obsoleted ioctls */ | 113 | /* enable backward compatibility code for obsoleted ioctls */ | |
110 | #define COMPAT_IN6IFIOCTL | 114 | #define COMPAT_IN6IFIOCTL | |
111 | 115 | |||
112 | #ifdef IN6_DEBUG | 116 | #ifdef IN6_DEBUG | |
113 | #define IN6_DPRINTF(__fmt, ...) printf(__fmt, __VA_ARGS__) | 117 | #define IN6_DPRINTF(__fmt, ...) printf(__fmt, __VA_ARGS__) | |
114 | #else | 118 | #else | |
115 | #define IN6_DPRINTF(__fmt, ...) do { } while (/*CONSTCOND*/0) | 119 | #define IN6_DPRINTF(__fmt, ...) do { } while (/*CONSTCOND*/0) | |
116 | #endif /* IN6_DEBUG */ | 120 | #endif /* IN6_DEBUG */ | |
117 | 121 | |||
118 | /* | 122 | /* | |
@@ -433,26 +437,29 @@ in6_control1(struct socket *so, u_long c | @@ -433,26 +437,29 @@ in6_control1(struct socket *so, u_long c | |||
433 | case SIOCGIFADDR_IN6: | 437 | case SIOCGIFADDR_IN6: | |
434 | case SIOCSIFDSTADDR_IN6: | 438 | case SIOCSIFDSTADDR_IN6: | |
435 | case SIOCSIFNETMASK_IN6: | 439 | case SIOCSIFNETMASK_IN6: | |
436 | case SIOCGIFDSTADDR_IN6: | 440 | case SIOCGIFDSTADDR_IN6: | |
437 | case SIOCGIFNETMASK_IN6: | 441 | case SIOCGIFNETMASK_IN6: | |
438 | case SIOCDIFADDR_IN6: | 442 | case SIOCDIFADDR_IN6: | |
439 | case SIOCGIFPSRCADDR_IN6: | 443 | case SIOCGIFPSRCADDR_IN6: | |
440 | case SIOCGIFPDSTADDR_IN6: | 444 | case SIOCGIFPDSTADDR_IN6: | |
441 | case SIOCGIFAFLAG_IN6: | 445 | case SIOCGIFAFLAG_IN6: | |
442 | case SIOCSNDFLUSH_IN6: | 446 | case SIOCSNDFLUSH_IN6: | |
443 | case SIOCSPFXFLUSH_IN6: | 447 | case SIOCSPFXFLUSH_IN6: | |
444 | case SIOCSRTRFLUSH_IN6: | 448 | case SIOCSRTRFLUSH_IN6: | |
445 | case SIOCGIFALIFETIME_IN6: | 449 | case SIOCGIFALIFETIME_IN6: | |
450 | #ifdef OSIOCGIFALIFETIME_IN6 | |||
451 | case OSIOCGIFALIFETIME_IN6: | |||
452 | #endif | |||
446 | case SIOCGIFSTAT_IN6: | 453 | case SIOCGIFSTAT_IN6: | |
447 | case SIOCGIFSTAT_ICMP6: | 454 | case SIOCGIFSTAT_ICMP6: | |
448 | sa6 = &ifr->ifr_addr; | 455 | sa6 = &ifr->ifr_addr; | |
449 | break; | 456 | break; | |
450 | default: | 457 | default: | |
451 | sa6 = NULL; | 458 | sa6 = NULL; | |
452 | break; | 459 | break; | |
453 | } | 460 | } | |
454 | if (sa6 && sa6->sin6_family == AF_INET6) { | 461 | if (sa6 && sa6->sin6_family == AF_INET6) { | |
455 | if (sa6->sin6_scope_id != 0) | 462 | if (sa6->sin6_scope_id != 0) | |
456 | error = sa6_embedscope(sa6, 0); | 463 | error = sa6_embedscope(sa6, 0); | |
457 | else | 464 | else | |
458 | error = in6_setscope(&sa6->sin6_addr, ifp, NULL); | 465 | error = in6_setscope(&sa6->sin6_addr, ifp, NULL); | |
@@ -493,26 +500,29 @@ in6_control1(struct socket *so, u_long c | @@ -493,26 +500,29 @@ in6_control1(struct socket *so, u_long c | |||
493 | return EAFNOSUPPORT; | 500 | return EAFNOSUPPORT; | |
494 | if (!privileged) | 501 | if (!privileged) | |
495 | return EPERM; | 502 | return EPERM; | |
496 | 503 | |||
497 | break; | 504 | break; | |
498 | 505 | |||
499 | case SIOCGIFADDR_IN6: | 506 | case SIOCGIFADDR_IN6: | |
500 | /* This interface is basically deprecated. use SIOCGIFCONF. */ | 507 | /* This interface is basically deprecated. use SIOCGIFCONF. */ | |
501 | /* FALLTHROUGH */ | 508 | /* FALLTHROUGH */ | |
502 | case SIOCGIFAFLAG_IN6: | 509 | case SIOCGIFAFLAG_IN6: | |
503 | case SIOCGIFNETMASK_IN6: | 510 | case SIOCGIFNETMASK_IN6: | |
504 | case SIOCGIFDSTADDR_IN6: | 511 | case SIOCGIFDSTADDR_IN6: | |
505 | case SIOCGIFALIFETIME_IN6: | 512 | case SIOCGIFALIFETIME_IN6: | |
513 | #ifdef OSIOCGIFALIFETIME_IN6 | |||
514 | case OSIOCGIFALIFETIME_IN6: | |||
515 | #endif | |||
506 | /* must think again about its semantics */ | 516 | /* must think again about its semantics */ | |
507 | if (ia == NULL) | 517 | if (ia == NULL) | |
508 | return EADDRNOTAVAIL; | 518 | return EADDRNOTAVAIL; | |
509 | break; | 519 | break; | |
510 | } | 520 | } | |
511 | 521 | |||
512 | switch (cmd) { | 522 | switch (cmd) { | |
513 | 523 | |||
514 | case SIOCGIFADDR_IN6: | 524 | case SIOCGIFADDR_IN6: | |
515 | ifr->ifr_addr = ia->ia_addr; | 525 | ifr->ifr_addr = ia->ia_addr; | |
516 | if ((error = sa6_recoverscope(&ifr->ifr_addr)) != 0) | 526 | if ((error = sa6_recoverscope(&ifr->ifr_addr)) != 0) | |
517 | return error; | 527 | return error; | |
518 | break; | 528 | break; | |
@@ -545,26 +555,29 @@ in6_control1(struct socket *so, u_long c | @@ -545,26 +555,29 @@ in6_control1(struct socket *so, u_long c | |||
545 | ifr->ifr_ifru.ifru_stat = | 555 | ifr->ifr_ifru.ifru_stat = | |
546 | *((struct in6_ifextra *)ifp->if_afdata[AF_INET6])->in6_ifstat; | 556 | *((struct in6_ifextra *)ifp->if_afdata[AF_INET6])->in6_ifstat; | |
547 | break; | 557 | break; | |
548 | 558 | |||
549 | case SIOCGIFSTAT_ICMP6: | 559 | case SIOCGIFSTAT_ICMP6: | |
550 | if (ifp == NULL) | 560 | if (ifp == NULL) | |
551 | return EINVAL; | 561 | return EINVAL; | |
552 | bzero(&ifr->ifr_ifru.ifru_icmp6stat, | 562 | bzero(&ifr->ifr_ifru.ifru_icmp6stat, | |
553 | sizeof(ifr->ifr_ifru.ifru_icmp6stat)); | 563 | sizeof(ifr->ifr_ifru.ifru_icmp6stat)); | |
554 | ifr->ifr_ifru.ifru_icmp6stat = | 564 | ifr->ifr_ifru.ifru_icmp6stat = | |
555 | *((struct in6_ifextra *)ifp->if_afdata[AF_INET6])->icmp6_ifstat; | 565 | *((struct in6_ifextra *)ifp->if_afdata[AF_INET6])->icmp6_ifstat; | |
556 | break; | 566 | break; | |
557 | 567 | |||
568 | #ifdef OSIOCGIFALIFETIME_IN6 | |||
569 | case OSIOCGIFALIFETIME_IN6: | |||
570 | #endif | |||
558 | case SIOCGIFALIFETIME_IN6: | 571 | case SIOCGIFALIFETIME_IN6: | |
559 | ifr->ifr_ifru.ifru_lifetime = ia->ia6_lifetime; | 572 | ifr->ifr_ifru.ifru_lifetime = ia->ia6_lifetime; | |
560 | if (ia->ia6_lifetime.ia6t_vltime != ND6_INFINITE_LIFETIME) { | 573 | if (ia->ia6_lifetime.ia6t_vltime != ND6_INFINITE_LIFETIME) { | |
561 | time_t maxexpire; | 574 | time_t maxexpire; | |
562 | struct in6_addrlifetime *retlt = | 575 | struct in6_addrlifetime *retlt = | |
563 | &ifr->ifr_ifru.ifru_lifetime; | 576 | &ifr->ifr_ifru.ifru_lifetime; | |
564 | 577 | |||
565 | /* | 578 | /* | |
566 | * XXX: adjust expiration time assuming time_t is | 579 | * XXX: adjust expiration time assuming time_t is | |
567 | * signed. | 580 | * signed. | |
568 | */ | 581 | */ | |
569 | maxexpire = ((time_t)~0) & | 582 | maxexpire = ((time_t)~0) & | |
570 | ~((time_t)1 << ((sizeof(maxexpire) * NBBY) - 1)); | 583 | ~((time_t)1 << ((sizeof(maxexpire) * NBBY) - 1)); | |
@@ -583,26 +596,31 @@ in6_control1(struct socket *so, u_long c | @@ -583,26 +596,31 @@ in6_control1(struct socket *so, u_long c | |||
583 | /* | 596 | /* | |
584 | * XXX: adjust expiration time assuming time_t is | 597 | * XXX: adjust expiration time assuming time_t is | |
585 | * signed. | 598 | * signed. | |
586 | */ | 599 | */ | |
587 | maxexpire = ((time_t)~0) & | 600 | maxexpire = ((time_t)~0) & | |
588 | ~((time_t)1 << ((sizeof(maxexpire) * NBBY) - 1)); | 601 | ~((time_t)1 << ((sizeof(maxexpire) * NBBY) - 1)); | |
589 | if (ia->ia6_lifetime.ia6t_pltime < | 602 | if (ia->ia6_lifetime.ia6t_pltime < | |
590 | maxexpire - ia->ia6_updatetime) { | 603 | maxexpire - ia->ia6_updatetime) { | |
591 | retlt->ia6t_preferred = ia->ia6_updatetime + | 604 | retlt->ia6t_preferred = ia->ia6_updatetime + | |
592 | ia->ia6_lifetime.ia6t_pltime; | 605 | ia->ia6_lifetime.ia6t_pltime; | |
593 | } else | 606 | } else | |
594 | retlt->ia6t_preferred = maxexpire; | 607 | retlt->ia6t_preferred = maxexpire; | |
595 | } | 608 | } | |
609 | #ifdef OSIOCFIFALIFETIME_IN6 | |||
610 | if (cmd == OSIOCFIFALIFETIME_IN6) | |||
611 | in6_addrlifetime_to_in6_addrlifetime50( | |||
612 | &ifr->ifru.ifru_lifetime); | |||
613 | #endif | |||
596 | break; | 614 | break; | |
597 | 615 | |||
598 | case SIOCAIFADDR_IN6: | 616 | case SIOCAIFADDR_IN6: | |
599 | { | 617 | { | |
600 | int i; | 618 | int i; | |
601 | struct nd_prefixctl pr0; | 619 | struct nd_prefixctl pr0; | |
602 | struct nd_prefix *pr; | 620 | struct nd_prefix *pr; | |
603 | 621 | |||
604 | /* reject read-only flags */ | 622 | /* reject read-only flags */ | |
605 | if ((ifra->ifra_flags & IN6_IFF_DUPLICATED) != 0 || | 623 | if ((ifra->ifra_flags & IN6_IFF_DUPLICATED) != 0 || | |
606 | (ifra->ifra_flags & IN6_IFF_DETACHED) != 0 || | 624 | (ifra->ifra_flags & IN6_IFF_DETACHED) != 0 || | |
607 | (ifra->ifra_flags & IN6_IFF_NODAD) != 0 || | 625 | (ifra->ifra_flags & IN6_IFF_NODAD) != 0 || | |
608 | (ifra->ifra_flags & IN6_IFF_AUTOCONF) != 0) { | 626 | (ifra->ifra_flags & IN6_IFF_AUTOCONF) != 0) { |
--- src/sys/netinet6/in6_var.h 2009/01/14 18:06:52 1.61
+++ src/sys/netinet6/in6_var.h 2009/01/15 18:20:48 1.62
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: in6_var.h,v 1.61 2009/01/14 18:06:52 christos Exp $ */ | 1 | /* $NetBSD: in6_var.h,v 1.62 2009/01/15 18:20:48 christos Exp $ */ | |
2 | /* $KAME: in6_var.h,v 1.81 2002/06/08 11:16:51 itojun Exp $ */ | 2 | /* $KAME: in6_var.h,v 1.81 2002/06/08 11:16:51 itojun Exp $ */ | |
3 | 3 | |||
4 | /* | 4 | /* | |
5 | * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. | 5 | * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. | |
6 | * All rights reserved. | 6 | * All rights reserved. | |
7 | * | 7 | * | |
8 | * Redistribution and use in source and binary forms, with or without | 8 | * Redistribution and use in source and binary forms, with or without | |
9 | * modification, are permitted provided that the following conditions | 9 | * modification, are permitted provided that the following conditions | |
10 | * are met: | 10 | * are met: | |
11 | * 1. Redistributions of source code must retain the above copyright | 11 | * 1. Redistributions of source code must retain the above copyright | |
12 | * notice, this list of conditions and the following disclaimer. | 12 | * notice, this list of conditions and the following disclaimer. | |
13 | * 2. Redistributions in binary form must reproduce the above copyright | 13 | * 2. Redistributions in binary form must reproduce the above copyright | |
14 | * notice, this list of conditions and the following disclaimer in the | 14 | * notice, this list of conditions and the following disclaimer in the | |
@@ -72,28 +72,28 @@ | @@ -72,28 +72,28 @@ | |||
72 | * The ifaddr structure contains the protocol-independent part | 72 | * The ifaddr structure contains the protocol-independent part | |
73 | * of the structure and is assumed to be first. | 73 | * of the structure and is assumed to be first. | |
74 | */ | 74 | */ | |
75 | 75 | |||
76 | /* | 76 | /* | |
77 | * pltime/vltime are just for future reference (required to implements 2 | 77 | * pltime/vltime are just for future reference (required to implements 2 | |
78 | * hour rule for hosts). they should never be modified by nd6_timeout or | 78 | * hour rule for hosts). they should never be modified by nd6_timeout or | |
79 | * anywhere else. | 79 | * anywhere else. | |
80 | * userland -> kernel: accept pltime/vltime | 80 | * userland -> kernel: accept pltime/vltime | |
81 | * kernel -> userland: throw up everything | 81 | * kernel -> userland: throw up everything | |
82 | * in kernel: modify preferred/expire only | 82 | * in kernel: modify preferred/expire only | |
83 | */ | 83 | */ | |
84 | struct in6_addrlifetime { | 84 | struct in6_addrlifetime { | |
85 | int32_t ia6t_expire; /* valid lifetime expiration time */ | 85 | time_t ia6t_expire; /* valid lifetime expiration time */ | |
86 | int32_t ia6t_preferred; /* preferred lifetime expiration time */ | 86 | time_t ia6t_preferred; /* preferred lifetime expiration time */ | |
87 | u_int32_t ia6t_vltime; /* valid lifetime */ | 87 | u_int32_t ia6t_vltime; /* valid lifetime */ | |
88 | u_int32_t ia6t_pltime; /* prefix lifetime */ | 88 | u_int32_t ia6t_pltime; /* prefix lifetime */ | |
89 | }; | 89 | }; | |
90 | 90 | |||
91 | struct nd_ifinfo; | 91 | struct nd_ifinfo; | |
92 | struct in6_ifextra { | 92 | struct in6_ifextra { | |
93 | struct in6_ifstat *in6_ifstat; | 93 | struct in6_ifstat *in6_ifstat; | |
94 | struct icmp6_ifstat *icmp6_ifstat; | 94 | struct icmp6_ifstat *icmp6_ifstat; | |
95 | struct nd_ifinfo *nd_ifinfo; | 95 | struct nd_ifinfo *nd_ifinfo; | |
96 | struct scope6_id *scope6_id; | 96 | struct scope6_id *scope6_id; | |
97 | }; | 97 | }; | |
98 | 98 | |||
99 | struct in6_ifaddr { | 99 | struct in6_ifaddr { | |
@@ -409,49 +409,51 @@ struct in6_rrenumreq { | @@ -409,49 +409,51 @@ struct in6_rrenumreq { | |||
409 | #define SIOCGIFAFLAG_IN6 _IOWR('i', 73, struct in6_ifreq) | 409 | #define SIOCGIFAFLAG_IN6 _IOWR('i', 73, struct in6_ifreq) | |
410 | 410 | |||
411 | #define SIOCGDRLST_IN6 _IOWR('i', 74, struct in6_drlist) | 411 | #define SIOCGDRLST_IN6 _IOWR('i', 74, struct in6_drlist) | |
412 | #define SIOCGPRLST_IN6 _IOWR('i', 75, struct in6_oprlist) | 412 | #define SIOCGPRLST_IN6 _IOWR('i', 75, struct in6_oprlist) | |
413 | #ifdef _KERNEL | 413 | #ifdef _KERNEL | |
414 | #define OSIOCGIFINFO_IN6 _IOWR('i', 76, struct in6_ondireq) | 414 | #define OSIOCGIFINFO_IN6 _IOWR('i', 76, struct in6_ondireq) | |
415 | #endif | 415 | #endif | |
416 | #define SIOCGIFINFO_IN6 _IOWR('i', 108, struct in6_ndireq) | 416 | #define SIOCGIFINFO_IN6 _IOWR('i', 108, struct in6_ndireq) | |
417 | #define SIOCSIFINFO_IN6 _IOWR('i', 109, struct in6_ndireq) | 417 | #define SIOCSIFINFO_IN6 _IOWR('i', 109, struct in6_ndireq) | |
418 | #define SIOCSNDFLUSH_IN6 _IOWR('i', 77, struct in6_ifreq) | 418 | #define SIOCSNDFLUSH_IN6 _IOWR('i', 77, struct in6_ifreq) | |
419 | #define SIOCGNBRINFO_IN6 _IOWR('i', 78, struct in6_nbrinfo) | 419 | #define SIOCGNBRINFO_IN6 _IOWR('i', 78, struct in6_nbrinfo) | |
420 | #define SIOCSPFXFLUSH_IN6 _IOWR('i', 79, struct in6_ifreq) | 420 | #define SIOCSPFXFLUSH_IN6 _IOWR('i', 79, struct in6_ifreq) | |
421 | #define SIOCSRTRFLUSH_IN6 _IOWR('i', 80, struct in6_ifreq) | 421 | #define SIOCSRTRFLUSH_IN6 _IOWR('i', 80, struct in6_ifreq) | |
422 | 422 | /* 81 was old SIOCGIFALIFETIME_IN6 */ | ||
423 | #define SIOCGIFALIFETIME_IN6 _IOWR('i', 81, struct in6_ifreq) | |||
424 | #if 0 | 423 | #if 0 | |
425 | /* withdrawn - do not reuse number 82 */ | 424 | /* withdrawn - do not reuse number 82 */ | |
426 | #define SIOCSIFALIFETIME_IN6 _IOWR('i', 82, struct in6_ifreq) | 425 | #define SIOCSIFALIFETIME_IN6 _IOWR('i', 82, struct in6_ifreq) | |
427 | #endif | 426 | #endif | |
428 | #define SIOCGIFSTAT_IN6 _IOWR('i', 83, struct in6_ifreq) | 427 | #define SIOCGIFSTAT_IN6 _IOWR('i', 83, struct in6_ifreq) | |
429 | #define SIOCGIFSTAT_ICMP6 _IOWR('i', 84, struct in6_ifreq) | 428 | #define SIOCGIFSTAT_ICMP6 _IOWR('i', 84, struct in6_ifreq) | |
430 | 429 | |||
431 | #define SIOCSDEFIFACE_IN6 _IOWR('i', 85, struct in6_ndifreq) | 430 | #define SIOCSDEFIFACE_IN6 _IOWR('i', 85, struct in6_ndifreq) | |
432 | #define SIOCGDEFIFACE_IN6 _IOWR('i', 86, struct in6_ndifreq) | 431 | #define SIOCGDEFIFACE_IN6 _IOWR('i', 86, struct in6_ndifreq) | |
433 | 432 | |||
434 | #define SIOCSIFINFO_FLAGS _IOWR('i', 87, struct in6_ndireq) /* XXX */ | 433 | #define SIOCSIFINFO_FLAGS _IOWR('i', 87, struct in6_ndireq) /* XXX */ | |
435 | 434 | |||
436 | #define SIOCSIFPREFIX_IN6 _IOW('i', 100, struct in6_prefixreq) /* set */ | 435 | #define SIOCSIFPREFIX_IN6 _IOW('i', 100, struct in6_prefixreq) /* set */ | |
437 | #define SIOCGIFPREFIX_IN6 _IOWR('i', 101, struct in6_prefixreq) /* get */ | 436 | #define SIOCGIFPREFIX_IN6 _IOWR('i', 101, struct in6_prefixreq) /* get */ | |
438 | #define SIOCDIFPREFIX_IN6 _IOW('i', 102, struct in6_prefixreq) /* del */ | 437 | #define SIOCDIFPREFIX_IN6 _IOW('i', 102, struct in6_prefixreq) /* del */ | |
439 | #define SIOCAIFPREFIX_IN6 _IOW('i', 103, struct in6_rrenumreq) /* add */ | 438 | #define SIOCAIFPREFIX_IN6 _IOW('i', 103, struct in6_rrenumreq) /* add */ | |
440 | #define SIOCCIFPREFIX_IN6 _IOW('i', 104, \ | 439 | #define SIOCCIFPREFIX_IN6 _IOW('i', 104, \ | |
441 | struct in6_rrenumreq) /* change */ | 440 | struct in6_rrenumreq) /* change */ | |
442 | #define SIOCSGIFPREFIX_IN6 _IOW('i', 105, \ | 441 | #define SIOCSGIFPREFIX_IN6 _IOW('i', 105, \ | |
443 | struct in6_rrenumreq) /* set global */ | 442 | struct in6_rrenumreq) /* set global */ | |
443 | #define SIOCGIFALIFETIME_IN6 _IOWR('i', 106, struct in6_ifreq) | |||
444 | ||||
444 | 445 | |||
446 | /* XXX: Someone decided to switch to 'u' here for unknown reasons! */ | |||
445 | #define SIOCGETSGCNT_IN6 _IOWR('u', 106, \ | 447 | #define SIOCGETSGCNT_IN6 _IOWR('u', 106, \ | |
446 | struct sioc_sg_req6) /* get s,g pkt cnt */ | 448 | struct sioc_sg_req6) /* get s,g pkt cnt */ | |
447 | #define SIOCGETMIFCNT_IN6 _IOWR('u', 107, \ | 449 | #define SIOCGETMIFCNT_IN6 _IOWR('u', 107, \ | |
448 | struct sioc_mif_req6) /* get pkt cnt per if */ | 450 | struct sioc_mif_req6) /* get pkt cnt per if */ | |
449 | #define SIOCAADDRCTL_POLICY _IOW('u', 108, struct in6_addrpolicy) | 451 | #define SIOCAADDRCTL_POLICY _IOW('u', 108, struct in6_addrpolicy) | |
450 | #define SIOCDADDRCTL_POLICY _IOW('u', 109, struct in6_addrpolicy) | 452 | #define SIOCDADDRCTL_POLICY _IOW('u', 109, struct in6_addrpolicy) | |
451 | 453 | |||
452 | #define IN6_IFF_ANYCAST 0x01 /* anycast address */ | 454 | #define IN6_IFF_ANYCAST 0x01 /* anycast address */ | |
453 | #define IN6_IFF_TENTATIVE 0x02 /* tentative address */ | 455 | #define IN6_IFF_TENTATIVE 0x02 /* tentative address */ | |
454 | #define IN6_IFF_DUPLICATED 0x04 /* DAD detected duplicate */ | 456 | #define IN6_IFF_DUPLICATED 0x04 /* DAD detected duplicate */ | |
455 | #define IN6_IFF_DETACHED 0x08 /* may be detached from the link */ | 457 | #define IN6_IFF_DETACHED 0x08 /* may be detached from the link */ | |
456 | #define IN6_IFF_DEPRECATED 0x10 /* deprecated address */ | 458 | #define IN6_IFF_DEPRECATED 0x10 /* deprecated address */ | |
457 | #define IN6_IFF_NODAD 0x20 /* don't perform DAD on this address | 459 | #define IN6_IFF_NODAD 0x20 /* don't perform DAD on this address |
--- src/sys/netinet6/nd6.h 2008/10/24 17:07:33 1.51
+++ src/sys/netinet6/nd6.h 2009/01/15 18:20:48 1.52
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: nd6.h,v 1.51 2008/10/24 17:07:33 dyoung Exp $ */ | 1 | /* $NetBSD: nd6.h,v 1.52 2009/01/15 18:20:48 christos Exp $ */ | |
2 | /* $KAME: nd6.h,v 1.95 2002/06/08 11:31:06 itojun Exp $ */ | 2 | /* $KAME: nd6.h,v 1.95 2002/06/08 11:31:06 itojun Exp $ */ | |
3 | 3 | |||
4 | /* | 4 | /* | |
5 | * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. | 5 | * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. | |
6 | * All rights reserved. | 6 | * All rights reserved. | |
7 | * | 7 | * | |
8 | * Redistribution and use in source and binary forms, with or without | 8 | * Redistribution and use in source and binary forms, with or without | |
9 | * modification, are permitted provided that the following conditions | 9 | * modification, are permitted provided that the following conditions | |
10 | * are met: | 10 | * are met: | |
11 | * 1. Redistributions of source code must retain the above copyright | 11 | * 1. Redistributions of source code must retain the above copyright | |
12 | * notice, this list of conditions and the following disclaimer. | 12 | * notice, this list of conditions and the following disclaimer. | |
13 | * 2. Redistributions in binary form must reproduce the above copyright | 13 | * 2. Redistributions in binary form must reproduce the above copyright | |
14 | * notice, this list of conditions and the following disclaimer in the | 14 | * notice, this list of conditions and the following disclaimer in the | |
@@ -213,27 +213,27 @@ struct in6_ndifreq { | @@ -213,27 +213,27 @@ struct in6_ndifreq { | |||
213 | u_long ifindex; | 213 | u_long ifindex; | |
214 | }; | 214 | }; | |
215 | 215 | |||
216 | /* Prefix status */ | 216 | /* Prefix status */ | |
217 | #define NDPRF_ONLINK 0x1 | 217 | #define NDPRF_ONLINK 0x1 | |
218 | #define NDPRF_DETACHED 0x2 | 218 | #define NDPRF_DETACHED 0x2 | |
219 | #define NDPRF_HOME 0x4 | 219 | #define NDPRF_HOME 0x4 | |
220 | 220 | |||
221 | /* protocol constants */ | 221 | /* protocol constants */ | |
222 | #define MAX_RTR_SOLICITATION_DELAY 1 /* 1sec */ | 222 | #define MAX_RTR_SOLICITATION_DELAY 1 /* 1sec */ | |
223 | #define RTR_SOLICITATION_INTERVAL 4 /* 4sec */ | 223 | #define RTR_SOLICITATION_INTERVAL 4 /* 4sec */ | |
224 | #define MAX_RTR_SOLICITATIONS 3 | 224 | #define MAX_RTR_SOLICITATIONS 3 | |
225 | 225 | |||
226 | #define ND6_INFINITE_LIFETIME 0xffffffff | 226 | #define ND6_INFINITE_LIFETIME ((u_int32_t)~0) | |
227 | 227 | |||
228 | #ifdef _KERNEL | 228 | #ifdef _KERNEL | |
229 | /* node constants */ | 229 | /* node constants */ | |
230 | #define MAX_REACHABLE_TIME 3600000 /* msec */ | 230 | #define MAX_REACHABLE_TIME 3600000 /* msec */ | |
231 | #define REACHABLE_TIME 30000 /* msec */ | 231 | #define REACHABLE_TIME 30000 /* msec */ | |
232 | #define RETRANS_TIMER 1000 /* msec */ | 232 | #define RETRANS_TIMER 1000 /* msec */ | |
233 | #define MIN_RANDOM_FACTOR 512 /* 1024 * 0.5 */ | 233 | #define MIN_RANDOM_FACTOR 512 /* 1024 * 0.5 */ | |
234 | #define MAX_RANDOM_FACTOR 1536 /* 1024 * 1.5 */ | 234 | #define MAX_RANDOM_FACTOR 1536 /* 1024 * 1.5 */ | |
235 | #define DEF_TEMP_VALID_LIFETIME 604800 /* 1 week */ | 235 | #define DEF_TEMP_VALID_LIFETIME 604800 /* 1 week */ | |
236 | #define DEF_TEMP_PREFERRED_LIFETIME 86400 /* 1 day */ | 236 | #define DEF_TEMP_PREFERRED_LIFETIME 86400 /* 1 day */ | |
237 | #define TEMPADDR_REGEN_ADVANCE 5 /* sec */ | 237 | #define TEMPADDR_REGEN_ADVANCE 5 /* sec */ | |
238 | #define MAX_TEMP_DESYNC_FACTOR 600 /* 10 min */ | 238 | #define MAX_TEMP_DESYNC_FACTOR 600 /* 10 min */ | |
239 | #define ND_COMPUTE_RTIME(x) \ | 239 | #define ND_COMPUTE_RTIME(x) \ |