]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/netinet6/in6_prefix.h
unfinished sblive driver, playback/mixer only for now - not enabled in
[FreeBSD/FreeBSD.git] / sys / netinet6 / in6_prefix.h
1 /*
2  * Copyright (C) 1995, 1996, 1997, 1998 and 1999 WIDE Project.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
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.
16  *
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
27  * SUCH DAMAGE.
28  *
29  * $FreeBSD$
30  */
31
32 struct rr_prefix {
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 */
45                 u_char  addmark : 1;
46                 u_char  delmark : 1; /* if this prefix will be deleted */
47         } rp_stateflags;
48 };
49
50 #define rp_type                 rp_ifpr.ifpr_type
51 #define rp_ifp                  rp_ifpr.ifpr_ifp
52 #define rp_plen                 rp_ifpr.ifpr_plen
53
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
57
58 #define rp_statef_addmark       rp_stateflags.addmark
59 #define rp_statef_delmark       rp_stateflags.delmark
60
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
64
65 struct rp_addr {
66         LIST_ENTRY(rp_addr) ra_entry;
67         struct  in6_addr        ra_ifid;
68         struct  in6_ifaddr      *ra_addr;
69         struct  ra_flags {
70                 u_char  anycast : 1;
71         } ra_flags;
72 };
73
74 #define ifpr2rp(ifpr)   ((struct rr_prefix *)(ifpr))
75 #define rp2ifpr(rp)     ((struct ifprefix *)(rp))
76
77 #define RP_IN6(rp)      (&(rp)->rp_prefix.sin6_addr)
78
79 #define RR_INFINITE_LIFETIME            0xffffffff
80
81
82 LIST_HEAD(rr_prhead, rr_prefix);
83
84 extern struct   rr_prhead rr_prefix;
85
86 void    in6_rr_timer __P((void *));
87 int     delete_each_prefix  __P((struct socket *so, struct rr_prefix *rpp,
88                                  u_char origin));