xref: /csrg-svn/sys/net/raw_cb.h (revision 5634)
1*5634Sroot /*	raw_cb.h	4.1	82/02/01	*/
2*5634Sroot 
3*5634Sroot /*
4*5634Sroot  * Raw protocol interface control block.  Used
5*5634Sroot  * to tie a socket to the generic raw interface.
6*5634Sroot  */
7*5634Sroot struct rawcb {
8*5634Sroot 	struct	rawcb *rcb_next;	/* doubly linked list */
9*5634Sroot 	struct	rawcb *rcb_prev;
10*5634Sroot 	struct	socket *rcb_socket;	/* back pointer to socket */
11*5634Sroot 	struct	sockaddr rcb_addr;	/* destination address */
12*5634Sroot 	caddr_t	rcb_pcb;		/* protocol specific stuff */
13*5634Sroot 	short	rcb_flags;
14*5634Sroot };
15*5634Sroot 
16*5634Sroot /*
17*5634Sroot  * Since we can't interpret canonical addresses,
18*5634Sroot  * we mark an address present in the flags field.
19*5634Sroot  */
20*5634Sroot #define	RAW_ADDR	01		/* got an address */
21*5634Sroot 
22*5634Sroot #define	sotorawcb(so)		((struct rawcb *)(so)->so_pcb)
23*5634Sroot 
24*5634Sroot /*
25*5634Sroot  * Nominal space allocated to a raw socket.
26*5634Sroot  */
27*5634Sroot #define	RAWSNDQ		2048
28*5634Sroot #define	RAWRCVQ		2048
29*5634Sroot 
30*5634Sroot /*
31*5634Sroot  * Format of raw interface header appended by
32*5634Sroot  * raw_input after call from protocol specific input routine.
33*5634Sroot  */
34*5634Sroot struct raw_header {
35*5634Sroot 	struct	sockproto raw_protocol;
36*5634Sroot 	struct	sockaddr raw_address;
37*5634Sroot };
38*5634Sroot 
39*5634Sroot #ifdef KERNEL
40*5634Sroot struct rawcb rawcb;			/* head of list */
41*5634Sroot #endif
42