ip6_var.h revision 195727
1119418Sobrien/*-
251694Sroger * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
351694Sroger * All rights reserved.
451694Sroger *
551694Sroger * Redistribution and use in source and binary forms, with or without
651694Sroger * modification, are permitted provided that the following conditions
751694Sroger * are met:
851694Sroger * 1. Redistributions of source code must retain the above copyright
951694Sroger *    notice, this list of conditions and the following disclaimer.
1051694Sroger * 2. Redistributions in binary form must reproduce the above copyright
1151694Sroger *    notice, this list of conditions and the following disclaimer in the
1251694Sroger *    documentation and/or other materials provided with the distribution.
1351694Sroger * 3. Neither the name of the project nor the names of its contributors
1451694Sroger *    may be used to endorse or promote products derived from this software
1551694Sroger *    without specific prior written permission.
1651694Sroger *
1751694Sroger * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
1851694Sroger * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1951694Sroger * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2051694Sroger * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
2151694Sroger * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2251694Sroger * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2351694Sroger * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2451694Sroger * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2551694Sroger * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2651694Sroger * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2751694Sroger * SUCH DAMAGE.
2851694Sroger *
2951694Sroger *	$KAME: ip6_var.h,v 1.62 2001/05/03 14:51:48 itojun Exp $
3051694Sroger */
3151694Sroger
3251694Sroger/*-
3351694Sroger * Copyright (c) 1982, 1986, 1993
34119418Sobrien *	The Regents of the University of California.  All rights reserved.
35119418Sobrien *
3651694Sroger * Redistribution and use in source and binary forms, with or without
37119418Sobrien * modification, are permitted provided that the following conditions
38119418Sobrien * are met:
39119418Sobrien * 1. Redistributions of source code must retain the above copyright
40119418Sobrien *    notice, this list of conditions and the following disclaimer.
41119418Sobrien * 2. Redistributions in binary form must reproduce the above copyright
42119418Sobrien *    notice, this list of conditions and the following disclaimer in the
43119418Sobrien *    documentation and/or other materials provided with the distribution.
44119418Sobrien * 4. Neither the name of the University nor the names of its contributors
45119418Sobrien *    may be used to endorse or promote products derived from this software
46119418Sobrien *    without specific prior written permission.
47119418Sobrien *
48119418Sobrien * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
4959014Sroger * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
5051694Sroger * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
5151694Sroger * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
5251694Sroger * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
5351694Sroger * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
5462214Sroger * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
5562214Sroger * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
5662214Sroger * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
5762214Sroger * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
5862214Sroger * SUCH DAMAGE.
5962214Sroger *
6051694Sroger *	@(#)ip_var.h	8.1 (Berkeley) 6/10/93
6151694Sroger * $FreeBSD: head/sys/netinet6/ip6_var.h 195727 2009-07-16 21:13:04Z rwatson $
6251694Sroger */
6351694Sroger
6451694Sroger#ifndef _NETINET6_IP6_VAR_H_
6551694Sroger#define _NETINET6_IP6_VAR_H_
6651694Sroger
6751694Sroger/*
6870834Swollman * IP6 reassembly queue structure.  Each fragment
6970834Swollman * being reassembled is attached to one of these structures.
7070834Swollman */
7151694Srogerstruct	ip6q {
7270834Swollman	struct ip6asfrag *ip6q_down;
7351694Sroger	struct ip6asfrag *ip6q_up;
7451694Sroger	u_int32_t	ip6q_ident;
7551694Sroger	u_int8_t	ip6q_nxt;
7651694Sroger	u_int8_t	ip6q_ecn;
7751694Sroger	u_int8_t	ip6q_ttl;
7851694Sroger	struct in6_addr ip6q_src, ip6q_dst;
7951694Sroger	struct ip6q	*ip6q_next;
8093023Snsouch	struct ip6q	*ip6q_prev;
8151694Sroger	int		ip6q_unfrglen;	/* len of unfragmentable part */
8251694Sroger#ifdef notyet
8351694Sroger	u_char		*ip6q_nxtp;
8459014Sroger#endif
8559014Sroger	int		ip6q_nfrag;	/* # of fragments */
8659014Sroger	struct label	*ip6q_label;
8759014Sroger};
8859014Sroger
8959014Srogerstruct	ip6asfrag {
9051694Sroger	struct ip6asfrag *ip6af_down;
9151694Sroger	struct ip6asfrag *ip6af_up;
9251694Sroger	struct mbuf	*ip6af_m;
9351694Sroger	int		ip6af_offset;	/* offset in ip6af_m to next header */
9451694Sroger	int		ip6af_frglen;	/* fragmentable part length */
9567306Sroger	int		ip6af_off;	/* fragment offset */
9667306Sroger	u_int16_t	ip6af_mff;	/* more fragment bit in frag off */
9751694Sroger};
9851694Sroger
99119277Simp#define IP6_REASS_MBUF(ip6af) (*(struct mbuf **)&((ip6af)->ip6af_m))
100119277Simp
101119277Simp/*
102119277Simp * Structure attached to inpcb.in6p_moptions and
10351694Sroger * passed to ip6_output when IPv6 multicast options are in use.
10451694Sroger * This structure is lazy-allocated.
10551694Sroger */
10651694Srogerstruct ip6_moptions {
10751694Sroger	struct	ifnet *im6o_multicast_ifp; /* ifp for outgoing multicasts */
10851694Sroger	u_char	im6o_multicast_hlim;	/* hoplimit for outgoing multicasts */
10959014Sroger	u_char	im6o_multicast_loop;	/* 1 >= hear sends if a member */
110118819Salex	u_short	im6o_num_memberships;	/* no. memberships this socket */
111118819Salex	u_short	im6o_max_memberships;	/* max memberships this socket */
112118819Salex	struct	in6_multi **im6o_membership;	/* group memberships */
113118819Salex	struct	in6_mfilter *im6o_mfilters;	/* source filters */
114118819Salex};
115118819Salex
11651694Sroger/*
11751694Sroger * Control options for outgoing packets
11851694Sroger */
11951694Sroger
12051694Sroger/* Routing header related info */
12151694Srogerstruct	ip6po_rhinfo {
12259014Sroger	struct	ip6_rthdr *ip6po_rhi_rthdr; /* Routing header */
123118819Salex	struct	route_in6 ip6po_rhi_route; /* Route to the 1st hop */
124118819Salex};
125118819Salex#define ip6po_rthdr	ip6po_rhinfo.ip6po_rhi_rthdr
126118819Salex#define ip6po_route	ip6po_rhinfo.ip6po_rhi_route
127118819Salex
12851694Sroger/* Nexthop related info */
12962214Srogerstruct	ip6po_nhinfo {
13051694Sroger	struct	sockaddr *ip6po_nhi_nexthop;
13162214Sroger	struct	route_in6 ip6po_nhi_route; /* Route to the nexthop */
13262214Sroger};
13351694Sroger#define ip6po_nexthop	ip6po_nhinfo.ip6po_nhi_nexthop
13451694Sroger#define ip6po_nextroute	ip6po_nhinfo.ip6po_nhi_route
13551694Sroger
13651694Srogerstruct	ip6_pktopts {
13751694Sroger	struct	mbuf *ip6po_m;	/* Pointer to mbuf storing the data */
13851694Sroger	int	ip6po_hlim;	/* Hoplimit for outgoing packets */
13951694Sroger
14051694Sroger	/* Outgoing IF/address information */
14151694Sroger	struct	in6_pktinfo *ip6po_pktinfo;
14251694Sroger
14351694Sroger	/* Next-hop address information */
14462214Sroger	struct	ip6po_nhinfo ip6po_nhinfo;
14562214Sroger
14662214Sroger	struct	ip6_hbh *ip6po_hbh; /* Hop-by-Hop options header */
14762214Sroger
14862214Sroger	/* Destination options header (before a routing header) */
14962214Sroger	struct	ip6_dest *ip6po_dest1;
15062214Sroger
15162214Sroger	/* Routing header related info. */
15262214Sroger	struct	ip6po_rhinfo ip6po_rhinfo;
15362214Sroger
15462214Sroger	/* Destination options header (after a routing header) */
15562214Sroger	struct	ip6_dest *ip6po_dest2;
15662214Sroger
15762214Sroger	int	ip6po_tclass;	/* traffic class */
15862214Sroger
15962214Sroger	int	ip6po_minmtu;  /* fragment vs PMTU discovery policy */
16062214Sroger#define IP6PO_MINMTU_MCASTONLY	-1 /* default; send at min MTU for multicast*/
16162214Sroger#define IP6PO_MINMTU_DISABLE	 0 /* always perform pmtu disc */
16262214Sroger#define IP6PO_MINMTU_ALL	 1 /* always send at min MTU */
16362214Sroger
16459014Sroger	int	ip6po_prefer_tempaddr;  /* whether temporary addresses are
16559014Sroger					   preferred as source address */
16659014Sroger#define IP6PO_TEMPADDR_SYSTEM	-1 /* follow the system default */
16759014Sroger#define IP6PO_TEMPADDR_NOTPREFER 0 /* not prefer temporary address */
16859014Sroger#define IP6PO_TEMPADDR_PREFER	 1 /* prefer temporary address */
16959014Sroger
17059014Sroger	int ip6po_flags;
17159014Sroger#if 0	/* parameters in this block is obsolete. do not reuse the values. */
17259014Sroger#define IP6PO_REACHCONF	0x01	/* upper-layer reachability confirmation. */
17359014Sroger#define IP6PO_MINMTU	0x02	/* use minimum MTU (IPV6_USE_MIN_MTU) */
17459014Sroger#endif
17559014Sroger#define IP6PO_DONTFRAG	0x04	/* disable fragmentation (IPV6_DONTFRAG) */
17651694Sroger#define IP6PO_USECOA	0x08	/* use care of address */
17751694Sroger};
17851694Sroger
17962214Sroger/*
18062214Sroger * Control options for incoming packets
18162214Sroger */
18262214Sroger
18362214Srogerstruct	ip6stat {
18462214Sroger	u_quad_t ip6s_total;		/* total packets received */
18562214Sroger	u_quad_t ip6s_tooshort;		/* packet too short */
18662214Sroger	u_quad_t ip6s_toosmall;		/* not enough data */
18762214Sroger	u_quad_t ip6s_fragments;	/* fragments received */
18862214Sroger	u_quad_t ip6s_fragdropped;	/* frags dropped(dups, out of space) */
18962214Sroger	u_quad_t ip6s_fragtimeout;	/* fragments timed out */
19062214Sroger	u_quad_t ip6s_fragoverflow;	/* fragments that exceeded limit */
19162214Sroger	u_quad_t ip6s_forward;		/* packets forwarded */
19262214Sroger	u_quad_t ip6s_cantforward;	/* packets rcvd for unreachable dest */
19362214Sroger	u_quad_t ip6s_redirectsent;	/* packets forwarded on same net */
19462214Sroger	u_quad_t ip6s_delivered;	/* datagrams delivered to upper level*/
19562214Sroger	u_quad_t ip6s_localout;		/* total ip packets generated here */
19693023Snsouch	u_quad_t ip6s_odropped;		/* lost packets due to nobufs, etc. */
19765692Sroger	u_quad_t ip6s_reassembled;	/* total packets reassembled ok */
19865392Speter	u_quad_t ip6s_fragmented;	/* datagrams successfully fragmented */
19993023Snsouch	u_quad_t ip6s_ofragments;	/* output fragments created */
20093023Snsouch	u_quad_t ip6s_cantfrag;		/* don't fragment flag was set, etc. */
20193023Snsouch	u_quad_t ip6s_badoptions;	/* error in option processing */
20262214Sroger	u_quad_t ip6s_noroute;		/* packets discarded due to no route */
20365392Speter	u_quad_t ip6s_badvers;		/* ip6 version != 6 */
20451694Sroger	u_quad_t ip6s_rawout;		/* total raw ip packets generated */
20562214Sroger	u_quad_t ip6s_badscope;		/* scope error */
20651694Sroger	u_quad_t ip6s_notmember;	/* don't join this multicast group */
20751694Sroger	u_quad_t ip6s_nxthist[256];	/* next header history */
20851694Sroger	u_quad_t ip6s_m1;		/* one mbuf */
20951694Sroger	u_quad_t ip6s_m2m[32];		/* two or more mbuf */
21051694Sroger	u_quad_t ip6s_mext1;		/* one ext mbuf */
21151694Sroger	u_quad_t ip6s_mext2m;		/* two or more ext mbuf */
21251694Sroger	u_quad_t ip6s_exthdrtoolong;	/* ext hdr are not continuous */
21351694Sroger	u_quad_t ip6s_nogif;		/* no match gif found */
21451694Sroger	u_quad_t ip6s_toomanyhdr;	/* discarded due to too many headers */
21551694Sroger
21651694Sroger	/*
21751694Sroger	 * statistics for improvement of the source address selection
21851694Sroger	 * algorithm:
21951694Sroger	 * XXX: hardcoded 16 = # of ip6 multicast scope types + 1
22051694Sroger	 */
22151694Sroger	/* number of times that address selection fails */
22251694Sroger	u_quad_t ip6s_sources_none;
22351694Sroger	/* number of times that an address on the outgoing I/F is chosen */
22493023Snsouch	u_quad_t ip6s_sources_sameif[16];
22593023Snsouch	/* number of times that an address on a non-outgoing I/F is chosen */
22693023Snsouch	u_quad_t ip6s_sources_otherif[16];
22793023Snsouch	/*
22893023Snsouch	 * number of times that an address that has the same scope
22993023Snsouch	 * from the destination is chosen.
23093023Snsouch	 */
23193023Snsouch	u_quad_t ip6s_sources_samescope[16];
23293023Snsouch	/*
23393023Snsouch	 * number of times that an address that has a different scope
23493023Snsouch	 * from the destination is chosen.
23593023Snsouch	 */
23693023Snsouch	u_quad_t ip6s_sources_otherscope[16];
23793023Snsouch	/* number of times that a deprecated address is chosen */
23893023Snsouch	u_quad_t ip6s_sources_deprecated[16];
23993023Snsouch
24051694Sroger	/* number of times that each rule of source selection is applied. */
24151694Sroger	u_quad_t ip6s_sources_rule[16];
24251694Sroger};
24351694Sroger
24451694Sroger#ifdef _KERNEL
24551694Sroger#define	IP6STAT_ADD(name, val)	V_ip6stat.name += (val)
24651694Sroger#define	IP6STAT_SUB(name, val)	V_ip6stat.name -= (val)
24751694Sroger#define	IP6STAT_INC(name)	IP6STAT_ADD(name, 1)
24851694Sroger#define	IP6STAT_DEC(name)	IP6STAT_SUB(name, 1)
24951694Sroger#endif
25051694Sroger
25151694Sroger#ifdef _KERNEL
25251694Sroger/*
25351694Sroger * IPv6 onion peeling state.
25451694Sroger * it will be initialized when we come into ip6_input().
25551694Sroger * XXX do not make it a kitchen sink!
25651694Sroger */
25751694Srogerstruct ip6aux {
25851694Sroger	u_int32_t ip6a_flags;
25951694Sroger#define IP6A_SWAP	0x01		/* swapped home/care-of on packet */
26051694Sroger#define IP6A_HASEEN	0x02		/* HA was present */
261111815Sphk#define IP6A_BRUID	0x04		/* BR Unique Identifier was present */
262111815Sphk#define IP6A_RTALERTSEEN 0x08		/* rtalert present */
263111815Sphk
264111815Sphk	/* ip6.ip6_src */
265111815Sphk	struct in6_addr ip6a_careof;	/* care-of address of the peer */
266111815Sphk	struct in6_addr ip6a_home;	/* home address of the peer */
267111815Sphk	u_int16_t	ip6a_bruid;	/* BR unique identifier */
268111815Sphk
269111815Sphk	/* ip6.ip6_dst */
27051694Sroger	struct in6_ifaddr *ip6a_dstia6;	/* my ifaddr that matches ip6_dst */
27151694Sroger
27252995Speter	/* rtalert */
27367306Sroger	u_int16_t ip6a_rtalert;		/* rtalert option value */
27465728Sroger
27565728Sroger	/*
27667306Sroger	 * decapsulation history will be here.
27751694Sroger	 * with IPsec it may not be accurate.
27851694Sroger	 */
27951694Sroger};
28051694Sroger#endif
28151694Sroger
28251694Sroger#ifdef _KERNEL
28351694Sroger/* flags passed to ip6_output as last parameter */
28451694Sroger#define	IPV6_UNSPECSRC		0x01	/* allow :: as the source address */
28551694Sroger#define	IPV6_FORWARDING		0x02	/* most of IPv6 header exists */
28651694Sroger#define	IPV6_MINMTU		0x04	/* use minimum MTU (IPV6_USE_MIN_MTU) */
28751694Sroger
28867306Sroger#ifdef __NO_STRICT_ALIGNMENT
28967306Sroger#define IP6_HDR_ALIGNED_P(ip)	1
29067306Sroger#else
29167306Sroger#define IP6_HDR_ALIGNED_P(ip)	((((intptr_t) (ip)) & 3) == 0)
29267306Sroger#endif
29367306Sroger
29467306SrogerVNET_DECLARE(struct ip6stat, ip6stat);	/* statistics */
29567306SrogerVNET_DECLARE(int, ip6_defhlim);		/* default hop limit */
29667306SrogerVNET_DECLARE(int, ip6_defmcasthlim);	/* default multicast hop limit */
29767306SrogerVNET_DECLARE(int, ip6_forwarding);	/* act as router? */
29867306SrogerVNET_DECLARE(int, ip6_gif_hlim);	/* Hop limit for gif encap packet */
29967306SrogerVNET_DECLARE(int, ip6_use_deprecated);	/* allow deprecated addr as source */
30067306SrogerVNET_DECLARE(int, ip6_rr_prune);	/* router renumbering prefix
30167306Sroger					 * walk list every 5 sec.    */
30267306SrogerVNET_DECLARE(int, ip6_mcast_pmtu);	/* enable pMTU discovery for multicast? */
30367306SrogerVNET_DECLARE(int, ip6_v6only);
30467306SrogerVNET_DECLARE(struct socket *, ip6_mrouter);	/* multicast routing daemon */
30567306SrogerVNET_DECLARE(int, ip6_sendredirects);	/* send IP redirects when forwarding? */
30667306SrogerVNET_DECLARE(int, ip6_maxfragpackets);	/* Maximum packets in reassembly
30751694Sroger					 * queue */
30851694SrogerVNET_DECLARE(int, ip6_maxfrags);	/* Maximum fragments in reassembly
30951694Sroger					 * queue */
31051694SrogerVNET_DECLARE(int, ip6_accept_rtadv);	/* Acts as a host not a router */
31151694SrogerVNET_DECLARE(int, ip6_keepfaith);	/* Firewall Aided Internet Translator */
31251694SrogerVNET_DECLARE(int, ip6_log_interval);
31351694SrogerVNET_DECLARE(time_t, ip6_log_time);
31451694SrogerVNET_DECLARE(int, ip6_hdrnestlimit);	/* upper limit of # of extension
31551694Sroger					 * headers */
31651694SrogerVNET_DECLARE(int, ip6_dad_count);	/* DupAddrDetectionTransmits */
31751694Sroger
31851694SrogerVNET_DECLARE(int, ip6_auto_flowlabel);
31951694SrogerVNET_DECLARE(int, ip6_auto_linklocal);
32051694Sroger
32151694SrogerVNET_DECLARE(int, ip6_use_tempaddr);	/* Whether to use temporary addresses */
32251694SrogerVNET_DECLARE(int, ip6_prefer_tempaddr);	/* Whether to prefer temporary
32351694Sroger					 * addresses in the source address
32451694Sroger					 * selection */
32551694Sroger
32651694Sroger#ifdef IPSTEALTH
32751694SrogerVNET_DECLARE(int, ip6stealth);
32851694Sroger#endif
32951694Sroger
33051694SrogerVNET_DECLARE(int, ip6_use_defzone);	/* Whether to use the default scope
33151694Sroger					 * zone when unspecified */
33251694Sroger
33362112Sroger#define	V_ip6stat			VNET(ip6stat)
33462112Sroger#define	V_ip6_defhlim			VNET(ip6_defhlim)
33562112Sroger#define	V_ip6_defmcasthlim		VNET(ip6_defmcasthlim)
33651694Sroger#define	V_ip6_forwarding		VNET(ip6_forwarding)
33751694Sroger#define	V_ip6_gif_hlim			VNET(ip6_gif_hlim)
33851694Sroger#define	V_ip6_use_deprecated		VNET(ip6_use_deprecated)
33951694Sroger#define	V_ip6_rr_prune			VNET(ip6_rr_prune)
34051694Sroger#define	V_ip6_mcast_pmtu		VNET(ip6_mcast_pmtu)
34151694Sroger#define	V_ip6_v6only			VNET(ip6_v6only)
34251694Sroger#define	V_ip6_mrouter			VNET(ip6_mrouter)
34351694Sroger#define	V_ip6_sendredirects		VNET(ip6_sendredirects)
34451694Sroger#define	V_ip6_maxfragpackets		VNET(ip6_maxfragpackets)
34551694Sroger#define	V_ip6_maxfrags			VNET(ip6_maxfrags)
34665049Sroger#define	V_ip6_accept_rtadv		VNET(ip6_accept_rtadv)
34765049Sroger#define	V_ip6_keepfaith			VNET(ip6_keepfaith)
34865049Sroger#define	V_ip6_log_interval		VNET(ip6_log_interval)
34951694Sroger#define	V_ip6_log_time			VNET(ip6_log_time)
35065049Sroger#define	V_ip6_hdrnestlimit		VNET(ip6_hdrnestlimit)
35151694Sroger#define	V_ip6_dad_count			VNET(ip6_dad_count)
35251694Sroger#define	V_ip6_auto_flowlabel		VNET(ip6_auto_flowlabel)
35351694Sroger#define	V_ip6_auto_linklocal		VNET(ip6_auto_linklocal)
35451694Sroger#define	V_ip6_use_tempaddr		VNET(ip6_use_tempaddr)
35551694Sroger#define	V_ip6_prefer_tempaddr		VNET(ip6_prefer_tempaddr)
35659014Sroger#ifdef IPSTEALTH
35759014Sroger#define	V_ip6stealth			VNET(ip6stealth)
35851694Sroger#endif
35959014Sroger#define	V_ip6_use_defzone		VNET(ip6_use_defzone)
36051694Sroger
36151694Srogerextern	struct pfil_head inet6_pfil_hook;	/* packet filter hooks */
36251694Sroger
36359014Srogerextern struct	pr_usrreqs rip6_usrreqs;
36459014Srogerstruct sockopt;
36551694Sroger
36651694Srogerstruct inpcb;
36751694Sroger
36851694Srogerint	icmp6_ctloutput __P((struct socket *, struct sockopt *sopt));
36951694Sroger
37051694Srogerstruct in6_ifaddr;
37151694Srogervoid	ip6_init __P((void));
37251694Sroger#ifdef VIMAGE
37351694Srogervoid	ip6_destroy __P((void));
37451694Sroger#endif
37551694Srogervoid	ip6_input __P((struct mbuf *));
37651694Srogerstruct in6_ifaddr *ip6_getdstifaddr __P((struct mbuf *));
37751694Srogervoid	ip6_freepcbopts __P((struct ip6_pktopts *));
37865049Sroger
37965049Srogerint	ip6_unknown_opt __P((u_int8_t *, struct mbuf *, int));
38065049Srogerchar *	ip6_get_prevhdr __P((struct mbuf *, int));
38151694Srogerint	ip6_nexthdr __P((struct mbuf *, int, int, int *));
38251694Srogerint	ip6_lasthdr __P((struct mbuf *, int, int, int *));
38351694Sroger
38451694Srogerstruct ip6aux *ip6_addaux __P((struct mbuf *));
38551694Srogerstruct ip6aux *ip6_findaux __P((struct mbuf *));
38651694Srogervoid	ip6_delaux __P((struct mbuf *));
38759250Sroger
38851694Srogerextern int	(*ip6_mforward)(struct ip6_hdr *, struct ifnet *,
38951694Sroger    struct mbuf *);
39051694Sroger
39151694Srogerint	ip6_process_hopopts __P((struct mbuf *, u_int8_t *, int, u_int32_t *,
39251694Sroger				 u_int32_t *));
39351694Srogerstruct mbuf	**ip6_savecontrol_v4(struct inpcb *, struct mbuf *,
39451694Sroger	    struct mbuf **, int *);
39551694Srogervoid	ip6_savecontrol __P((struct inpcb *, struct mbuf *, struct mbuf **));
39651694Srogervoid	ip6_notify_pmtu __P((struct inpcb *, struct sockaddr_in6 *,
39751694Sroger			     u_int32_t *));
39851694Srogerint	ip6_sysctl __P((int *, u_int, void *, size_t *, void *, size_t));
39951694Sroger
40051694Srogervoid	ip6_forward __P((struct mbuf *, int));
40151694Sroger
40251694Srogervoid	ip6_mloopback __P((struct ifnet *, struct mbuf *, struct sockaddr_in6 *));
40351694Srogerint	ip6_output __P((struct mbuf *, struct ip6_pktopts *,
40451694Sroger			struct route_in6 *,
40551694Sroger			int,
40651694Sroger			struct ip6_moptions *, struct ifnet **,
40751694Sroger			struct inpcb *));
40851694Srogerint	ip6_ctloutput __P((struct socket *, struct sockopt *));
40951694Srogerint	ip6_raw_ctloutput __P((struct socket *, struct sockopt *));
41051694Srogervoid	ip6_initpktopts __P((struct ip6_pktopts *));
41151694Srogerint	ip6_setpktopts __P((struct mbuf *, struct ip6_pktopts *,
41251694Sroger	struct ip6_pktopts *, struct ucred *, int));
41365692Srogervoid	ip6_clearpktopts __P((struct ip6_pktopts *, int));
41493023Snsouchstruct ip6_pktopts *ip6_copypktopts __P((struct ip6_pktopts *, int));
41551694Srogerint	ip6_optlen __P((struct inpcb *));
41651694Sroger
41751694Srogerint	route6_input __P((struct mbuf **, int *, int));
41851694Sroger
41951694Srogervoid	frag6_init __P((void));
42051694Srogerint	frag6_input __P((struct mbuf **, int *, int));
42151694Srogervoid	frag6_slowtimo __P((void));
42251694Srogervoid	frag6_drain __P((void));
42351694Sroger
42451694Srogervoid	rip6_init __P((void));
42551694Srogerint	rip6_input __P((struct mbuf **, int *, int));
42651694Srogervoid	rip6_ctlinput __P((int, struct sockaddr *, void *));
42751694Srogerint	rip6_ctloutput __P((struct socket *, struct sockopt *));
42851694Srogerint	rip6_output __P((struct mbuf *, ...));
42951694Srogerint	rip6_usrreq __P((struct socket *,
43051694Sroger	    int, struct mbuf *, struct mbuf *, struct mbuf *, struct thread *));
43151694Sroger
43251694Srogerint	dest6_input __P((struct mbuf **, int *, int));
43351694Srogerint	none_input __P((struct mbuf **, int *, int));
43451694Sroger
43551694Srogerint	in6_selectsrc(struct sockaddr_in6 *, struct ip6_pktopts *,
43651694Sroger	struct inpcb *inp, struct route_in6 *, struct ucred *cred,
43751694Sroger	struct ifnet **, struct in6_addr *);
43851694Srogerint in6_selectroute __P((struct sockaddr_in6 *, struct ip6_pktopts *,
43951694Sroger	struct ip6_moptions *, struct route_in6 *, struct ifnet **,
44051694Sroger	struct rtentry **));
44151694Srogeru_int32_t ip6_randomid __P((void));
44251694Srogeru_int32_t ip6_randomflowlabel __P((void));
44351694Sroger#endif /* _KERNEL */
44451694Sroger
44551694Sroger#endif /* !_NETINET6_IP6_VAR_H_ */
44651694Sroger