]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/netinet6/vinet6.h
Change the initialization methodology for global variables scheduled
[FreeBSD/FreeBSD.git] / sys / netinet6 / vinet6.h
1 /*-
2  * Copyright (c) 2006-2008 University of Zagreb
3  * Copyright (c) 2006-2008 FreeBSD Foundation
4  *
5  * This software was developed by the University of Zagreb and the
6  * FreeBSD Foundation under sponsorship by the Stichting NLnet and the
7  * FreeBSD Foundation.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  * 1. Redistributions of source code must retain the above copyright
13  *    notice, this list of conditions and the following disclaimer.
14  * 2. Redistributions in binary form must reproduce the above copyright
15  *    notice, this list of conditions and the following disclaimer in the
16  *    documentation and/or other materials provided with the distribution.
17  * 
18  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28  * SUCH DAMAGE.
29  *
30  * $FreeBSD$
31  */
32
33 #ifndef _NETINET6_VINET6_H_
34 #define _NETINET6_VINET6_H_
35
36 #ifdef VIMAGE
37 #include <sys/socket.h>
38 #include <netinet/ip6.h>
39 #include <net/if.h>
40 #include <netinet6/ip6_var.h>
41 #include <netinet6/raw_ip6.h>
42 #include <netinet/icmp6.h>
43 #include <netinet6/scope6_var.h>
44 #include <netinet6/in6_ifattach.h>
45 #include <netinet6/in6_var.h>
46 #include <netinet6/nd6.h>
47 #include <netinet/in_pcb.h>
48
49 struct vnet_inet6 {
50         struct in6_ifaddr *             _in6_ifaddr;
51
52         u_int                           _frag6_nfragpackets;
53         u_int                           _frag6_nfrags;
54         struct ip6q                     _ip6q;
55
56         struct route_in6                _ip6_forward_rt;
57
58         struct in6_addrpolicy           _defaultaddrpolicy;
59         TAILQ_HEAD(, addrsel_policyent) _addrsel_policytab;
60         u_int                           _in6_maxmtu;
61         int                             _ip6_auto_linklocal;
62         int                             _rtq_minreallyold6;
63         int                             _rtq_reallyold6;
64         int                             _rtq_toomany6;
65
66         struct ip6stat                  _ip6stat;
67         struct rip6stat                 _rip6stat;
68         struct icmp6stat                _icmp6stat;
69
70         int                             _rtq_timeout6;  
71         struct callout                  _rtq_timer6;
72         struct callout                  _rtq_mtutimer;
73         struct callout                  _nd6_slowtimo_ch;
74         struct callout                  _nd6_timer_ch;
75         struct callout                  _in6_tmpaddrtimer_ch;
76
77         int                             _nd6_inuse;
78         int                             _nd6_allocated;
79         struct llinfo_nd6               _llinfo_nd6;
80         struct nd_drhead                _nd_defrouter;
81         struct nd_prhead                _nd_prefix;
82         struct ifnet *                  _nd6_defifp;
83         int                             _nd6_defifindex;
84
85         struct scope6_id                _sid_default;
86
87         TAILQ_HEAD(, dadq)              _dadq;
88         int                             _dad_init;
89
90         int                             _icmp6errpps_count;
91         int                             _icmp6errppslim_last;
92
93         int                             _ip6_forwarding;
94         int                             _ip6_sendredirects;
95         int                             _ip6_defhlim;
96         int                             _ip6_defmcasthlim;
97         int                             _ip6_accept_rtadv;
98         int                             _ip6_maxfragpackets;
99         int                             _ip6_maxfrags;
100         int                             _ip6_log_interval;
101         int                             _ip6_hdrnestlimit;
102         int                             _ip6_dad_count;
103         int                             _ip6_auto_flowlabel;
104         int                             _ip6_use_deprecated;
105         int                             _ip6_rr_prune;
106         int                             _ip6_mcast_pmtu;
107         int                             _ip6_v6only;
108         int                             _ip6_keepfaith;
109         int                             _ip6stealth;
110         time_t                          _ip6_log_time;
111         int                             _nd6_onlink_ns_rfc4861;
112
113         int                             _pmtu_expire;
114         int                             _pmtu_probe;
115         u_long                          _rip6_sendspace;
116         u_long                          _rip6_recvspace;
117         int                             _icmp6_rediraccept;
118         int                             _icmp6_redirtimeout;
119         int                             _icmp6errppslim;
120         int                             _icmp6_nodeinfo;
121         int                             _udp6_sendspace;
122         int                             _udp6_recvspace;
123         int                             _ip6qmaxlen;
124         int                             _ip6_prefer_tempaddr;
125         int                             _ip6_forward_srcrt;
126         int                             _ip6_sourcecheck;
127         int                             _ip6_sourcecheck_interval;
128         int                             _ip6_ours_check_algorithm;
129
130         int                             _nd6_prune;
131         int                             _nd6_delay;
132         int                             _nd6_umaxtries;
133         int                             _nd6_mmaxtries;
134         int                             _nd6_useloopback;
135         int                             _nd6_gctimer;
136         int                             _nd6_maxndopt;
137         int                             _nd6_maxnudhint;
138         int                             _nd6_maxqueuelen;
139         int                             _nd6_debug;
140         int                             _nd6_recalc_reachtm_interval;
141         int                             _dad_ignore_ns;
142         int                             _dad_maxtry;
143         int                             _ip6_use_tempaddr;
144         int                             _ip6_desync_factor;
145         u_int32_t                       _ip6_temp_preferred_lifetime;
146         u_int32_t                       _ip6_temp_valid_lifetime;
147
148         int                             _ip6_mrouter_ver;
149         int                             _pim6;
150         u_int                           _mrt6debug;
151
152         int                             _ip6_temp_regen_advance;
153         int                             _ip6_use_defzone;
154
155         struct ip6_pktopts              _ip6_opts;
156 };
157 #endif
158
159
160 #define INIT_VNET_INET6(vnet) \
161         INIT_FROM_VNET(vnet, VNET_MOD_INET6, struct vnet_inet6, vnet_inet6)
162
163 #define VNET_INET6(sym)         VSYM(vnet_inet6, sym)
164
165
166 /*
167  * Symbol translation macros
168  */
169 #define V_addrsel_policytab             VNET_INET6(addrsel_policytab)
170 #define V_dad_ignore_ns                 VNET_INET6(dad_ignore_ns)
171 #define V_dad_init                      VNET_INET6(dad_init)
172 #define V_dad_maxtry                    VNET_INET6(dad_maxtry)
173 #define V_dadq                          VNET_INET6(dadq)
174 #define V_defaultaddrpolicy             VNET_INET6(defaultaddrpolicy)
175 #define V_frag6_nfragpackets            VNET_INET6(frag6_nfragpackets)
176 #define V_frag6_nfrags                  VNET_INET6(frag6_nfrags)
177 #define V_icmp6_nodeinfo                VNET_INET6(icmp6_nodeinfo)
178 #define V_icmp6_rediraccept             VNET_INET6(icmp6_rediraccept)
179 #define V_icmp6_redirtimeout            VNET_INET6(icmp6_redirtimeout)
180 #define V_icmp6errpps_count             VNET_INET6(icmp6errpps_count)
181 #define V_icmp6errppslim                VNET_INET6(icmp6errppslim)
182 #define V_icmp6errppslim_last           VNET_INET6(icmp6errppslim_last)
183 #define V_icmp6stat                     VNET_INET6(icmp6stat)
184 #define V_in6_ifaddr                    VNET_INET6(in6_ifaddr)
185 #define V_in6_maxmtu                    VNET_INET6(in6_maxmtu)
186 #define V_in6_tmpaddrtimer_ch           VNET_INET6(in6_tmpaddrtimer_ch)
187 #define V_ip6_accept_rtadv              VNET_INET6(ip6_accept_rtadv)
188 #define V_ip6_auto_flowlabel            VNET_INET6(ip6_auto_flowlabel)
189 #define V_ip6_auto_linklocal            VNET_INET6(ip6_auto_linklocal)
190 #define V_ip6_dad_count                 VNET_INET6(ip6_dad_count)
191 #define V_ip6_defhlim                   VNET_INET6(ip6_defhlim)
192 #define V_ip6_defmcasthlim              VNET_INET6(ip6_defmcasthlim)
193 #define V_ip6_desync_factor             VNET_INET6(ip6_desync_factor)
194 #define V_ip6_forward_rt                VNET_INET6(ip6_forward_rt)
195 #define V_ip6_forward_srcrt             VNET_INET6(ip6_forward_srcrt)
196 #define V_ip6_forwarding                VNET_INET6(ip6_forwarding)
197 #define V_ip6_hdrnestlimit              VNET_INET6(ip6_hdrnestlimit)
198 #define V_ip6_keepfaith                 VNET_INET6(ip6_keepfaith)
199 #define V_ip6_log_interval              VNET_INET6(ip6_log_interval)
200 #define V_ip6_log_time                  VNET_INET6(ip6_log_time)
201 #define V_ip6_maxfragpackets            VNET_INET6(ip6_maxfragpackets)
202 #define V_ip6_maxfrags                  VNET_INET6(ip6_maxfrags)
203 #define V_ip6_mcast_pmtu                VNET_INET6(ip6_mcast_pmtu)
204 #define V_ip6_mrouter_ver               VNET_INET6(ip6_mrouter_ver)
205 #define V_ip6_opts                      VNET_INET6(ip6_opts)
206 #define V_ip6_ours_check_algorithm      VNET_INET6(ip6_ours_check_algorithm)
207 #define V_ip6_prefer_tempaddr           VNET_INET6(ip6_prefer_tempaddr)
208 #define V_ip6_rr_prune                  VNET_INET6(ip6_rr_prune)
209 #define V_ip6_sendredirects             VNET_INET6(ip6_sendredirects)
210 #define V_ip6_sourcecheck               VNET_INET6(ip6_sourcecheck)
211 #define V_ip6_sourcecheck_interval      VNET_INET6(ip6_sourcecheck_interval)
212 #define V_ip6_temp_preferred_lifetime   VNET_INET6(ip6_temp_preferred_lifetime)
213 #define V_ip6_temp_regen_advance        VNET_INET6(ip6_temp_regen_advance)
214 #define V_ip6_temp_valid_lifetime       VNET_INET6(ip6_temp_valid_lifetime)
215 #define V_ip6_use_defzone               VNET_INET6(ip6_use_defzone)
216 #define V_ip6_use_deprecated            VNET_INET6(ip6_use_deprecated)
217 #define V_ip6_use_tempaddr              VNET_INET6(ip6_use_tempaddr)
218 #define V_ip6_v6only                    VNET_INET6(ip6_v6only)
219 #define V_ip6q                          VNET_INET6(ip6q)
220 #define V_ip6qmaxlen                    VNET_INET6(ip6qmaxlen)
221 #define V_ip6stat                       VNET_INET6(ip6stat)
222 #define V_ip6stealth                    VNET_INET6(ip6stealth)
223 #define V_llinfo_nd6                    VNET_INET6(llinfo_nd6)
224 #define V_mrt6debug                     VNET_INET6(mrt6debug)
225 #define V_nd6_allocated                 VNET_INET6(nd6_allocated)
226 #define V_nd6_debug                     VNET_INET6(nd6_debug)
227 #define V_nd6_defifindex                VNET_INET6(nd6_defifindex)
228 #define V_nd6_defifp                    VNET_INET6(nd6_defifp)
229 #define V_nd6_delay                     VNET_INET6(nd6_delay)
230 #define V_nd6_gctimer                   VNET_INET6(nd6_gctimer)
231 #define V_nd6_inuse                     VNET_INET6(nd6_inuse)
232 #define V_nd6_maxndopt                  VNET_INET6(nd6_maxndopt)
233 #define V_nd6_maxnudhint                VNET_INET6(nd6_maxnudhint)
234 #define V_nd6_maxqueuelen               VNET_INET6(nd6_maxqueuelen)
235 #define V_nd6_mmaxtries                 VNET_INET6(nd6_mmaxtries)
236 #define V_nd6_onlink_ns_rfc4861         VNET_INET6(nd6_onlink_ns_rfc4861)
237 #define V_nd6_prune                     VNET_INET6(nd6_prune)
238 #define V_nd6_recalc_reachtm_interval   VNET_INET6(nd6_recalc_reachtm_interval)
239 #define V_nd6_slowtimo_ch               VNET_INET6(nd6_slowtimo_ch)
240 #define V_nd6_timer_ch                  VNET_INET6(nd6_timer_ch)
241 #define V_nd6_umaxtries                 VNET_INET6(nd6_umaxtries)
242 #define V_nd6_useloopback               VNET_INET6(nd6_useloopback)
243 #define V_nd_defrouter                  VNET_INET6(nd_defrouter)
244 #define V_nd_prefix                     VNET_INET6(nd_prefix)
245 #define V_pim6                          VNET_INET6(pim6)
246 #define V_pmtu_expire                   VNET_INET6(pmtu_expire)
247 #define V_pmtu_probe                    VNET_INET6(pmtu_probe)
248 #define V_rip6_recvspace                VNET_INET6(rip6_recvspace)
249 #define V_rip6_sendspace                VNET_INET6(rip6_sendspace)
250 #define V_rip6stat                      VNET_INET6(rip6stat)
251 #define V_rtq_minreallyold6             VNET_INET6(rtq_minreallyold6)
252 #define V_rtq_mtutimer                  VNET_INET6(rtq_mtutimer)
253 #define V_rtq_reallyold6                VNET_INET6(rtq_reallyold6)
254 #define V_rtq_timeout6                  VNET_INET6(rtq_timeout6)
255 #define V_rtq_timer6                    VNET_INET6(rtq_timer6)
256 #define V_rtq_toomany6                  VNET_INET6(rtq_toomany6)
257 #define V_sid_default                   VNET_INET6(sid_default)
258 #define V_udp6_recvspace                VNET_INET6(udp6_recvspace)      
259 #define V_udp6_sendspace                VNET_INET6(udp6_sendspace)
260
261 #endif /* !_NETINET6_VINET6_H_ */