xref: /csrg-svn/sys/net/raw_cb.h (revision 36824)
123161Smckusick /*
229067Smckusick  * Copyright (c) 1980, 1986 Regents of the University of California.
333183Sbostic  * All rights reserved.
423161Smckusick  *
533183Sbostic  * Redistribution and use in source and binary forms are permitted
634844Sbostic  * provided that the above copyright notice and this paragraph are
734844Sbostic  * duplicated in all such forms and that any documentation,
834844Sbostic  * advertising materials, and other materials related to such
934844Sbostic  * distribution and use acknowledge that the software was developed
1034844Sbostic  * by the University of California, Berkeley.  The name of the
1134844Sbostic  * University may not be used to endorse or promote products derived
1234844Sbostic  * from this software without specific prior written permission.
1334844Sbostic  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
1434844Sbostic  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
1534844Sbostic  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
1633183Sbostic  *
17*36824Skarels  *	@(#)raw_cb.h	7.4 (Berkeley) 02/17/89
1823161Smckusick  */
195634Sroot 
205634Sroot /*
215634Sroot  * Raw protocol interface control block.  Used
225634Sroot  * to tie a socket to the generic raw interface.
235634Sroot  */
245634Sroot struct rawcb {
255634Sroot 	struct	rawcb *rcb_next;	/* doubly linked list */
265634Sroot 	struct	rawcb *rcb_prev;
275634Sroot 	struct	socket *rcb_socket;	/* back pointer to socket */
286509Ssam 	struct	sockaddr rcb_faddr;	/* destination address */
296509Ssam 	struct	sockaddr rcb_laddr;	/* socket's address */
3021769Skarels 	struct	sockproto rcb_proto;	/* protocol family, protocol */
315634Sroot 	caddr_t	rcb_pcb;		/* protocol specific stuff */
3226035Skarels 	struct	mbuf *rcb_options;	/* protocol specific options */
3313451Ssam 	struct	route rcb_route;	/* routing information */
345634Sroot 	short	rcb_flags;
355634Sroot };
365634Sroot 
375634Sroot /*
385634Sroot  * Since we can't interpret canonical addresses,
395634Sroot  * we mark an address present in the flags field.
405634Sroot  */
416509Ssam #define	RAW_LADDR	01
426509Ssam #define	RAW_FADDR	02
4313451Ssam #define	RAW_DONTROUTE	04		/* no routing, default */
445634Sroot 
455634Sroot #define	sotorawcb(so)		((struct rawcb *)(so)->so_pcb)
465634Sroot 
475634Sroot /*
485634Sroot  * Nominal space allocated to a raw socket.
495634Sroot  */
50*36824Skarels #define	RAWSNDQ		8192
51*36824Skarels #define	RAWRCVQ		8192
525634Sroot 
535634Sroot /*
545667Ssam  * Format of raw interface header prepended by
555667Ssam  * raw_input after call from protocol specific
565667Ssam  * input routine.
575634Sroot  */
585634Sroot struct raw_header {
596509Ssam 	struct	sockproto raw_proto;	/* format of packet */
605646Ssam 	struct	sockaddr raw_dst;	/* dst address for rawintr */
615646Ssam 	struct	sockaddr raw_src;	/* src address for sbappendaddr */
625634Sroot };
635634Sroot 
645634Sroot #ifdef KERNEL
655634Sroot struct rawcb rawcb;			/* head of list */
665634Sroot #endif
67