xref: /freebsd/sys/netinet/in_pcb.h (revision 33841545909f4a4ee94aa148b3a9cbcdc1abb02a)
1df8bae1dSRodney W. Grimes /*
2df8bae1dSRodney W. Grimes  * Copyright (c) 1982, 1986, 1990, 1993
3df8bae1dSRodney W. Grimes  *	The Regents of the University of California.  All rights reserved.
4df8bae1dSRodney W. Grimes  *
5df8bae1dSRodney W. Grimes  * Redistribution and use in source and binary forms, with or without
6df8bae1dSRodney W. Grimes  * modification, are permitted provided that the following conditions
7df8bae1dSRodney W. Grimes  * are met:
8df8bae1dSRodney W. Grimes  * 1. Redistributions of source code must retain the above copyright
9df8bae1dSRodney W. Grimes  *    notice, this list of conditions and the following disclaimer.
10df8bae1dSRodney W. Grimes  * 2. Redistributions in binary form must reproduce the above copyright
11df8bae1dSRodney W. Grimes  *    notice, this list of conditions and the following disclaimer in the
12df8bae1dSRodney W. Grimes  *    documentation and/or other materials provided with the distribution.
13df8bae1dSRodney W. Grimes  * 3. All advertising materials mentioning features or use of this software
14df8bae1dSRodney W. Grimes  *    must display the following acknowledgement:
15df8bae1dSRodney W. Grimes  *	This product includes software developed by the University of
16df8bae1dSRodney W. Grimes  *	California, Berkeley and its contributors.
17df8bae1dSRodney W. Grimes  * 4. Neither the name of the University nor the names of its contributors
18df8bae1dSRodney W. Grimes  *    may be used to endorse or promote products derived from this software
19df8bae1dSRodney W. Grimes  *    without specific prior written permission.
20df8bae1dSRodney W. Grimes  *
21df8bae1dSRodney W. Grimes  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22df8bae1dSRodney W. Grimes  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23df8bae1dSRodney W. Grimes  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24df8bae1dSRodney W. Grimes  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25df8bae1dSRodney W. Grimes  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26df8bae1dSRodney W. Grimes  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27df8bae1dSRodney W. Grimes  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28df8bae1dSRodney W. Grimes  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29df8bae1dSRodney W. Grimes  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30df8bae1dSRodney W. Grimes  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31df8bae1dSRodney W. Grimes  * SUCH DAMAGE.
32df8bae1dSRodney W. Grimes  *
33df8bae1dSRodney W. Grimes  *	@(#)in_pcb.h	8.1 (Berkeley) 6/10/93
34c3aac50fSPeter Wemm  * $FreeBSD$
35df8bae1dSRodney W. Grimes  */
36df8bae1dSRodney W. Grimes 
37707f139eSPaul Richards #ifndef _NETINET_IN_PCB_H_
38707f139eSPaul Richards #define _NETINET_IN_PCB_H_
39707f139eSPaul Richards 
40f1844d4cSBruce Evans #include <sys/queue.h>
41f1844d4cSBruce Evans 
4282cd038dSYoshinobu Inoue 
4382cd038dSYoshinobu Inoue #include <netinet6/ipsec.h> /* for IPSEC */
4482cd038dSYoshinobu Inoue 
4582cd038dSYoshinobu Inoue #define	in6pcb		inpcb	/* for KAME src sync over BSD*'s */
4682cd038dSYoshinobu Inoue #define	in6p_sp		inp_sp	/* for KAME src sync over BSD*'s */
4782cd038dSYoshinobu Inoue 
48df8bae1dSRodney W. Grimes /*
49df8bae1dSRodney W. Grimes  * Common structure pcb for internet protocol implementation.
50df8bae1dSRodney W. Grimes  * Here are stored pointers to local and foreign host table
51df8bae1dSRodney W. Grimes  * entries, local and foreign socket numbers, and pointers
52df8bae1dSRodney W. Grimes  * up (to a socket structure) and down (to a protocol-specific)
53df8bae1dSRodney W. Grimes  * control block.
54df8bae1dSRodney W. Grimes  */
55e3975643SJake Burkholder LIST_HEAD(inpcbhead, inpcb);
56e3975643SJake Burkholder LIST_HEAD(inpcbporthead, inpcbport);
5798271db4SGarrett Wollman typedef	u_quad_t	inp_gen_t;
5815bd2b43SDavid Greenman 
593d4d47f3SGarrett Wollman /*
6082cd038dSYoshinobu Inoue  * PCB with AF_INET6 null bind'ed laddr can receive AF_INET input packet.
6182cd038dSYoshinobu Inoue  * So, AF_INET6 null laddr is also used as AF_INET null laddr,
6282cd038dSYoshinobu Inoue  * by utilize following structure. (At last, same as INRIA)
6382cd038dSYoshinobu Inoue  */
6482cd038dSYoshinobu Inoue struct in_addr_4in6 {
6582cd038dSYoshinobu Inoue 	u_int32_t	ia46_pad32[3];
6682cd038dSYoshinobu Inoue 	struct	in_addr	ia46_addr4;
6782cd038dSYoshinobu Inoue };
6882cd038dSYoshinobu Inoue 
6982cd038dSYoshinobu Inoue /*
703d4d47f3SGarrett Wollman  * NB: the zone allocator is type-stable EXCEPT FOR THE FIRST TWO LONGS
713d4d47f3SGarrett Wollman  * of the structure.  Therefore, it is important that the members in
723d4d47f3SGarrett Wollman  * that position not contain any information which is required to be
733d4d47f3SGarrett Wollman  * stable.
743d4d47f3SGarrett Wollman  */
7582cd038dSYoshinobu Inoue struct	icmp6_filter;
7682cd038dSYoshinobu Inoue 
77df8bae1dSRodney W. Grimes struct inpcb {
78e3975643SJake Burkholder 	LIST_ENTRY(inpcb) inp_hash; /* hash list */
79ca98b82cSDavid Greenman 	u_short	inp_fport;		/* foreign port */
80df8bae1dSRodney W. Grimes 	u_short	inp_lport;		/* local port */
81e3975643SJake Burkholder 	LIST_ENTRY(inpcb) inp_list; /* list for all PCBs of this proto */
8282cd038dSYoshinobu Inoue 	u_int32_t	inp_flow;
8382cd038dSYoshinobu Inoue 
8482cd038dSYoshinobu Inoue 	/* protocol dependent part, local and foreign addr */
8582cd038dSYoshinobu Inoue 	union {
8682cd038dSYoshinobu Inoue 		/* foreign host table entry */
8782cd038dSYoshinobu Inoue 		struct	in_addr_4in6 inp46_foreign;
8882cd038dSYoshinobu Inoue 		struct	in6_addr inp6_foreign;
8982cd038dSYoshinobu Inoue 	} inp_dependfaddr;
9082cd038dSYoshinobu Inoue 	union {
9182cd038dSYoshinobu Inoue 		/* local host table entry */
9282cd038dSYoshinobu Inoue 		struct	in_addr_4in6 inp46_local;
9382cd038dSYoshinobu Inoue 		struct	in6_addr inp6_local;
9482cd038dSYoshinobu Inoue 	} inp_dependladdr;
9582cd038dSYoshinobu Inoue 
96df8bae1dSRodney W. Grimes 	caddr_t	inp_ppcb;		/* pointer to per-protocol pcb */
97c3229e05SDavid Greenman 	struct	inpcbinfo *inp_pcbinfo;	/* PCB list info */
98ca98b82cSDavid Greenman 	struct	socket *inp_socket;	/* back pointer to socket */
9982cd038dSYoshinobu Inoue 					/* list for this PCB's local port */
100df8bae1dSRodney W. Grimes 	int	inp_flags;		/* generic IP/datagram flags */
10182cd038dSYoshinobu Inoue 
10282cd038dSYoshinobu Inoue 	/* protocol dependent part; cached route */
10382cd038dSYoshinobu Inoue 	union {
10482cd038dSYoshinobu Inoue 		/* placeholder for routing entry */
10582cd038dSYoshinobu Inoue 		struct	route inp4_route;
10682cd038dSYoshinobu Inoue 		struct	route_in6 inp6_route;
10782cd038dSYoshinobu Inoue 	} inp_dependroute;
10882cd038dSYoshinobu Inoue 
10982cd038dSYoshinobu Inoue 	struct	inpcbpolicy *inp_sp; /* for IPSEC */
11082cd038dSYoshinobu Inoue 	u_char	inp_vflag;
11182cd038dSYoshinobu Inoue #define	INP_IPV4	0x1
11282cd038dSYoshinobu Inoue #define	INP_IPV6	0x2
113ca98b82cSDavid Greenman 	u_char	inp_ip_ttl;		/* time to live proto */
114ca98b82cSDavid Greenman 	u_char	inp_ip_p;		/* protocol proto */
11582cd038dSYoshinobu Inoue 
11682cd038dSYoshinobu Inoue 	/* protocol dependent part; options */
11782cd038dSYoshinobu Inoue 	struct {
11882cd038dSYoshinobu Inoue 		u_char	inp4_ip_tos;		/* type of service proto */
11982cd038dSYoshinobu Inoue 		struct	mbuf *inp4_options;	/* IP options */
12082cd038dSYoshinobu Inoue 		struct	ip_moptions *inp4_moptions; /* IP multicast options */
12182cd038dSYoshinobu Inoue 	} inp_depend4;
12282cd038dSYoshinobu Inoue #define	inp_faddr	inp_dependfaddr.inp46_foreign.ia46_addr4
12382cd038dSYoshinobu Inoue #define	inp_laddr	inp_dependladdr.inp46_local.ia46_addr4
12482cd038dSYoshinobu Inoue #define	inp_route	inp_dependroute.inp4_route
12582cd038dSYoshinobu Inoue #define	inp_ip_tos	inp_depend4.inp4_ip_tos
12682cd038dSYoshinobu Inoue #define	inp_options	inp_depend4.inp4_options
12782cd038dSYoshinobu Inoue #define	inp_moptions	inp_depend4.inp4_moptions
12882cd038dSYoshinobu Inoue 	struct {
12982cd038dSYoshinobu Inoue 		/* IP options */
13082cd038dSYoshinobu Inoue 		struct	mbuf *inp6_options;
13182cd038dSYoshinobu Inoue 		/* IP6 options for outgoing packets */
13282cd038dSYoshinobu Inoue 		struct	ip6_pktopts *inp6_outputopts;
13382cd038dSYoshinobu Inoue 		/* IP multicast options */
13482cd038dSYoshinobu Inoue 		struct	ip6_moptions *inp6_moptions;
13582cd038dSYoshinobu Inoue 		/* ICMPv6 code type filter */
13682cd038dSYoshinobu Inoue 		struct	icmp6_filter *inp6_icmp6filt;
13782cd038dSYoshinobu Inoue 		/* IPV6_CHECKSUM setsockopt */
13882cd038dSYoshinobu Inoue 		int	inp6_cksum;
13982cd038dSYoshinobu Inoue 		u_short	inp6_ifindex;
14082cd038dSYoshinobu Inoue 		short	inp6_hops;
14182cd038dSYoshinobu Inoue 		u_int8_t	inp6_hlim;
14282cd038dSYoshinobu Inoue 	} inp_depend6;
143e3975643SJake Burkholder 	LIST_ENTRY(inpcb) inp_portlist;
1448781d8e9SBruce Evans 	struct	inpcbport *inp_phd;	/* head of this list */
14598271db4SGarrett Wollman 	inp_gen_t	inp_gencnt;	/* generation count of this instance */
14682cd038dSYoshinobu Inoue #define	in6p_faddr	inp_dependfaddr.inp6_foreign
14782cd038dSYoshinobu Inoue #define	in6p_laddr	inp_dependladdr.inp6_local
14882cd038dSYoshinobu Inoue #define	in6p_route	inp_dependroute.inp6_route
14982cd038dSYoshinobu Inoue #define	in6p_ip6_hlim	inp_depend6.inp6_hlim
15082cd038dSYoshinobu Inoue #define	in6p_hops	inp_depend6.inp6_hops	/* default hop limit */
15182cd038dSYoshinobu Inoue #define	in6p_ip6_nxt	inp_ip_p
15282cd038dSYoshinobu Inoue #define	in6p_flowinfo	inp_flow
15382cd038dSYoshinobu Inoue #define	in6p_vflag	inp_vflag
15482cd038dSYoshinobu Inoue #define	in6p_options	inp_depend6.inp6_options
15582cd038dSYoshinobu Inoue #define	in6p_outputopts	inp_depend6.inp6_outputopts
15682cd038dSYoshinobu Inoue #define	in6p_moptions	inp_depend6.inp6_moptions
15782cd038dSYoshinobu Inoue #define	in6p_icmp6filt	inp_depend6.inp6_icmp6filt
15882cd038dSYoshinobu Inoue #define	in6p_cksum	inp_depend6.inp6_cksum
15982cd038dSYoshinobu Inoue #define	inp6_ifindex	inp_depend6.inp6_ifindex
16082cd038dSYoshinobu Inoue #define	in6p_flags	inp_flags  /* for KAME src sync over BSD*'s */
16182cd038dSYoshinobu Inoue #define	in6p_socket	inp_socket  /* for KAME src sync over BSD*'s */
16282cd038dSYoshinobu Inoue #define	in6p_lport	inp_lport  /* for KAME src sync over BSD*'s */
16382cd038dSYoshinobu Inoue #define	in6p_fport	inp_fport  /* for KAME src sync over BSD*'s */
16482cd038dSYoshinobu Inoue #define	in6p_ppcb	inp_ppcb  /* for KAME src sync over BSD*'s */
165c3229e05SDavid Greenman };
1663d4d47f3SGarrett Wollman /*
1673d4d47f3SGarrett Wollman  * The range of the generation count, as used in this implementation,
1683d4d47f3SGarrett Wollman  * is 9e19.  We would have to create 300 billion connections per
1693d4d47f3SGarrett Wollman  * second for this number to roll over in a year.  This seems sufficiently
1703d4d47f3SGarrett Wollman  * unlikely that we simply don't concern ourselves with that possibility.
1713d4d47f3SGarrett Wollman  */
172c3229e05SDavid Greenman 
17398271db4SGarrett Wollman /*
17498271db4SGarrett Wollman  * Interface exported to userland by various protocols which use
17598271db4SGarrett Wollman  * inpcbs.  Hack alert -- only define if struct xsocket is in scope.
17698271db4SGarrett Wollman  */
17798271db4SGarrett Wollman #ifdef _SYS_SOCKETVAR_H_
17898271db4SGarrett Wollman struct	xinpcb {
17998271db4SGarrett Wollman 	size_t	xi_len;		/* length of this structure */
18098271db4SGarrett Wollman 	struct	inpcb xi_inp;
18198271db4SGarrett Wollman 	struct	xsocket xi_socket;
18298271db4SGarrett Wollman 	u_quad_t	xi_alignment_hack;
18398271db4SGarrett Wollman };
18498271db4SGarrett Wollman 
18598271db4SGarrett Wollman struct	xinpgen {
18698271db4SGarrett Wollman 	size_t	xig_len;	/* length of this structure */
18798271db4SGarrett Wollman 	u_int	xig_count;	/* number of PCBs at this time */
18898271db4SGarrett Wollman 	inp_gen_t xig_gen;	/* generation count at this time */
18998271db4SGarrett Wollman 	so_gen_t xig_sogen;	/* socket generation count at this time */
19098271db4SGarrett Wollman };
19198271db4SGarrett Wollman #endif /* _SYS_SOCKETVAR_H_ */
19298271db4SGarrett Wollman 
193c3229e05SDavid Greenman struct inpcbport {
194e3975643SJake Burkholder 	LIST_ENTRY(inpcbport) phd_hash;
195c3229e05SDavid Greenman 	struct inpcbhead phd_pcblist;
196c3229e05SDavid Greenman 	u_short phd_port;
197df8bae1dSRodney W. Grimes };
198df8bae1dSRodney W. Grimes 
1993d4d47f3SGarrett Wollman struct inpcbinfo {		/* XXX documentation, prefixes */
20015bd2b43SDavid Greenman 	struct	inpcbhead *hashbase;
2013d4d47f3SGarrett Wollman 	u_long	hashmask;
202c3229e05SDavid Greenman 	struct	inpcbporthead *porthashbase;
2033d4d47f3SGarrett Wollman 	u_long	porthashmask;
204c3229e05SDavid Greenman 	struct	inpcbhead *listhead;
2053d4d47f3SGarrett Wollman 	u_short	lastport;
2063d4d47f3SGarrett Wollman 	u_short	lastlow;
2073d4d47f3SGarrett Wollman 	u_short	lasthi;
2083d4d47f3SGarrett Wollman 	struct	vm_zone *ipi_zone; /* zone to allocate pcbs from */
2093d4d47f3SGarrett Wollman 	u_int	ipi_count;	/* number of pcbs in this list */
2103d4d47f3SGarrett Wollman 	u_quad_t ipi_gencnt;	/* current generation count */
21115bd2b43SDavid Greenman };
21215bd2b43SDavid Greenman 
213ddd79a97SDavid Greenman #define INP_PCBHASH(faddr, lport, fport, mask) \
214c3229e05SDavid Greenman 	(((faddr) ^ ((faddr) >> 16) ^ ntohs((lport) ^ (fport))) & (mask))
215c3229e05SDavid Greenman #define INP_PCBPORTHASH(lport, mask) \
216c3229e05SDavid Greenman 	(ntohs((lport)) & (mask))
217ddd79a97SDavid Greenman 
218df8bae1dSRodney W. Grimes /* flags in inp_flags: */
219df8bae1dSRodney W. Grimes #define	INP_RECVOPTS		0x01	/* receive incoming IP options */
220df8bae1dSRodney W. Grimes #define	INP_RECVRETOPTS		0x02	/* receive IP options for reply */
221df8bae1dSRodney W. Grimes #define	INP_RECVDSTADDR		0x04	/* receive IP dst address */
222df8bae1dSRodney W. Grimes #define	INP_HDRINCL		0x08	/* user supplies entire IP header */
22333b3ac06SPeter Wemm #define	INP_HIGHPORT		0x10	/* user wants "high" port binding */
22433b3ac06SPeter Wemm #define	INP_LOWPORT		0x20	/* user wants "low" port binding */
225321a2846SPoul-Henning Kamp #define	INP_ANONPORT		0x40	/* port chosen for user */
22682c23ebaSBill Fenner #define	INP_RECVIF		0x80	/* receive incoming interface */
22757bf258eSGarrett Wollman #define	INP_MTUDISC		0x100	/* user can do MTU discovery */
22882cd038dSYoshinobu Inoue #define	INP_FAITH		0x200	/* accept FAITH'ed connections */
22933841545SHajimu UMEMOTO 
23033841545SHajimu UMEMOTO #define IN6P_IPV6_V6ONLY	0x008000 /* restrict AF_INET6 socket for v6 */
23133841545SHajimu UMEMOTO 
23233841545SHajimu UMEMOTO #define	IN6P_PKTINFO		0x010000 /* receive IP6 dst and I/F */
23333841545SHajimu UMEMOTO #define	IN6P_HOPLIMIT		0x020000 /* receive hoplimit */
23433841545SHajimu UMEMOTO #define	IN6P_HOPOPTS		0x040000 /* receive hop-by-hop options */
23533841545SHajimu UMEMOTO #define	IN6P_DSTOPTS		0x080000 /* receive dst options after rthdr */
23633841545SHajimu UMEMOTO #define	IN6P_RTHDR		0x100000 /* receive routing header */
23733841545SHajimu UMEMOTO #define	IN6P_RTHDRDSTOPTS	0x200000 /* receive dstoptions before rthdr */
23833841545SHajimu UMEMOTO #define IN6P_AUTOFLOWLABEL	0x800000 /* attach flowlabel automatically */
23933841545SHajimu UMEMOTO #define	IN6P_BINDV6ONLY		0x10000000 /* do not grab IPv4 traffic */
24033841545SHajimu UMEMOTO 
24182c23ebaSBill Fenner #define	INP_CONTROLOPTS		(INP_RECVOPTS|INP_RECVRETOPTS|INP_RECVDSTADDR|\
24282cd038dSYoshinobu Inoue 					INP_RECVIF|\
24333841545SHajimu UMEMOTO 				 IN6P_PKTINFO|IN6P_HOPLIMIT|IN6P_HOPOPTS|\
24433841545SHajimu UMEMOTO 				 IN6P_DSTOPTS|IN6P_RTHDR|IN6P_RTHDRDSTOPTS|\
24533841545SHajimu UMEMOTO 				 IN6P_AUTOFLOWLABEL)
24633841545SHajimu UMEMOTO #define	INP_UNMAPPABLEOPTS	(IN6P_HOPOPTS|IN6P_DSTOPTS|IN6P_RTHDR|\
24733841545SHajimu UMEMOTO 				 IN6P_AUTOFLOWLABEL)
24882cd038dSYoshinobu Inoue 
24982cd038dSYoshinobu Inoue  /* for KAME src sync over BSD*'s */
25082cd038dSYoshinobu Inoue #define	IN6P_HIGHPORT		INP_HIGHPORT
25182cd038dSYoshinobu Inoue #define	IN6P_LOWPORT		INP_LOWPORT
25282cd038dSYoshinobu Inoue #define	IN6P_ANONPORT		INP_ANONPORT
25382cd038dSYoshinobu Inoue #define	IN6P_RECVIF		INP_RECVIF
25482cd038dSYoshinobu Inoue #define	IN6P_MTUDISC		INP_MTUDISC
25582cd038dSYoshinobu Inoue #define	IN6P_FAITH		INP_FAITH
25682cd038dSYoshinobu Inoue #define	IN6P_CONTROLOPTS INP_CONTROLOPTS
25782cd038dSYoshinobu Inoue 	/*
25882cd038dSYoshinobu Inoue 	 * socket AF version is {newer than,or include}
25982cd038dSYoshinobu Inoue 	 * actual datagram AF version
26082cd038dSYoshinobu Inoue 	 */
261df8bae1dSRodney W. Grimes 
262df8bae1dSRodney W. Grimes #define	INPLOOKUP_WILDCARD	1
263df8bae1dSRodney W. Grimes #define	sotoinpcb(so)	((struct inpcb *)(so)->so_pcb)
26482cd038dSYoshinobu Inoue #define	sotoin6pcb(so)	sotoinpcb(so) /* for KAME src sync over BSD*'s */
26582cd038dSYoshinobu Inoue 
26682cd038dSYoshinobu Inoue #define	INP_SOCKAF(so) so->so_proto->pr_domain->dom_family
26782cd038dSYoshinobu Inoue 
26882cd038dSYoshinobu Inoue #define	INP_CHECK_SOCKAF(so, af) 	(INP_SOCKAF(so) == af)
269df8bae1dSRodney W. Grimes 
270664a31e4SPeter Wemm #ifdef _KERNEL
27182cd038dSYoshinobu Inoue extern int	ipport_lowfirstauto;
27282cd038dSYoshinobu Inoue extern int	ipport_lowlastauto;
27382cd038dSYoshinobu Inoue extern int	ipport_firstauto;
27482cd038dSYoshinobu Inoue extern int	ipport_lastauto;
27582cd038dSYoshinobu Inoue extern int	ipport_hifirstauto;
27682cd038dSYoshinobu Inoue extern int	ipport_hilastauto;
27782cd038dSYoshinobu Inoue 
27826f9a767SRodney W. Grimes void	in_losing __P((struct inpcb *));
279d1c54148SJesper Skriver void	in_rtchange __P((struct inpcb *, int));
280a29f300eSGarrett Wollman int	in_pcballoc __P((struct socket *, struct inpcbinfo *, struct proc *));
28157bf258eSGarrett Wollman int	in_pcbbind __P((struct inpcb *, struct sockaddr *, struct proc *));
28257bf258eSGarrett Wollman int	in_pcbconnect __P((struct inpcb *, struct sockaddr *, struct proc *));
28326f9a767SRodney W. Grimes void	in_pcbdetach __P((struct inpcb *));
28426f9a767SRodney W. Grimes void	in_pcbdisconnect __P((struct inpcb *));
285c3229e05SDavid Greenman int	in_pcbinshash __P((struct inpcb *));
28657bf258eSGarrett Wollman int	in_pcbladdr __P((struct inpcb *, struct sockaddr *,
287b5e8ce9fSBruce Evans 	    struct sockaddr_in **));
288df8bae1dSRodney W. Grimes struct inpcb *
289c3229e05SDavid Greenman 	in_pcblookup_local __P((struct inpcbinfo *,
290c3229e05SDavid Greenman 	    struct in_addr, u_int, int));
29115bd2b43SDavid Greenman struct inpcb *
292c3229e05SDavid Greenman 	in_pcblookup_hash __P((struct inpcbinfo *,
293cfa1ca9dSYoshinobu Inoue 			       struct in_addr, u_int, struct in_addr, u_int,
294cfa1ca9dSYoshinobu Inoue 			       int, struct ifnet *));
295c693a045SJonathan Lemon void	in_pcbnotifyall __P((struct inpcbhead *, struct in_addr,
296d1c54148SJesper Skriver 	    int, void (*)(struct inpcb *, int)));
29715bd2b43SDavid Greenman void	in_pcbrehash __P((struct inpcb *));
29857bf258eSGarrett Wollman int	in_setpeeraddr __P((struct socket *so, struct sockaddr **nam));
29957bf258eSGarrett Wollman int	in_setsockaddr __P((struct socket *so, struct sockaddr **nam));
30076429de4SYoshinobu Inoue void	in_pcbremlists __P((struct inpcb *inp));
30175c13541SPoul-Henning Kamp int	prison_xinpcb __P((struct proc *p, struct inpcb *inp));
302664a31e4SPeter Wemm #endif /* _KERNEL */
3033d4d47f3SGarrett Wollman 
3048781d8e9SBruce Evans #endif /* !_NETINET_IN_PCB_H_ */
305