xref: /csrg-svn/sys/netns/ns_pcb.h (revision 21490)
1 /*      ns_pcb.h     6.1     85/05/30     */
2 
3 /*
4  * Ns protocol interface control block.
5  */
6 struct nspcb {
7 	struct	nspcb *nsp_next;	/* doubly linked list */
8 	struct	nspcb *nsp_prev;
9 	struct	nspcb *nsp_head;
10 	struct	socket *nsp_socket;	/* back pointer to socket */
11 	struct	ns_addr nsp_faddr;	/* destination address */
12 	struct	ns_addr nsp_laddr;	/* socket's address */
13 	caddr_t	nsp_pcb;		/* protocol specific stuff */
14 	struct	route nsp_route;	/* routing information */
15 	union	ns_net nsp_lastnet;	/* validate cached route for dg socks*/
16 	long	nsp_notify_param;	/* extra info passed via ns_pcbnotify*/
17 	short	nsp_flags;
18 	u_char	nsp_dpt;		/* default packet type for idp_output*/
19 	u_char	nsp_rpt;		/* last received packet type by
20 								idp_input() */
21 };
22 
23 /* possible flags */
24 
25 #define NSP_IN_ABORT	0x1		/* calling abort through socket */
26 #define NSP_RAWIN	0x2		/* show headers on input */
27 #define NSP_RAWOUT	0x4		/* show header on output */
28 
29 #define	NS_WILDCARD	1
30 
31 #define nsp_lport nsp_laddr.x_port
32 #define nsp_fport nsp_faddr.x_port
33 
34 #define	sotonspcb(so)		((struct nspcb *)((so)->so_pcb))
35 
36 /*
37  * Nominal space allocated to a ns socket.
38  */
39 #define	NSSNDQ		2048
40 #define	NSRCVQ		2048
41 
42 
43 #ifdef KERNEL
44 extern struct nspcb nspcb;			/* head of list */
45 extern struct nspcb *ns_pcblookup();
46 #endif
47