xref: /csrg-svn/sys/net/raw_cb.h (revision 13451)
1*13451Ssam /*	raw_cb.h	4.5	83/06/30	*/
25634Sroot 
35634Sroot /*
45634Sroot  * Raw protocol interface control block.  Used
55634Sroot  * to tie a socket to the generic raw interface.
65634Sroot  */
75634Sroot struct rawcb {
85634Sroot 	struct	rawcb *rcb_next;	/* doubly linked list */
95634Sroot 	struct	rawcb *rcb_prev;
105634Sroot 	struct	socket *rcb_socket;	/* back pointer to socket */
116509Ssam 	struct	sockaddr rcb_faddr;	/* destination address */
126509Ssam 	struct	sockaddr rcb_laddr;	/* socket's address */
135634Sroot 	caddr_t	rcb_pcb;		/* protocol specific stuff */
14*13451Ssam 	struct	route rcb_route;	/* routing information */
155634Sroot 	short	rcb_flags;
165634Sroot };
175634Sroot 
185634Sroot /*
195634Sroot  * Since we can't interpret canonical addresses,
205634Sroot  * we mark an address present in the flags field.
215634Sroot  */
226509Ssam #define	RAW_LADDR	01
236509Ssam #define	RAW_FADDR	02
24*13451Ssam #define	RAW_DONTROUTE	04		/* no routing, default */
255634Sroot 
265634Sroot #define	sotorawcb(so)		((struct rawcb *)(so)->so_pcb)
275634Sroot 
285634Sroot /*
295634Sroot  * Nominal space allocated to a raw socket.
305634Sroot  */
315634Sroot #define	RAWSNDQ		2048
325634Sroot #define	RAWRCVQ		2048
335634Sroot 
345634Sroot /*
355667Ssam  * Format of raw interface header prepended by
365667Ssam  * raw_input after call from protocol specific
375667Ssam  * input routine.
385634Sroot  */
395634Sroot struct raw_header {
406509Ssam 	struct	sockproto raw_proto;	/* format of packet */
415646Ssam 	struct	sockaddr raw_dst;	/* dst address for rawintr */
425646Ssam 	struct	sockaddr raw_src;	/* src address for sbappendaddr */
435634Sroot };
445634Sroot 
455634Sroot #ifdef KERNEL
465634Sroot struct rawcb rawcb;			/* head of list */
475634Sroot #endif
48