xref: /original-bsd/sys/net/raw_cb.h (revision 3705696b)
1 /*
2  * Copyright (c) 1980, 1986, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)raw_cb.h	8.1 (Berkeley) 06/10/93
8  */
9 
10 /*
11  * Raw protocol interface control block.  Used
12  * to tie a socket to the generic raw interface.
13  */
14 struct rawcb {
15 	struct	rawcb *rcb_next;	/* doubly linked list */
16 	struct	rawcb *rcb_prev;
17 	struct	socket *rcb_socket;	/* back pointer to socket */
18 	struct	sockaddr *rcb_faddr;	/* destination address */
19 	struct	sockaddr *rcb_laddr;	/* socket's address */
20 	struct	sockproto rcb_proto;	/* protocol family, protocol */
21 };
22 
23 #define	sotorawcb(so)		((struct rawcb *)(so)->so_pcb)
24 
25 /*
26  * Nominal space allocated to a raw socket.
27  */
28 #define	RAWSNDQ		8192
29 #define	RAWRCVQ		8192
30 
31 #ifdef KERNEL
32 struct rawcb rawcb;			/* head of list */
33 
34 int	 raw_attach __P((struct socket *, int));
35 void	 raw_ctlinput __P((int, struct sockaddr *));
36 void	 raw_detach __P((struct rawcb *));
37 void	 raw_disconnect __P((struct rawcb *));
38 void	 raw_init __P((void));
39 void	 raw_input __P((struct mbuf *,
40 	    struct sockproto *, struct sockaddr *, struct sockaddr *));
41 int	 raw_usrreq __P((struct socket *,
42 	    int, struct mbuf *, struct mbuf *, struct mbuf *));
43 #endif
44