xref: /titanic_52/usr/src/boot/include/netinet/ip_var.h (revision 4a5d661a82b942b6538acd26209d959ce98b593a)
1*4a5d661aSToomas Soome /*-
2*4a5d661aSToomas Soome  * Copyright (c) 1982, 1986, 1993
3*4a5d661aSToomas Soome  *	The Regents of the University of California.  All rights reserved.
4*4a5d661aSToomas Soome  *
5*4a5d661aSToomas Soome  * Redistribution and use in source and binary forms, with or without
6*4a5d661aSToomas Soome  * modification, are permitted provided that the following conditions
7*4a5d661aSToomas Soome  * are met:
8*4a5d661aSToomas Soome  * 1. Redistributions of source code must retain the above copyright
9*4a5d661aSToomas Soome  *    notice, this list of conditions and the following disclaimer.
10*4a5d661aSToomas Soome  * 2. Redistributions in binary form must reproduce the above copyright
11*4a5d661aSToomas Soome  *    notice, this list of conditions and the following disclaimer in the
12*4a5d661aSToomas Soome  *    documentation and/or other materials provided with the distribution.
13*4a5d661aSToomas Soome  * 4. Neither the name of the University nor the names of its contributors
14*4a5d661aSToomas Soome  *    may be used to endorse or promote products derived from this software
15*4a5d661aSToomas Soome  *    without specific prior written permission.
16*4a5d661aSToomas Soome  *
17*4a5d661aSToomas Soome  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18*4a5d661aSToomas Soome  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19*4a5d661aSToomas Soome  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20*4a5d661aSToomas Soome  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21*4a5d661aSToomas Soome  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22*4a5d661aSToomas Soome  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23*4a5d661aSToomas Soome  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24*4a5d661aSToomas Soome  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25*4a5d661aSToomas Soome  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26*4a5d661aSToomas Soome  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27*4a5d661aSToomas Soome  * SUCH DAMAGE.
28*4a5d661aSToomas Soome  *
29*4a5d661aSToomas Soome  *	@(#)ip_var.h	8.2 (Berkeley) 1/9/95
30*4a5d661aSToomas Soome  * $FreeBSD$
31*4a5d661aSToomas Soome  */
32*4a5d661aSToomas Soome 
33*4a5d661aSToomas Soome #ifndef _NETINET_IP_VAR_H_
34*4a5d661aSToomas Soome #define	_NETINET_IP_VAR_H_
35*4a5d661aSToomas Soome 
36*4a5d661aSToomas Soome #include <sys/queue.h>
37*4a5d661aSToomas Soome 
38*4a5d661aSToomas Soome /*
39*4a5d661aSToomas Soome  * Overlay for ip header used by other protocols (tcp, udp).
40*4a5d661aSToomas Soome  */
41*4a5d661aSToomas Soome struct ipovly {
42*4a5d661aSToomas Soome 	u_char	ih_x1[9];		/* (unused) */
43*4a5d661aSToomas Soome 	u_char	ih_pr;			/* protocol */
44*4a5d661aSToomas Soome 	u_short	ih_len;			/* protocol length */
45*4a5d661aSToomas Soome 	struct	in_addr ih_src;		/* source internet address */
46*4a5d661aSToomas Soome 	struct	in_addr ih_dst;		/* destination internet address */
47*4a5d661aSToomas Soome };
48*4a5d661aSToomas Soome 
49*4a5d661aSToomas Soome #ifdef _KERNEL
50*4a5d661aSToomas Soome /*
51*4a5d661aSToomas Soome  * Ip reassembly queue structure.  Each fragment
52*4a5d661aSToomas Soome  * being reassembled is attached to one of these structures.
53*4a5d661aSToomas Soome  * They are timed out after ipq_ttl drops to 0, and may also
54*4a5d661aSToomas Soome  * be reclaimed if memory becomes tight.
55*4a5d661aSToomas Soome  */
56*4a5d661aSToomas Soome struct ipq {
57*4a5d661aSToomas Soome 	TAILQ_ENTRY(ipq) ipq_list;	/* to other reass headers */
58*4a5d661aSToomas Soome 	u_char	ipq_ttl;		/* time for reass q to live */
59*4a5d661aSToomas Soome 	u_char	ipq_p;			/* protocol of this fragment */
60*4a5d661aSToomas Soome 	u_short	ipq_id;			/* sequence id for reassembly */
61*4a5d661aSToomas Soome 	struct mbuf *ipq_frags;		/* to ip headers of fragments */
62*4a5d661aSToomas Soome 	struct	in_addr ipq_src,ipq_dst;
63*4a5d661aSToomas Soome 	u_char	ipq_nfrags;		/* # frags in this packet */
64*4a5d661aSToomas Soome 	struct label *ipq_label;	/* MAC label */
65*4a5d661aSToomas Soome };
66*4a5d661aSToomas Soome #endif /* _KERNEL */
67*4a5d661aSToomas Soome 
68*4a5d661aSToomas Soome /*
69*4a5d661aSToomas Soome  * Structure stored in mbuf in inpcb.ip_options
70*4a5d661aSToomas Soome  * and passed to ip_output when ip options are in use.
71*4a5d661aSToomas Soome  * The actual length of the options (including ipopt_dst)
72*4a5d661aSToomas Soome  * is in m_len.
73*4a5d661aSToomas Soome  */
74*4a5d661aSToomas Soome #define MAX_IPOPTLEN	40
75*4a5d661aSToomas Soome 
76*4a5d661aSToomas Soome struct ipoption {
77*4a5d661aSToomas Soome 	struct	in_addr ipopt_dst;	/* first-hop dst if source routed */
78*4a5d661aSToomas Soome 	char	ipopt_list[MAX_IPOPTLEN];	/* options proper */
79*4a5d661aSToomas Soome };
80*4a5d661aSToomas Soome 
81*4a5d661aSToomas Soome /*
82*4a5d661aSToomas Soome  * Structure attached to inpcb.ip_moptions and
83*4a5d661aSToomas Soome  * passed to ip_output when IP multicast options are in use.
84*4a5d661aSToomas Soome  * This structure is lazy-allocated.
85*4a5d661aSToomas Soome  */
86*4a5d661aSToomas Soome struct ip_moptions {
87*4a5d661aSToomas Soome 	struct	ifnet *imo_multicast_ifp; /* ifp for outgoing multicasts */
88*4a5d661aSToomas Soome 	struct in_addr imo_multicast_addr; /* ifindex/addr on MULTICAST_IF */
89*4a5d661aSToomas Soome 	u_long	imo_multicast_vif;	/* vif num outgoing multicasts */
90*4a5d661aSToomas Soome 	u_char	imo_multicast_ttl;	/* TTL for outgoing multicasts */
91*4a5d661aSToomas Soome 	u_char	imo_multicast_loop;	/* 1 => hear sends if a member */
92*4a5d661aSToomas Soome 	u_short	imo_num_memberships;	/* no. memberships this socket */
93*4a5d661aSToomas Soome 	u_short	imo_max_memberships;	/* max memberships this socket */
94*4a5d661aSToomas Soome 	struct	in_multi **imo_membership;	/* group memberships */
95*4a5d661aSToomas Soome 	struct	in_mfilter *imo_mfilters;	/* source filters */
96*4a5d661aSToomas Soome 	STAILQ_ENTRY(ip_moptions) imo_link;
97*4a5d661aSToomas Soome };
98*4a5d661aSToomas Soome 
99*4a5d661aSToomas Soome struct	ipstat {
100*4a5d661aSToomas Soome 	uint64_t ips_total;		/* total packets received */
101*4a5d661aSToomas Soome 	uint64_t ips_badsum;		/* checksum bad */
102*4a5d661aSToomas Soome 	uint64_t ips_tooshort;		/* packet too short */
103*4a5d661aSToomas Soome 	uint64_t ips_toosmall;		/* not enough data */
104*4a5d661aSToomas Soome 	uint64_t ips_badhlen;		/* ip header length < data size */
105*4a5d661aSToomas Soome 	uint64_t ips_badlen;		/* ip length < ip header length */
106*4a5d661aSToomas Soome 	uint64_t ips_fragments;		/* fragments received */
107*4a5d661aSToomas Soome 	uint64_t ips_fragdropped;	/* frags dropped (dups, out of space) */
108*4a5d661aSToomas Soome 	uint64_t ips_fragtimeout;	/* fragments timed out */
109*4a5d661aSToomas Soome 	uint64_t ips_forward;		/* packets forwarded */
110*4a5d661aSToomas Soome 	uint64_t ips_fastforward;	/* packets fast forwarded */
111*4a5d661aSToomas Soome 	uint64_t ips_cantforward;	/* packets rcvd for unreachable dest */
112*4a5d661aSToomas Soome 	uint64_t ips_redirectsent;	/* packets forwarded on same net */
113*4a5d661aSToomas Soome 	uint64_t ips_noproto;		/* unknown or unsupported protocol */
114*4a5d661aSToomas Soome 	uint64_t ips_delivered;		/* datagrams delivered to upper level*/
115*4a5d661aSToomas Soome 	uint64_t ips_localout;		/* total ip packets generated here */
116*4a5d661aSToomas Soome 	uint64_t ips_odropped;		/* lost packets due to nobufs, etc. */
117*4a5d661aSToomas Soome 	uint64_t ips_reassembled;	/* total packets reassembled ok */
118*4a5d661aSToomas Soome 	uint64_t ips_fragmented;	/* datagrams successfully fragmented */
119*4a5d661aSToomas Soome 	uint64_t ips_ofragments;	/* output fragments created */
120*4a5d661aSToomas Soome 	uint64_t ips_cantfrag;		/* don't fragment flag was set, etc. */
121*4a5d661aSToomas Soome 	uint64_t ips_badoptions;		/* error in option processing */
122*4a5d661aSToomas Soome 	uint64_t ips_noroute;		/* packets discarded due to no route */
123*4a5d661aSToomas Soome 	uint64_t ips_badvers;		/* ip version != 4 */
124*4a5d661aSToomas Soome 	uint64_t ips_rawout;		/* total raw ip packets generated */
125*4a5d661aSToomas Soome 	uint64_t ips_toolong;		/* ip length > max ip packet size */
126*4a5d661aSToomas Soome 	uint64_t ips_notmember;		/* multicasts for unregistered grps */
127*4a5d661aSToomas Soome 	uint64_t ips_nogif;		/* no match gif found */
128*4a5d661aSToomas Soome 	uint64_t ips_badaddr;		/* invalid address on header */
129*4a5d661aSToomas Soome };
130*4a5d661aSToomas Soome 
131*4a5d661aSToomas Soome #ifdef _KERNEL
132*4a5d661aSToomas Soome 
133*4a5d661aSToomas Soome #include <sys/counter.h>
134*4a5d661aSToomas Soome #include <net/vnet.h>
135*4a5d661aSToomas Soome 
136*4a5d661aSToomas Soome VNET_PCPUSTAT_DECLARE(struct ipstat, ipstat);
137*4a5d661aSToomas Soome /*
138*4a5d661aSToomas Soome  * In-kernel consumers can use these accessor macros directly to update
139*4a5d661aSToomas Soome  * stats.
140*4a5d661aSToomas Soome  */
141*4a5d661aSToomas Soome #define	IPSTAT_ADD(name, val)	\
142*4a5d661aSToomas Soome     VNET_PCPUSTAT_ADD(struct ipstat, ipstat, name, (val))
143*4a5d661aSToomas Soome #define	IPSTAT_SUB(name, val)	IPSTAT_ADD(name, -(val))
144*4a5d661aSToomas Soome #define	IPSTAT_INC(name)	IPSTAT_ADD(name, 1)
145*4a5d661aSToomas Soome #define	IPSTAT_DEC(name)	IPSTAT_SUB(name, 1)
146*4a5d661aSToomas Soome 
147*4a5d661aSToomas Soome /*
148*4a5d661aSToomas Soome  * Kernel module consumers must use this accessor macro.
149*4a5d661aSToomas Soome  */
150*4a5d661aSToomas Soome void	kmod_ipstat_inc(int statnum);
151*4a5d661aSToomas Soome #define	KMOD_IPSTAT_INC(name)	\
152*4a5d661aSToomas Soome     kmod_ipstat_inc(offsetof(struct ipstat, name) / sizeof(uint64_t))
153*4a5d661aSToomas Soome void	kmod_ipstat_dec(int statnum);
154*4a5d661aSToomas Soome #define	KMOD_IPSTAT_DEC(name)	\
155*4a5d661aSToomas Soome     kmod_ipstat_dec(offsetof(struct ipstat, name) / sizeof(uint64_t))
156*4a5d661aSToomas Soome 
157*4a5d661aSToomas Soome /* flags passed to ip_output as last parameter */
158*4a5d661aSToomas Soome #define	IP_FORWARDING		0x1		/* most of ip header exists */
159*4a5d661aSToomas Soome #define	IP_RAWOUTPUT		0x2		/* raw ip header exists */
160*4a5d661aSToomas Soome #define	IP_SENDONES		0x4		/* send all-ones broadcast */
161*4a5d661aSToomas Soome #define	IP_SENDTOIF		0x8		/* send on specific ifnet */
162*4a5d661aSToomas Soome #define IP_ROUTETOIF		SO_DONTROUTE	/* 0x10 bypass routing tables */
163*4a5d661aSToomas Soome #define IP_ALLOWBROADCAST	SO_BROADCAST	/* 0x20 can send broadcast packets */
164*4a5d661aSToomas Soome #define	IP_NODEFAULTFLOWID	0x40		/* Don't set the flowid from inp */
165*4a5d661aSToomas Soome 
166*4a5d661aSToomas Soome #ifdef __NO_STRICT_ALIGNMENT
167*4a5d661aSToomas Soome #define IP_HDR_ALIGNED_P(ip)	1
168*4a5d661aSToomas Soome #else
169*4a5d661aSToomas Soome #define IP_HDR_ALIGNED_P(ip)	((((intptr_t) (ip)) & 3) == 0)
170*4a5d661aSToomas Soome #endif
171*4a5d661aSToomas Soome 
172*4a5d661aSToomas Soome struct ip;
173*4a5d661aSToomas Soome struct inpcb;
174*4a5d661aSToomas Soome struct route;
175*4a5d661aSToomas Soome struct sockopt;
176*4a5d661aSToomas Soome 
177*4a5d661aSToomas Soome VNET_DECLARE(int, ip_defttl);			/* default IP ttl */
178*4a5d661aSToomas Soome VNET_DECLARE(int, ipforwarding);		/* ip forwarding */
179*4a5d661aSToomas Soome #ifdef IPSTEALTH
180*4a5d661aSToomas Soome VNET_DECLARE(int, ipstealth);			/* stealth forwarding */
181*4a5d661aSToomas Soome #endif
182*4a5d661aSToomas Soome extern u_char	ip_protox[];
183*4a5d661aSToomas Soome VNET_DECLARE(struct socket *, ip_rsvpd);	/* reservation protocol daemon*/
184*4a5d661aSToomas Soome VNET_DECLARE(struct socket *, ip_mrouter);	/* multicast routing daemon */
185*4a5d661aSToomas Soome extern int	(*legal_vif_num)(int);
186*4a5d661aSToomas Soome extern u_long	(*ip_mcast_src)(int);
187*4a5d661aSToomas Soome VNET_DECLARE(int, rsvp_on);
188*4a5d661aSToomas Soome VNET_DECLARE(int, drop_redirect);
189*4a5d661aSToomas Soome extern struct	pr_usrreqs rip_usrreqs;
190*4a5d661aSToomas Soome 
191*4a5d661aSToomas Soome #define	V_ip_id			VNET(ip_id)
192*4a5d661aSToomas Soome #define	V_ip_defttl		VNET(ip_defttl)
193*4a5d661aSToomas Soome #define	V_ipforwarding		VNET(ipforwarding)
194*4a5d661aSToomas Soome #ifdef IPSTEALTH
195*4a5d661aSToomas Soome #define	V_ipstealth		VNET(ipstealth)
196*4a5d661aSToomas Soome #endif
197*4a5d661aSToomas Soome #define	V_ip_rsvpd		VNET(ip_rsvpd)
198*4a5d661aSToomas Soome #define	V_ip_mrouter		VNET(ip_mrouter)
199*4a5d661aSToomas Soome #define	V_rsvp_on		VNET(rsvp_on)
200*4a5d661aSToomas Soome #define	V_drop_redirect		VNET(drop_redirect)
201*4a5d661aSToomas Soome 
202*4a5d661aSToomas Soome void	inp_freemoptions(struct ip_moptions *);
203*4a5d661aSToomas Soome int	inp_getmoptions(struct inpcb *, struct sockopt *);
204*4a5d661aSToomas Soome int	inp_setmoptions(struct inpcb *, struct sockopt *);
205*4a5d661aSToomas Soome 
206*4a5d661aSToomas Soome int	ip_ctloutput(struct socket *, struct sockopt *sopt);
207*4a5d661aSToomas Soome void	ip_drain(void);
208*4a5d661aSToomas Soome int	ip_fragment(struct ip *ip, struct mbuf **m_frag, int mtu,
209*4a5d661aSToomas Soome 	    u_long if_hwassist_flags);
210*4a5d661aSToomas Soome void	ip_forward(struct mbuf *m, int srcrt);
211*4a5d661aSToomas Soome void	ip_init(void);
212*4a5d661aSToomas Soome #ifdef VIMAGE
213*4a5d661aSToomas Soome void	ip_destroy(void);
214*4a5d661aSToomas Soome #endif
215*4a5d661aSToomas Soome extern int
216*4a5d661aSToomas Soome 	(*ip_mforward)(struct ip *, struct ifnet *, struct mbuf *,
217*4a5d661aSToomas Soome 	    struct ip_moptions *);
218*4a5d661aSToomas Soome int	ip_output(struct mbuf *,
219*4a5d661aSToomas Soome 	    struct mbuf *, struct route *, int, struct ip_moptions *,
220*4a5d661aSToomas Soome 	    struct inpcb *);
221*4a5d661aSToomas Soome int	ipproto_register(short);
222*4a5d661aSToomas Soome int	ipproto_unregister(short);
223*4a5d661aSToomas Soome struct mbuf *
224*4a5d661aSToomas Soome 	ip_reass(struct mbuf *);
225*4a5d661aSToomas Soome struct in_ifaddr *
226*4a5d661aSToomas Soome 	ip_rtaddr(struct in_addr, u_int fibnum);
227*4a5d661aSToomas Soome void	ip_savecontrol(struct inpcb *, struct mbuf **, struct ip *,
228*4a5d661aSToomas Soome 	    struct mbuf *);
229*4a5d661aSToomas Soome void	ip_slowtimo(void);
230*4a5d661aSToomas Soome void	ip_fillid(struct ip *);
231*4a5d661aSToomas Soome int	rip_ctloutput(struct socket *, struct sockopt *);
232*4a5d661aSToomas Soome void	rip_ctlinput(int, struct sockaddr *, void *);
233*4a5d661aSToomas Soome void	rip_init(void);
234*4a5d661aSToomas Soome #ifdef VIMAGE
235*4a5d661aSToomas Soome void	rip_destroy(void);
236*4a5d661aSToomas Soome #endif
237*4a5d661aSToomas Soome int	rip_input(struct mbuf **, int *, int);
238*4a5d661aSToomas Soome int	rip_output(struct mbuf *, struct socket *, ...);
239*4a5d661aSToomas Soome int	ipip_input(struct mbuf **, int *, int);
240*4a5d661aSToomas Soome int	rsvp_input(struct mbuf **, int *, int);
241*4a5d661aSToomas Soome int	ip_rsvp_init(struct socket *);
242*4a5d661aSToomas Soome int	ip_rsvp_done(void);
243*4a5d661aSToomas Soome extern int	(*ip_rsvp_vif)(struct socket *, struct sockopt *);
244*4a5d661aSToomas Soome extern void	(*ip_rsvp_force_done)(struct socket *);
245*4a5d661aSToomas Soome extern int	(*rsvp_input_p)(struct mbuf **, int *, int);
246*4a5d661aSToomas Soome 
247*4a5d661aSToomas Soome VNET_DECLARE(struct pfil_head, inet_pfil_hook);	/* packet filter hooks */
248*4a5d661aSToomas Soome #define	V_inet_pfil_hook	VNET(inet_pfil_hook)
249*4a5d661aSToomas Soome 
250*4a5d661aSToomas Soome void	in_delayed_cksum(struct mbuf *m);
251*4a5d661aSToomas Soome 
252*4a5d661aSToomas Soome /* Hooks for ipfw, dummynet, divert etc. Most are declared in raw_ip.c */
253*4a5d661aSToomas Soome /*
254*4a5d661aSToomas Soome  * Reference to an ipfw or packet filter rule that can be carried
255*4a5d661aSToomas Soome  * outside critical sections.
256*4a5d661aSToomas Soome  * A rule is identified by rulenum:rule_id which is ordered.
257*4a5d661aSToomas Soome  * In version chain_id the rule can be found in slot 'slot', so
258*4a5d661aSToomas Soome  * we don't need a lookup if chain_id == chain->id.
259*4a5d661aSToomas Soome  *
260*4a5d661aSToomas Soome  * On exit from the firewall this structure refers to the rule after
261*4a5d661aSToomas Soome  * the matching one (slot points to the new rule; rulenum:rule_id-1
262*4a5d661aSToomas Soome  * is the matching rule), and additional info (e.g. info often contains
263*4a5d661aSToomas Soome  * the insn argument or tablearg in the low 16 bits, in host format).
264*4a5d661aSToomas Soome  * On entry, the structure is valid if slot>0, and refers to the starting
265*4a5d661aSToomas Soome  * rules. 'info' contains the reason for reinject, e.g. divert port,
266*4a5d661aSToomas Soome  * divert direction, and so on.
267*4a5d661aSToomas Soome  */
268*4a5d661aSToomas Soome struct ipfw_rule_ref {
269*4a5d661aSToomas Soome 	uint32_t	slot;		/* slot for matching rule	*/
270*4a5d661aSToomas Soome 	uint32_t	rulenum;	/* matching rule number		*/
271*4a5d661aSToomas Soome 	uint32_t	rule_id;	/* matching rule id		*/
272*4a5d661aSToomas Soome 	uint32_t	chain_id;	/* ruleset id			*/
273*4a5d661aSToomas Soome 	uint32_t	info;		/* see below			*/
274*4a5d661aSToomas Soome };
275*4a5d661aSToomas Soome 
276*4a5d661aSToomas Soome enum {
277*4a5d661aSToomas Soome 	IPFW_INFO_MASK	= 0x0000ffff,
278*4a5d661aSToomas Soome 	IPFW_INFO_OUT	= 0x00000000,	/* outgoing, just for convenience */
279*4a5d661aSToomas Soome 	IPFW_INFO_IN	= 0x80000000,	/* incoming, overloads dir */
280*4a5d661aSToomas Soome 	IPFW_ONEPASS	= 0x40000000,	/* One-pass, do not reinject */
281*4a5d661aSToomas Soome 	IPFW_IS_MASK	= 0x30000000,	/* which source ? */
282*4a5d661aSToomas Soome 	IPFW_IS_DIVERT	= 0x20000000,
283*4a5d661aSToomas Soome 	IPFW_IS_DUMMYNET =0x10000000,
284*4a5d661aSToomas Soome 	IPFW_IS_PIPE	= 0x08000000,	/* pipe=1, queue = 0 */
285*4a5d661aSToomas Soome };
286*4a5d661aSToomas Soome #define MTAG_IPFW	1148380143	/* IPFW-tagged cookie */
287*4a5d661aSToomas Soome #define MTAG_IPFW_RULE	1262273568	/* rule reference */
288*4a5d661aSToomas Soome #define	MTAG_IPFW_CALL	1308397630	/* call stack */
289*4a5d661aSToomas Soome 
290*4a5d661aSToomas Soome struct ip_fw_args;
291*4a5d661aSToomas Soome typedef int	(*ip_fw_chk_ptr_t)(struct ip_fw_args *args);
292*4a5d661aSToomas Soome typedef int	(*ip_fw_ctl_ptr_t)(struct sockopt *);
293*4a5d661aSToomas Soome VNET_DECLARE(ip_fw_ctl_ptr_t, ip_fw_ctl_ptr);
294*4a5d661aSToomas Soome #define	V_ip_fw_ctl_ptr		VNET(ip_fw_ctl_ptr)
295*4a5d661aSToomas Soome 
296*4a5d661aSToomas Soome /* Divert hooks. */
297*4a5d661aSToomas Soome extern void	(*ip_divert_ptr)(struct mbuf *m, int incoming);
298*4a5d661aSToomas Soome /* ng_ipfw hooks -- XXX make it the same as divert and dummynet */
299*4a5d661aSToomas Soome extern int	(*ng_ipfw_input_p)(struct mbuf **, int,
300*4a5d661aSToomas Soome 			struct ip_fw_args *, int);
301*4a5d661aSToomas Soome 
302*4a5d661aSToomas Soome extern int	(*ip_dn_ctl_ptr)(struct sockopt *);
303*4a5d661aSToomas Soome extern int	(*ip_dn_io_ptr)(struct mbuf **, int, struct ip_fw_args *);
304*4a5d661aSToomas Soome #endif /* _KERNEL */
305*4a5d661aSToomas Soome 
306*4a5d661aSToomas Soome #endif /* !_NETINET_IP_VAR_H_ */
307