xref: /illumos-gate/usr/src/uts/common/netinet/in_pcb.h (revision 42b53e0fbc5c05289c3d334bb864b784fafe5ce4)
1 /*
2  * Copyright (c) 1997-1998 by Sun Microsystems, Inc.
3  * All rights reserved.
4  */
5 
6 /*
7  * Copyright (c) 1982, 1986 Regents of the University of California.
8  * All rights reserved.  The Berkeley software License Agreement
9  * specifies the terms and conditions for redistribution.
10  */
11 
12 /*
13  * Common structure pcb for internet protocol implementation.
14  * Here are stored pointers to local and foreign host table
15  * entries, local and foreign socket numbers, and pointers
16  * up (to a socket structure) and down (to a protocol-specific)
17  * control block.
18  */
19 
20 #ifndef	_NETINET_IN_PCB_H
21 #define	_NETINET_IN_PCB_H
22 
23 /* in_pcb.h 1.7 88/08/19 SMI; from UCB 7.1 6/5/86	*/
24 
25 #ifdef	__cplusplus
26 extern "C" {
27 #endif
28 
29 struct inpcb {
30 	struct	inpcb *inp_next, *inp_prev;	/* pointers to other pcb's */
31 	struct	inpcb *inp_head;	/* pointer back to chain of inpcb's */
32 					/* for this protocol */
33 	struct	in_addr inp_faddr;	/* foreign host table entry */
34 	ushort_t inp_fport;		/* foreign port */
35 	struct	in_addr inp_laddr;	/* local host table entry */
36 	ushort_t inp_lport;		/* local port */
37 	struct	socket *inp_socket;	/* back pointer to socket */
38 	caddr_t	inp_ppcb;		/* pointer to per-protocol pcb */
39 	struct	route inp_route;	/* placeholder for routing entry */
40 	struct	mbuf *inp_options;	/* IP options */
41 };
42 
43 #define	INPLOOKUP_WILDCARD	1
44 #define	INPLOOKUP_SETLOCAL	2
45 
46 #define	sotoinpcb(so)	((struct inpcb *)(so)->so_pcb)
47 
48 #ifdef	__cplusplus
49 }
50 #endif
51 
52 #endif	/* _NETINET_IN_PCB_H */
53