xref: /original-bsd/sys/netns/ns_pcb.h (revision 6884d44a)
1 /*
2  * Copyright (c) 1984, 1985, 1986, 1987 Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)ns_pcb.h	7.4 (Berkeley) 06/28/90
8  */
9 
10 /*
11  * Ns protocol interface control block.
12  */
13 struct nspcb {
14 	struct	nspcb *nsp_next;	/* doubly linked list */
15 	struct	nspcb *nsp_prev;
16 	struct	nspcb *nsp_head;
17 	struct	socket *nsp_socket;	/* back pointer to socket */
18 	struct	ns_addr nsp_faddr;	/* destination address */
19 	struct	ns_addr nsp_laddr;	/* socket's address */
20 	caddr_t	nsp_pcb;		/* protocol specific stuff */
21 	struct	route nsp_route;	/* routing information */
22 	struct	ns_addr nsp_lastdst;	/* validate cached route for dg socks*/
23 	long	nsp_notify_param;	/* extra info passed via ns_pcbnotify*/
24 	short	nsp_flags;
25 	u_char	nsp_dpt;		/* default packet type for idp_output*/
26 	u_char	nsp_rpt;		/* last received packet type by
27 								idp_input() */
28 };
29 
30 /* possible flags */
31 
32 #define NSP_IN_ABORT	0x1		/* calling abort through socket */
33 #define NSP_RAWIN	0x2		/* show headers on input */
34 #define NSP_RAWOUT	0x4		/* show header on output */
35 #define NSP_ALL_PACKETS	0x8		/* Turn off higher proto processing */
36 
37 #define	NS_WILDCARD	1
38 
39 #define nsp_lport nsp_laddr.x_port
40 #define nsp_fport nsp_faddr.x_port
41 
42 #define	sotonspcb(so)		((struct nspcb *)((so)->so_pcb))
43 
44 /*
45  * Nominal space allocated to a ns socket.
46  */
47 #define	NSSNDQ		2048
48 #define	NSRCVQ		2048
49 
50 
51 #ifdef KERNEL
52 struct	nspcb nspcb;			/* head of list */
53 struct	nspcb *ns_pcblookup();
54 #endif
55