Commit | Line | Data |
---|---|---|
cb1c44c2 | 1 | /* |
1810611d | 2 | * Copyright (c) 1980, 1986 Regents of the University of California. |
5b519e94 | 3 | * All rights reserved. |
cb1c44c2 | 4 | * |
5b519e94 KB |
5 | * Redistribution and use in source and binary forms are permitted |
6 | * provided that this notice is preserved and that due credit is given | |
7 | * to the University of California at Berkeley. The name of the University | |
8 | * may not be used to endorse or promote products derived from this | |
9 | * software without specific prior written permission. This software | |
10 | * is provided ``as is'' without express or implied warranty. | |
11 | * | |
12 | * @(#)raw_cb.h 7.2 (Berkeley) %G% | |
cb1c44c2 | 13 | */ |
16287509 BJ |
14 | |
15 | /* | |
16 | * Raw protocol interface control block. Used | |
17 | * to tie a socket to the generic raw interface. | |
18 | */ | |
19 | struct rawcb { | |
20 | struct rawcb *rcb_next; /* doubly linked list */ | |
21 | struct rawcb *rcb_prev; | |
22 | struct socket *rcb_socket; /* back pointer to socket */ | |
126472ab SL |
23 | struct sockaddr rcb_faddr; /* destination address */ |
24 | struct sockaddr rcb_laddr; /* socket's address */ | |
829f867e | 25 | struct sockproto rcb_proto; /* protocol family, protocol */ |
16287509 | 26 | caddr_t rcb_pcb; /* protocol specific stuff */ |
82acad77 | 27 | struct mbuf *rcb_options; /* protocol specific options */ |
71fb71a3 | 28 | struct route rcb_route; /* routing information */ |
16287509 BJ |
29 | short rcb_flags; |
30 | }; | |
31 | ||
32 | /* | |
33 | * Since we can't interpret canonical addresses, | |
34 | * we mark an address present in the flags field. | |
35 | */ | |
126472ab SL |
36 | #define RAW_LADDR 01 |
37 | #define RAW_FADDR 02 | |
71fb71a3 | 38 | #define RAW_DONTROUTE 04 /* no routing, default */ |
16287509 BJ |
39 | |
40 | #define sotorawcb(so) ((struct rawcb *)(so)->so_pcb) | |
41 | ||
42 | /* | |
43 | * Nominal space allocated to a raw socket. | |
44 | */ | |
45 | #define RAWSNDQ 2048 | |
46 | #define RAWRCVQ 2048 | |
47 | ||
48 | /* | |
a7d16889 SL |
49 | * Format of raw interface header prepended by |
50 | * raw_input after call from protocol specific | |
51 | * input routine. | |
16287509 BJ |
52 | */ |
53 | struct raw_header { | |
126472ab | 54 | struct sockproto raw_proto; /* format of packet */ |
faad37c0 SL |
55 | struct sockaddr raw_dst; /* dst address for rawintr */ |
56 | struct sockaddr raw_src; /* src address for sbappendaddr */ | |
16287509 BJ |
57 | }; |
58 | ||
59 | #ifdef KERNEL | |
60 | struct rawcb rawcb; /* head of list */ | |
61 | #endif |