]> git.saurik.com Git - apple/xnu.git/blame - bsd/netinet6/ip6_var.h
xnu-1699.22.81.tar.gz
[apple/xnu.git] / bsd / netinet6 / ip6_var.h
CommitLineData
b0d623f7 1/*
6d2010ae 2 * Copyright (c) 2000-2011 Apple Inc. All rights reserved.
b0d623f7
A
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
9bccf70c
A
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 $ */
1c79356b
A
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_
9bccf70c 98#include <sys/appleapiopts.h>
1c79356b 99
6d2010ae 100#ifdef XNU_KERNEL_PRIVATE
1c79356b
A
101/*
102 * IP6 reassembly queue structure. Each fragment
103 * being reassembled is attached to one of these structures.
104 */
105struct ip6q {
1c79356b
A
106 struct ip6asfrag *ip6q_down;
107 struct ip6asfrag *ip6q_up;
108 u_int32_t ip6q_ident;
6d2010ae
A
109 u_int8_t ip6q_nxt;
110 u_int8_t ip6q_ecn;
1c79356b 111 u_int8_t ip6q_ttl;
6d2010ae 112 struct in6_addr ip6q_src, ip6q_dst;
1c79356b
A
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
6d2010ae 119 int ip6q_nfrag; /* # of fragments */
1c79356b
A
120};
121
122struct ip6asfrag {
1c79356b
A
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
134struct ip6_moptions {
6d2010ae
A
135 decl_lck_mtx_data(, im6o_lock);
136 uint32_t im6o_refcnt; /* ref count */
137 uint32_t im6o_debug; /* see ifa_debug flags */
1c79356b
A
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 */
6d2010ae
A
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);
1c79356b
A
147};
148
6d2010ae
A
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
1c79356b
A
178/*
179 * Control options for outgoing packets
180 */
181
182/* Routing header related info */
183struct 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
6d2010ae
A
190/* Nexthop related info */
191struct 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
1c79356b 198struct ip6_pktopts {
9bccf70c 199 struct mbuf *ip6po_m; /* Pointer to mbuf storing the data */
1c79356b
A
200 int ip6po_hlim; /* Hoplimit for outgoing packets */
201
202 /* Outgoing IF/address information */
203 struct in6_pktinfo *ip6po_pktinfo;
204
6d2010ae
A
205 /* Next-hop address information */
206 struct ip6po_nhinfo ip6po_nhinfo;
207
1c79356b
A
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;
b0d623f7 218
6d2010ae
A
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 */
1c79356b
A
239};
240
241/*
242 * Control options for incoming packets
243 */
6d2010ae 244#endif /* XNU_KERNEL_PRIVATE */
1c79356b 245
1c79356b
A
246struct 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 */
6d2010ae 261 u_quad_t ip6s_fragmented; /* datagrams successfully fragmented */
1c79356b
A
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 */
1c79356b
A
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];
6d2010ae 300 /* number of times that a deprecated address is chosen */
1c79356b 301 u_quad_t ip6s_sources_deprecated[16];
9bccf70c
A
302
303 u_quad_t ip6s_forward_cachehit;
304 u_quad_t ip6s_forward_cachemiss;
6d2010ae
A
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 */
9bccf70c
A
311};
312
91447636 313#ifdef KERNEL_PRIVATE
9bccf70c
A
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 */
320struct 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 */
1c79356b
A
342};
343
1c79356b 344/* flags passed to ip6_output as last parameter */
6d2010ae 345#define IPV6_UNSPECSRC 0x01 /* allow :: as the source address */
1c79356b
A
346#define IPV6_FORWARDING 0x02 /* most of IPv6 header exists */
347#define IPV6_MINMTU 0x04 /* use minimum MTU (IPV6_USE_MIN_MTU) */
6d2010ae
A
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 */
360struct ip6_out_args {
361 unsigned int ip6oa_boundif; /* bound outgoing interface */
362 unsigned int ip6oa_nocell; /* don't use IFT_CELLULAR */
363};
1c79356b
A
364
365extern struct ip6stat ip6stat; /* statistics */
6d2010ae 366extern u_int32_t ip6_id; /* fragment identifier */
1c79356b
A
367extern int ip6_defhlim; /* default hop limit */
368extern int ip6_defmcasthlim; /* default multicast hop limit */
369extern int ip6_forwarding; /* act as router? */
370extern int ip6_forward_srcrt; /* forward src-routed? */
371extern int ip6_gif_hlim; /* Hop limit for gif encap packet */
372extern int ip6_use_deprecated; /* allow deprecated addr as source */
373extern int ip6_rr_prune; /* router renumbering prefix
374 * walk list every 5 sec. */
6d2010ae
A
375extern int ip6_mcast_pmtu; /* enable pMTU discovery for multicast? */
376#define ip6_mapped_addr_on (!ip6_v6only)
9bccf70c 377extern int ip6_v6only;
1c79356b 378
e2fac8b1
A
379extern int ip6_neighborgcthresh; /* Threshold # of NDP entries for GC */
380extern int ip6_maxifprefixes; /* Max acceptable prefixes via RA per IF */
381extern int ip6_maxifdefrouters; /* Max acceptable def routers via RA */
382extern int ip6_maxdynroutes; /* Max # of routes created via redirect */
0b4c1975 383#if MROUTING
1c79356b 384extern struct socket *ip6_mrouter; /* multicast routing daemon */
b7266188 385#endif
1c79356b 386extern int ip6_sendredirects; /* send IP redirects when forwarding? */
6d2010ae
A
387extern int ip6_maxfragpackets; /* Maximum packets in reassembly queue */
388extern int ip6_maxfrags; /* Maximum fragments in reassembly queue */
1c79356b
A
389extern int ip6_sourcecheck; /* Verify source interface */
390extern int ip6_sourcecheck_interval; /* Interval between log messages */
391extern int ip6_accept_rtadv; /* Acts as a host not a router */
392extern int ip6_keepfaith; /* Firewall Aided Internet Translator */
393extern int ip6_log_interval;
394extern time_t ip6_log_time;
395extern int ip6_hdrnestlimit; /* upper limit of # of extension headers */
396extern int ip6_dad_count; /* DupAddrDetectionTransmits */
6d2010ae 397extern int ip6_only_allow_rfc4193_prefix; /* RFC4193 Unique Local Unicast Prefixes only */
1c79356b
A
398
399extern u_int32_t ip6_flow_seq;
400extern int ip6_auto_flowlabel;
9bccf70c
A
401extern int ip6_auto_linklocal;
402
403extern int ip6_anonportmin; /* minimum ephemeral port */
404extern int ip6_anonportmax; /* maximum ephemeral port */
405extern int ip6_lowportmin; /* minimum reserved port */
406extern int ip6_lowportmax; /* maximum reserved port */
407
408extern int ip6_use_tempaddr; /* whether to use temporary addresses. */
6d2010ae
A
409extern int ip6_prefer_tempaddr; /* whether to prefer temporary addresses
410 in the source address selection */
411extern int ip6_use_defzone; /* whether to use the default scope zone
412 when unspecified */
1c79356b 413
1c79356b 414extern struct pr_usrreqs rip6_usrreqs;
2d21ac55 415extern struct pr_usrreqs icmp6_dgram_usrreqs;
6d2010ae
A
416
417extern int ip6_doscopedroute;
418
9bccf70c 419struct sockopt;
1c79356b
A
420
421struct inpcb;
1c79356b 422
2d21ac55
A
423int icmp6_ctloutput(struct socket *, struct sockopt *);
424int icmp6_dgram_ctloutput(struct socket *, struct sockopt *);
425int icmp6_dgram_send(struct socket *, int , struct mbuf *, struct sockaddr *, struct mbuf *, struct proc *);
426int icmp6_dgram_attach(struct socket *, int , struct proc *);
427
1c79356b 428
9bccf70c 429struct in6_ifaddr;
91447636 430void ip6_init(void);
6d2010ae 431void ip6_fin(void);
91447636
A
432void ip6_input(struct mbuf *);
433struct in6_ifaddr *ip6_getdstifaddr(struct mbuf *);
434void ip6_freepcbopts(struct ip6_pktopts *);
6d2010ae 435int ip6_unknown_opt(u_int8_t *, struct mbuf *, int);
91447636
A
436char * ip6_get_prevhdr(struct mbuf *, int);
437int ip6_nexthdr(struct mbuf *, int, int, int *);
438int ip6_lasthdr(struct mbuf *, int, int, int *);
439
6d2010ae
A
440extern void ip6_moptions_init(void);
441extern struct ip6_moptions *ip6_allocmoptions(int);
442extern void im6o_addref(struct ip6_moptions *, int);
443extern void im6o_remref(struct ip6_moptions *);
444
2d21ac55
A
445struct ip6aux *ip6_addaux(struct mbuf *);
446struct ip6aux *ip6_findaux(struct mbuf *);
91447636 447void ip6_delaux(struct mbuf *);
6d2010ae
A
448extern void ip6_destroyaux(struct ip6aux *);
449extern void ip6_copyaux(struct ip6aux *, struct ip6aux *);
91447636
A
450
451int ip6_mforward(struct ip6_hdr *, struct ifnet *, struct mbuf *);
452int ip6_process_hopopts(struct mbuf *, u_int8_t *, int, u_int32_t *,
453 u_int32_t *);
6d2010ae
A
454struct mbuf **ip6_savecontrol_v4(struct inpcb *, struct mbuf *,
455 struct mbuf **, int *);
456int ip6_savecontrol(struct inpcb *, struct mbuf *, struct mbuf **);
457void ip6_forward(struct mbuf *, struct route_in6 *, int);
458void ip6_notify_pmtu __P((struct inpcb *, struct sockaddr_in6 *,
459 u_int32_t *));
91447636 460void ip6_mloopback(struct ifnet *, struct mbuf *, struct sockaddr_in6 *);
6d2010ae
A
461int ip6_output(struct mbuf *, struct ip6_pktopts *, struct route_in6 *,
462 int, struct ip6_moptions *, struct ifnet **,
463 struct ip6_out_args *);
91447636 464int ip6_ctloutput(struct socket *, struct sockopt *sopt);
b0d623f7 465void ip6_initpktopts(struct ip6_pktopts *);
91447636 466int ip6_setpktoptions(struct mbuf *, struct ip6_pktopts *, int, int);
6d2010ae 467void ip6_clearpktopts(struct ip6_pktopts *, int);
91447636
A
468struct ip6_pktopts *ip6_copypktopts(struct ip6_pktopts *, int);
469int ip6_optlen(struct inpcb *);
470
6d2010ae 471int route6_input(struct mbuf **, int *, int);
91447636
A
472
473void frag6_init(void);
6d2010ae 474int frag6_input(struct mbuf **, int *, int);
91447636
A
475void frag6_slowtimo(void);
476void frag6_drain(void);
477
6d2010ae 478int rip6_input(struct mbuf **, int *, int);
91447636
A
479void rip6_ctlinput(int, struct sockaddr *, void *);
480int rip6_ctloutput(struct socket *so, struct sockopt *sopt);
6d2010ae
A
481int rip6_output(struct mbuf *, struct socket *, struct sockaddr_in6 *, struct mbuf *, int);
482
483int dest6_input(struct mbuf **, int *, int);
484extern 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 *);
487extern struct in6_addrpolicy *
488 in6_addrsel_lookup_policy(struct sockaddr_in6 *);
489int 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);
492int ip6_setpktopts(struct mbuf *control, struct ip6_pktopts *opt, struct ip6_pktopts *stickyopt, int uproto);
493u_int32_t ip6_randomid(void);
494u_int32_t ip6_randomflowlabel(void);
91447636 495
9bccf70c 496#endif /* KERNEL */
91447636 497#endif /* KERNEL_PRIVATE */
1c79356b
A
498
499#endif /* !_NETINET6_IP6_VAR_H_ */