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