]> git.saurik.com Git - apple/xnu.git/blob - bsd/netinet6/ip6_var.h
acb9c3857309956929105aafc644db74da801f4e
[apple/xnu.git] / bsd / netinet6 / ip6_var.h
1 /*
2 * Copyright (c) 2000-2011 Apple Inc. All rights reserved.
3 *
4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
14 *
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
17 *
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
25 *
26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27 */
28
29 /* $FreeBSD: src/sys/netinet6/ip6_var.h,v 1.2.2.2 2001/07/03 11:01:54 ume Exp $ */
30 /* $KAME: ip6_var.h,v 1.62 2001/05/03 14:51:48 itojun Exp $ */
31
32 /*
33 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
34 * All rights reserved.
35 *
36 * Redistribution and use in source and binary forms, with or without
37 * modification, are permitted provided that the following conditions
38 * are met:
39 * 1. Redistributions of source code must retain the above copyright
40 * notice, this list of conditions and the following disclaimer.
41 * 2. Redistributions in binary form must reproduce the above copyright
42 * notice, this list of conditions and the following disclaimer in the
43 * documentation and/or other materials provided with the distribution.
44 * 3. Neither the name of the project nor the names of its contributors
45 * may be used to endorse or promote products derived from this software
46 * without specific prior written permission.
47 *
48 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
49 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
50 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
51 * ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
52 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
53 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
54 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
55 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
56 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
57 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
58 * SUCH DAMAGE.
59 */
60
61 /*
62 * Copyright (c) 1982, 1986, 1993
63 * The Regents of the University of California. All rights reserved.
64 *
65 * Redistribution and use in source and binary forms, with or without
66 * modification, are permitted provided that the following conditions
67 * are met:
68 * 1. Redistributions of source code must retain the above copyright
69 * notice, this list of conditions and the following disclaimer.
70 * 2. Redistributions in binary form must reproduce the above copyright
71 * notice, this list of conditions and the following disclaimer in the
72 * documentation and/or other materials provided with the distribution.
73 * 3. All advertising materials mentioning features or use of this software
74 * must display the following acknowledgement:
75 * This product includes software developed by the University of
76 * California, Berkeley and its contributors.
77 * 4. Neither the name of the University nor the names of its contributors
78 * may be used to endorse or promote products derived from this software
79 * without specific prior written permission.
80 *
81 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
82 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
83 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
84 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
85 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
86 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
87 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
88 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
89 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
90 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
91 * SUCH DAMAGE.
92 *
93 * @(#)ip_var.h 8.1 (Berkeley) 6/10/93
94 */
95
96 #ifndef _NETINET6_IP6_VAR_H_
97 #define _NETINET6_IP6_VAR_H_
98 #include <sys/appleapiopts.h>
99
100 #ifdef XNU_KERNEL_PRIVATE
101 /*
102 * IP6 reassembly queue structure. Each fragment
103 * being reassembled is attached to one of these structures.
104 */
105 struct ip6q {
106 struct ip6asfrag *ip6q_down;
107 struct ip6asfrag *ip6q_up;
108 u_int32_t ip6q_ident;
109 u_int8_t ip6q_nxt;
110 u_int8_t ip6q_ecn;
111 u_int8_t ip6q_ttl;
112 struct in6_addr ip6q_src, ip6q_dst;
113 struct ip6q *ip6q_next;
114 struct ip6q *ip6q_prev;
115 int ip6q_unfrglen; /* len of unfragmentable part */
116 #if notyet
117 u_char *ip6q_nxtp;
118 #endif
119 int ip6q_nfrag; /* # of fragments */
120 };
121
122 struct ip6asfrag {
123 struct ip6asfrag *ip6af_down;
124 struct ip6asfrag *ip6af_up;
125 struct mbuf *ip6af_m;
126 int ip6af_offset; /* offset in ip6af_m to next header */
127 int ip6af_frglen; /* fragmentable part length */
128 int ip6af_off; /* fragment offset */
129 u_int16_t ip6af_mff; /* more fragment bit in frag off */
130 };
131
132 #define IP6_REASS_MBUF(ip6af) (*(struct mbuf **)&((ip6af)->ip6af_m))
133
134 struct ip6_moptions {
135 decl_lck_mtx_data(, im6o_lock);
136 uint32_t im6o_refcnt; /* ref count */
137 uint32_t im6o_debug; /* see ifa_debug flags */
138 struct ifnet *im6o_multicast_ifp; /* ifp for outgoing multicasts */
139 u_char im6o_multicast_hlim; /* hoplimit for outgoing multicasts */
140 u_char im6o_multicast_loop; /* 1 >= hear sends if a member */
141 u_short im6o_num_memberships; /* no. memberships this socket */
142 u_short im6o_max_memberships; /* max memberships this socket */
143 struct in6_multi **im6o_membership; /* group memberships */
144 struct in6_mfilter *im6o_mfilters; /* source filters */
145 void (*im6o_trace) /* callback fn for tracing refs */
146 (struct ip6_moptions *, int);
147 };
148
149 #define IM6O_LOCK_ASSERT_HELD(_im6o) \
150 lck_mtx_assert(&(_im6o)->im6o_lock, LCK_MTX_ASSERT_OWNED)
151
152 #define IM6O_LOCK_ASSERT_NOTHELD(_im6o) \
153 lck_mtx_assert(&(_im6o)->im6o_lock, LCK_MTX_ASSERT_NOTOWNED)
154
155 #define IM6O_LOCK(_im6o) \
156 lck_mtx_lock(&(_im6o)->im6o_lock)
157
158 #define IM6O_LOCK_SPIN(_im6o) \
159 lck_mtx_lock_spin(&(_im6o)->im6o_lock)
160
161 #define IM6O_CONVERT_LOCK(_im6o) do { \
162 IM6O_LOCK_ASSERT_HELD(_im6o); \
163 lck_mtx_convert_spin(&(_im6o)->im6o_lock); \
164 } while (0)
165
166 #define IM6O_UNLOCK(_im6o) \
167 lck_mtx_unlock(&(_im6o)->im6o_lock)
168
169 #define IM6O_ADDREF(_im6o) \
170 im6o_addref(_im6o, 0)
171
172 #define IM6O_ADDREF_LOCKED(_im6o) \
173 im6o_addref(_im6o, 1)
174
175 #define IM6O_REMREF(_im6o) \
176 im6o_remref(_im6o)
177
178 /*
179 * Control options for outgoing packets
180 */
181
182 /* Routing header related info */
183 struct ip6po_rhinfo {
184 struct ip6_rthdr *ip6po_rhi_rthdr; /* Routing header */
185 struct route_in6 ip6po_rhi_route; /* Route to the 1st hop */
186 };
187 #define ip6po_rthdr ip6po_rhinfo.ip6po_rhi_rthdr
188 #define ip6po_route ip6po_rhinfo.ip6po_rhi_route
189
190 /* Nexthop related info */
191 struct ip6po_nhinfo {
192 struct sockaddr *ip6po_nhi_nexthop;
193 struct route_in6 ip6po_nhi_route; /* Route to the nexthop */
194 };
195 #define ip6po_nexthop ip6po_nhinfo.ip6po_nhi_nexthop
196 #define ip6po_nextroute ip6po_nhinfo.ip6po_nhi_route
197
198 struct ip6_pktopts {
199 struct mbuf *ip6po_m; /* Pointer to mbuf storing the data */
200 int ip6po_hlim; /* Hoplimit for outgoing packets */
201
202 /* Outgoing IF/address information */
203 struct in6_pktinfo *ip6po_pktinfo;
204
205 /* Next-hop address information */
206 struct ip6po_nhinfo ip6po_nhinfo;
207
208 struct ip6_hbh *ip6po_hbh; /* Hop-by-Hop options header */
209
210 /* Destination options header (before a routing header) */
211 struct ip6_dest *ip6po_dest1;
212
213 /* Routing header related info. */
214 struct ip6po_rhinfo ip6po_rhinfo;
215
216 /* Destination options header (after a routing header) */
217 struct ip6_dest *ip6po_dest2;
218
219 int ip6po_tclass; /* traffic class */
220
221 int ip6po_minmtu; /* fragment vs PMTU discovery policy */
222 #define IP6PO_MINMTU_MCASTONLY -1 /* default; send at min MTU for multicast*/
223 #define IP6PO_MINMTU_DISABLE 0 /* always perform pmtu disc */
224 #define IP6PO_MINMTU_ALL 1 /* always send at min MTU */
225
226 int ip6po_prefer_tempaddr; /* whether temporary addresses are
227 preferred as source address */
228 #define IP6PO_TEMPADDR_SYSTEM -1 /* follow the system default */
229 #define IP6PO_TEMPADDR_NOTPREFER 0 /* not prefer temporary address */
230 #define IP6PO_TEMPADDR_PREFER 1 /* prefer temporary address */
231
232 int ip6po_flags;
233 #if 0 /* parameters in this block is obsolete. do not reuse the values. */
234 #define IP6PO_REACHCONF 0x01 /* upper-layer reachability confirmation. */
235 #define IP6PO_MINMTU 0x02 /* use minimum MTU (IPV6_USE_MIN_MTU) */
236 #endif
237 #define IP6PO_DONTFRAG 0x04 /* disable fragmentation (IPV6_DONTFRAG) */
238 #define IP6PO_USECOA 0x08 /* use care of address */
239 };
240
241 /*
242 * Control options for incoming packets
243 */
244 #endif /* XNU_KERNEL_PRIVATE */
245
246 struct ip6stat {
247 u_quad_t ip6s_total; /* total packets received */
248 u_quad_t ip6s_tooshort; /* packet too short */
249 u_quad_t ip6s_toosmall; /* not enough data */
250 u_quad_t ip6s_fragments; /* fragments received */
251 u_quad_t ip6s_fragdropped; /* frags dropped(dups, out of space) */
252 u_quad_t ip6s_fragtimeout; /* fragments timed out */
253 u_quad_t ip6s_fragoverflow; /* fragments that exceeded limit */
254 u_quad_t ip6s_forward; /* packets forwarded */
255 u_quad_t ip6s_cantforward; /* packets rcvd for unreachable dest */
256 u_quad_t ip6s_redirectsent; /* packets forwarded on same net */
257 u_quad_t ip6s_delivered; /* datagrams delivered to upper level*/
258 u_quad_t ip6s_localout; /* total ip packets generated here */
259 u_quad_t ip6s_odropped; /* lost packets due to nobufs, etc. */
260 u_quad_t ip6s_reassembled; /* total packets reassembled ok */
261 u_quad_t ip6s_fragmented; /* datagrams successfully fragmented */
262 u_quad_t ip6s_ofragments; /* output fragments created */
263 u_quad_t ip6s_cantfrag; /* don't fragment flag was set, etc. */
264 u_quad_t ip6s_badoptions; /* error in option processing */
265 u_quad_t ip6s_noroute; /* packets discarded due to no route */
266 u_quad_t ip6s_badvers; /* ip6 version != 6 */
267 u_quad_t ip6s_rawout; /* total raw ip packets generated */
268 u_quad_t ip6s_badscope; /* scope error */
269 u_quad_t ip6s_notmember; /* don't join this multicast group */
270 u_quad_t ip6s_nxthist[256]; /* next header history */
271 u_quad_t ip6s_m1; /* one mbuf */
272 u_quad_t ip6s_m2m[32]; /* two or more mbuf */
273 u_quad_t ip6s_mext1; /* one ext mbuf */
274 u_quad_t ip6s_mext2m; /* two or more ext mbuf */
275 u_quad_t ip6s_exthdrtoolong; /* ext hdr are not continuous */
276 u_quad_t ip6s_nogif; /* no match gif found */
277 u_quad_t ip6s_toomanyhdr; /* discarded due to too many headers */
278
279 /*
280 * statistics for improvement of the source address selection
281 * algorithm:
282 * XXX: hardcoded 16 = # of ip6 multicast scope types + 1
283 */
284 /* number of times that address selection fails */
285 u_quad_t ip6s_sources_none;
286 /* number of times that an address on the outgoing I/F is chosen */
287 u_quad_t ip6s_sources_sameif[16];
288 /* number of times that an address on a non-outgoing I/F is chosen */
289 u_quad_t ip6s_sources_otherif[16];
290 /*
291 * number of times that an address that has the same scope
292 * from the destination is chosen.
293 */
294 u_quad_t ip6s_sources_samescope[16];
295 /*
296 * number of times that an address that has a different scope
297 * from the destination is chosen.
298 */
299 u_quad_t ip6s_sources_otherscope[16];
300 /* number of times that a deprecated address is chosen */
301 u_quad_t ip6s_sources_deprecated[16];
302
303 u_quad_t ip6s_forward_cachehit;
304 u_quad_t ip6s_forward_cachemiss;
305
306 /* number of times that each rule of source selection is applied. */
307 u_quad_t ip6s_sources_rule[16];
308 #ifdef PRIVATE
309 u_quad_t ip6s_pktdropcntrl; /* pkt dropped, no mbufs for control data */
310 #endif /* PRIVATE */
311 };
312
313 #ifdef KERNEL_PRIVATE
314 #ifdef KERNEL
315 /*
316 * IPv6 onion peeling state.
317 * it will be initialized when we come into ip6_input().
318 * XXX do not make it a kitchen sink!
319 */
320 struct ip6aux {
321 u_int32_t ip6a_flags;
322 #define IP6A_SWAP 0x01 /* swapped home/care-of on packet */
323 #define IP6A_HASEEN 0x02 /* HA was present */
324 #define IP6A_BRUID 0x04 /* BR Unique Identifier was present */
325 #define IP6A_RTALERTSEEN 0x08 /* rtalert present */
326
327 /* ip6.ip6_src */
328 struct in6_addr ip6a_careof; /* care-of address of the peer */
329 struct in6_addr ip6a_home; /* home address of the peer */
330 u_int16_t ip6a_bruid; /* BR unique identifier */
331
332 /* ip6.ip6_dst */
333 struct in6_ifaddr *ip6a_dstia6; /* my ifaddr that matches ip6_dst */
334
335 /* rtalert */
336 u_int16_t ip6a_rtalert; /* rtalert option value */
337
338 /*
339 * decapsulation history will be here.
340 * with IPsec it may not be accurate.
341 */
342 };
343
344 /* flags passed to ip6_output as last parameter */
345 #define IPV6_UNSPECSRC 0x01 /* allow :: as the source address */
346 #define IPV6_FORWARDING 0x02 /* most of IPv6 header exists */
347 #define IPV6_MINMTU 0x04 /* use minimum MTU (IPV6_USE_MIN_MTU) */
348 #define IPV6_FLAG_NOSRCIFSEL 0x80 /* bypas source address selection */
349 #define IPV6_OUTARGS 0x100 /* has ancillary output info */
350
351 #ifdef __NO_STRICT_ALIGNMENT
352 #define IP6_HDR_ALIGNED_P(ip) 1
353 #else
354 #define IP6_HDR_ALIGNED_P(ip) ((((intptr_t) (ip)) & 3) == 0)
355 #endif
356
357 /*
358 * Extra information passed to ip6_output when IP6_OUTARGS is set.
359 */
360 struct ip6_out_args {
361 unsigned int ip6oa_boundif; /* bound outgoing interface */
362 unsigned int ip6oa_nocell; /* don't use IFT_CELLULAR */
363 };
364
365 extern struct ip6stat ip6stat; /* statistics */
366 extern u_int32_t ip6_id; /* fragment identifier */
367 extern int ip6_defhlim; /* default hop limit */
368 extern int ip6_defmcasthlim; /* default multicast hop limit */
369 extern int ip6_forwarding; /* act as router? */
370 extern int ip6_forward_srcrt; /* forward src-routed? */
371 extern int ip6_gif_hlim; /* Hop limit for gif encap packet */
372 extern int ip6_use_deprecated; /* allow deprecated addr as source */
373 extern int ip6_rr_prune; /* router renumbering prefix
374 * walk list every 5 sec. */
375 extern int ip6_mcast_pmtu; /* enable pMTU discovery for multicast? */
376 #define ip6_mapped_addr_on (!ip6_v6only)
377 extern int ip6_v6only;
378
379 extern int ip6_neighborgcthresh; /* Threshold # of NDP entries for GC */
380 extern int ip6_maxifprefixes; /* Max acceptable prefixes via RA per IF */
381 extern int ip6_maxifdefrouters; /* Max acceptable def routers via RA */
382 extern int ip6_maxdynroutes; /* Max # of routes created via redirect */
383 #if MROUTING
384 extern struct socket *ip6_mrouter; /* multicast routing daemon */
385 #endif
386 extern int ip6_sendredirects; /* send IP redirects when forwarding? */
387 extern int ip6_maxfragpackets; /* Maximum packets in reassembly queue */
388 extern int ip6_maxfrags; /* Maximum fragments in reassembly queue */
389 extern int ip6_sourcecheck; /* Verify source interface */
390 extern int ip6_sourcecheck_interval; /* Interval between log messages */
391 extern int ip6_accept_rtadv; /* Acts as a host not a router */
392 extern int ip6_keepfaith; /* Firewall Aided Internet Translator */
393 extern int ip6_log_interval;
394 extern time_t ip6_log_time;
395 extern int ip6_hdrnestlimit; /* upper limit of # of extension headers */
396 extern int ip6_dad_count; /* DupAddrDetectionTransmits */
397 extern int ip6_only_allow_rfc4193_prefix; /* RFC4193 Unique Local Unicast Prefixes only */
398
399 extern u_int32_t ip6_flow_seq;
400 extern int ip6_auto_flowlabel;
401 extern int ip6_auto_linklocal;
402
403 extern int ip6_anonportmin; /* minimum ephemeral port */
404 extern int ip6_anonportmax; /* maximum ephemeral port */
405 extern int ip6_lowportmin; /* minimum reserved port */
406 extern int ip6_lowportmax; /* maximum reserved port */
407
408 extern int ip6_use_tempaddr; /* whether to use temporary addresses. */
409 extern int ip6_prefer_tempaddr; /* whether to prefer temporary addresses
410 in the source address selection */
411 extern int ip6_use_defzone; /* whether to use the default scope zone
412 when unspecified */
413
414 extern struct pr_usrreqs rip6_usrreqs;
415 extern struct pr_usrreqs icmp6_dgram_usrreqs;
416
417 extern int ip6_doscopedroute;
418
419 struct sockopt;
420
421 struct inpcb;
422
423 int icmp6_ctloutput(struct socket *, struct sockopt *);
424 int icmp6_dgram_ctloutput(struct socket *, struct sockopt *);
425 int icmp6_dgram_send(struct socket *, int , struct mbuf *, struct sockaddr *, struct mbuf *, struct proc *);
426 int icmp6_dgram_attach(struct socket *, int , struct proc *);
427
428
429 struct in6_ifaddr;
430 void ip6_init(void);
431 void ip6_fin(void);
432 void ip6_input(struct mbuf *);
433 struct in6_ifaddr *ip6_getdstifaddr(struct mbuf *);
434 void ip6_freepcbopts(struct ip6_pktopts *);
435 int ip6_unknown_opt(u_int8_t *, struct mbuf *, int);
436 char * ip6_get_prevhdr(struct mbuf *, int);
437 int ip6_nexthdr(struct mbuf *, int, int, int *);
438 int ip6_lasthdr(struct mbuf *, int, int, int *);
439
440 extern void ip6_moptions_init(void);
441 extern struct ip6_moptions *ip6_allocmoptions(int);
442 extern void im6o_addref(struct ip6_moptions *, int);
443 extern void im6o_remref(struct ip6_moptions *);
444
445 struct ip6aux *ip6_addaux(struct mbuf *);
446 struct ip6aux *ip6_findaux(struct mbuf *);
447 void ip6_delaux(struct mbuf *);
448 extern void ip6_destroyaux(struct ip6aux *);
449 extern void ip6_copyaux(struct ip6aux *, struct ip6aux *);
450
451 int ip6_mforward(struct ip6_hdr *, struct ifnet *, struct mbuf *);
452 int ip6_process_hopopts(struct mbuf *, u_int8_t *, int, u_int32_t *,
453 u_int32_t *);
454 struct mbuf **ip6_savecontrol_v4(struct inpcb *, struct mbuf *,
455 struct mbuf **, int *);
456 int ip6_savecontrol(struct inpcb *, struct mbuf *, struct mbuf **);
457 void ip6_forward(struct mbuf *, struct route_in6 *, int);
458 void ip6_notify_pmtu __P((struct inpcb *, struct sockaddr_in6 *,
459 u_int32_t *));
460 void ip6_mloopback(struct ifnet *, struct mbuf *, struct sockaddr_in6 *);
461 int ip6_output(struct mbuf *, struct ip6_pktopts *, struct route_in6 *,
462 int, struct ip6_moptions *, struct ifnet **,
463 struct ip6_out_args *);
464 int ip6_ctloutput(struct socket *, struct sockopt *sopt);
465 void ip6_initpktopts(struct ip6_pktopts *);
466 int ip6_setpktoptions(struct mbuf *, struct ip6_pktopts *, int, int);
467 void ip6_clearpktopts(struct ip6_pktopts *, int);
468 struct ip6_pktopts *ip6_copypktopts(struct ip6_pktopts *, int);
469 int ip6_optlen(struct inpcb *);
470
471 int route6_input(struct mbuf **, int *, int);
472
473 void frag6_init(void);
474 int frag6_input(struct mbuf **, int *, int);
475 void frag6_slowtimo(void);
476 void frag6_drain(void);
477
478 int rip6_input(struct mbuf **, int *, int);
479 void rip6_ctlinput(int, struct sockaddr *, void *);
480 int rip6_ctloutput(struct socket *so, struct sockopt *sopt);
481 int rip6_output(struct mbuf *, struct socket *, struct sockaddr_in6 *, struct mbuf *, int);
482
483 int dest6_input(struct mbuf **, int *, int);
484 extern struct in6_addr *in6_selectsrc(struct sockaddr_in6 *,
485 struct ip6_pktopts *, struct inpcb *, struct route_in6 *,
486 struct ifnet **, struct in6_addr *, unsigned int, int *);
487 extern struct in6_addrpolicy *
488 in6_addrsel_lookup_policy(struct sockaddr_in6 *);
489 int in6_selectroute(struct sockaddr_in6 *, struct sockaddr_in6 *,
490 struct ip6_pktopts *, struct ip6_moptions *, struct route_in6 *,
491 struct ifnet **, struct rtentry **, int, unsigned int, unsigned int);
492 int ip6_setpktopts(struct mbuf *control, struct ip6_pktopts *opt, struct ip6_pktopts *stickyopt, int uproto);
493 u_int32_t ip6_randomid(void);
494 u_int32_t ip6_randomflowlabel(void);
495
496 #endif /* KERNEL */
497 #endif /* KERNEL_PRIVATE */
498
499 #endif /* !_NETINET6_IP6_VAR_H_ */