xref: /titanic_41/usr/src/uts/common/netinet/in_pcb.h (revision 581cede61ac9c14d8d4ea452562a567189eead78)
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 #pragma ident	"%Z%%M%	%I%	%E% SMI"
24 /* in_pcb.h 1.7 88/08/19 SMI; from UCB 7.1 6/5/86	*/
25 
26 #ifdef	__cplusplus
27 extern "C" {
28 #endif
29 
30 struct inpcb {
31 	struct	inpcb *inp_next, *inp_prev;	/* pointers to other pcb's */
32 	struct	inpcb *inp_head;	/* pointer back to chain of inpcb's */
33 					/* for this protocol */
34 	struct	in_addr inp_faddr;	/* foreign host table entry */
35 	ushort_t inp_fport;		/* foreign port */
36 	struct	in_addr inp_laddr;	/* local host table entry */
37 	ushort_t inp_lport;		/* local port */
38 	struct	socket *inp_socket;	/* back pointer to socket */
39 	caddr_t	inp_ppcb;		/* pointer to per-protocol pcb */
40 	struct	route inp_route;	/* placeholder for routing entry */
41 	struct	mbuf *inp_options;	/* IP options */
42 };
43 
44 #define	INPLOOKUP_WILDCARD	1
45 #define	INPLOOKUP_SETLOCAL	2
46 
47 #define	sotoinpcb(so)	((struct inpcb *)(so)->so_pcb)
48 
49 #ifdef	__cplusplus
50 }
51 #endif
52 
53 #endif	/* _NETINET_IN_PCB_H */
54