]>
git.saurik.com Git - apple/xnu.git/blob - bsd/netinet6/in6_prefix.h
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
31 struct ifprefix rp_ifpr
;
32 LIST_ENTRY(rr_prefix
) rp_entry
;
33 LIST_HEAD(rp_addrhead
, rp_addr
) rp_addrhead
;
34 struct sockaddr_in6 rp_prefix
; /* prefix */
35 u_int32_t rp_vltime
; /* advertised valid lifetime */
36 u_int32_t rp_pltime
; /* advertised preferred lifetime */
37 time_t rp_expire
; /* expiration time of the prefix */
38 time_t rp_preferred
; /* preferred time of the prefix */
39 struct in6_prflags rp_flags
;
40 u_char rp_origin
; /* from where this prefix info is obtained */
41 struct rp_stateflags
{
42 /* if some prefix should be added to this prefix */
44 u_char delmark
: 1; /* if this prefix will be deleted */
48 #define rp_type rp_ifpr.ifpr_type
49 #define rp_ifp rp_ifpr.ifpr_ifp
50 #define rp_plen rp_ifpr.ifpr_plen
52 #define rp_raf rp_flags.prf_ra
53 #define rp_raf_onlink rp_flags.prf_ra.onlink
54 #define rp_raf_auto rp_flags.prf_ra.autonomous
56 #define rp_statef_addmark rp_stateflags.addmark
57 #define rp_statef_delmark rp_stateflags.delmark
59 #define rp_rrf rp_flags.prf_rr
60 #define rp_rrf_decrvalid rp_flags.prf_rr.decrvalid
61 #define rp_rrf_decrprefd rp_flags.prf_rr.decrprefd
64 LIST_ENTRY(rp_addr
) ra_entry
;
65 struct in6_addr ra_ifid
;
66 struct in6_ifaddr
*ra_addr
;
72 #define ifpr2rp(ifpr) ((struct rr_prefix *)(ifpr))
73 #define rp2ifpr(rp) ((struct ifprefix *)(rp))
75 #define RP_IN6(rp) (&(rp)->rp_prefix.sin6_addr)
77 #define RR_INFINITE_LIFETIME 0xffffffff
80 LIST_HEAD(rr_prhead
, rr_prefix
);
82 extern struct rr_prhead rr_prefix
;
84 void in6_rr_timer
__P((void *));
85 int delete_each_prefix
__P((struct rr_prefix
*rpp
, u_char origin
));