Commit | Line | Data |
---|---|---|
cb1c44c2 KM |
1 | /* |
2 | * Copyright (c) 1980 Regents of the University of California. | |
3 | * All rights reserved. The Berkeley software License Agreement | |
4 | * specifies the terms and conditions for redistribution. | |
5 | * | |
6 | * @(#)raw_cb.h 6.3 (Berkeley) %G% | |
7 | */ | |
16287509 BJ |
8 | |
9 | /* | |
10 | * Raw protocol interface control block. Used | |
11 | * to tie a socket to the generic raw interface. | |
12 | */ | |
13 | struct rawcb { | |
14 | struct rawcb *rcb_next; /* doubly linked list */ | |
15 | struct rawcb *rcb_prev; | |
16 | struct socket *rcb_socket; /* back pointer to socket */ | |
126472ab SL |
17 | struct sockaddr rcb_faddr; /* destination address */ |
18 | struct sockaddr rcb_laddr; /* socket's address */ | |
829f867e | 19 | struct sockproto rcb_proto; /* protocol family, protocol */ |
16287509 | 20 | caddr_t rcb_pcb; /* protocol specific stuff */ |
71fb71a3 | 21 | struct route rcb_route; /* routing information */ |
16287509 BJ |
22 | short rcb_flags; |
23 | }; | |
24 | ||
25 | /* | |
26 | * Since we can't interpret canonical addresses, | |
27 | * we mark an address present in the flags field. | |
28 | */ | |
126472ab SL |
29 | #define RAW_LADDR 01 |
30 | #define RAW_FADDR 02 | |
71fb71a3 | 31 | #define RAW_DONTROUTE 04 /* no routing, default */ |
16287509 BJ |
32 | |
33 | #define sotorawcb(so) ((struct rawcb *)(so)->so_pcb) | |
34 | ||
35 | /* | |
36 | * Nominal space allocated to a raw socket. | |
37 | */ | |
38 | #define RAWSNDQ 2048 | |
39 | #define RAWRCVQ 2048 | |
40 | ||
41 | /* | |
a7d16889 SL |
42 | * Format of raw interface header prepended by |
43 | * raw_input after call from protocol specific | |
44 | * input routine. | |
16287509 BJ |
45 | */ |
46 | struct raw_header { | |
126472ab | 47 | struct sockproto raw_proto; /* format of packet */ |
faad37c0 SL |
48 | struct sockaddr raw_dst; /* dst address for rawintr */ |
49 | struct sockaddr raw_src; /* src address for sbappendaddr */ | |
16287509 BJ |
50 | }; |
51 | ||
52 | #ifdef KERNEL | |
53 | struct rawcb rawcb; /* head of list */ | |
54 | #endif |