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) 06/08/85 7 */ 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 */ 17 struct sockaddr rcb_faddr; /* destination address */ 18 struct sockaddr rcb_laddr; /* socket's address */ 19 struct sockproto rcb_proto; /* protocol family, protocol */ 20 caddr_t rcb_pcb; /* protocol specific stuff */ 21 struct route rcb_route; /* routing information */ 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 */ 29 #define RAW_LADDR 01 30 #define RAW_FADDR 02 31 #define RAW_DONTROUTE 04 /* no routing, default */ 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 /* 42 * Format of raw interface header prepended by 43 * raw_input after call from protocol specific 44 * input routine. 45 */ 46 struct raw_header { 47 struct sockproto raw_proto; /* format of packet */ 48 struct sockaddr raw_dst; /* dst address for rawintr */ 49 struct sockaddr raw_src; /* src address for sbappendaddr */ 50 }; 51 52 #ifdef KERNEL 53 struct rawcb rawcb; /* head of list */ 54 #endif 55