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