2 * Copyright (C) 1995, 1996, 1997, 1998 and 1999 WIDE Project.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. Neither the name of the project nor the names of its contributors
14 * may be used to endorse or promote products derived from this software
15 * without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 struct ifprefix rp_ifpr;
34 LIST_ENTRY(rr_prefix) rp_entry;
35 LIST_HEAD(rp_addrhead, rp_addr) rp_addrhead;
36 struct sockaddr_in6 rp_prefix; /* prefix */
37 u_int32_t rp_vltime; /* advertised valid lifetime */
38 u_int32_t rp_pltime; /* advertised preferred lifetime */
39 time_t rp_expire; /* expiration time of the prefix */
40 time_t rp_preferred; /* preferred time of the prefix */
41 struct in6_prflags rp_flags;
42 u_char rp_origin; /* from where this prefix info is obtained */
43 struct rp_stateflags {
44 /* if some prefix should be added to this prefix */
46 u_char delmark : 1; /* if this prefix will be deleted */
50 #define rp_type rp_ifpr.ifpr_type
51 #define rp_ifp rp_ifpr.ifpr_ifp
52 #define rp_plen rp_ifpr.ifpr_plen
54 #define rp_raf rp_flags.prf_ra
55 #define rp_raf_onlink rp_flags.prf_ra.onlink
56 #define rp_raf_auto rp_flags.prf_ra.autonomous
58 #define rp_statef_addmark rp_stateflags.addmark
59 #define rp_statef_delmark rp_stateflags.delmark
61 #define rp_rrf rp_flags.prf_rr
62 #define rp_rrf_decrvalid rp_flags.prf_rr.decrvalid
63 #define rp_rrf_decrprefd rp_flags.prf_rr.decrprefd
66 LIST_ENTRY(rp_addr) ra_entry;
67 struct in6_addr ra_ifid;
68 struct in6_ifaddr *ra_addr;
74 #define ifpr2rp(ifpr) ((struct rr_prefix *)(ifpr))
75 #define rp2ifpr(rp) ((struct ifprefix *)(rp))
77 #define RP_IN6(rp) (&(rp)->rp_prefix.sin6_addr)
79 #define RR_INFINITE_LIFETIME 0xffffffff
82 LIST_HEAD(rr_prhead, rr_prefix);
84 extern struct rr_prhead rr_prefix;
86 void in6_rr_timer __P((void *));
87 int delete_each_prefix __P((struct socket *so, struct rr_prefix *rpp,