1*23161Smckusick /* 2*23161Smckusick * Copyright (c) 1980 Regents of the University of California. 3*23161Smckusick * All rights reserved. The Berkeley software License Agreement 4*23161Smckusick * specifies the terms and conditions for redistribution. 5*23161Smckusick * 6*23161Smckusick * @(#)raw_cb.h 6.3 (Berkeley) 06/08/85 7*23161Smckusick */ 85634Sroot 95634Sroot /* 105634Sroot * Raw protocol interface control block. Used 115634Sroot * to tie a socket to the generic raw interface. 125634Sroot */ 135634Sroot struct rawcb { 145634Sroot struct rawcb *rcb_next; /* doubly linked list */ 155634Sroot struct rawcb *rcb_prev; 165634Sroot struct socket *rcb_socket; /* back pointer to socket */ 176509Ssam struct sockaddr rcb_faddr; /* destination address */ 186509Ssam struct sockaddr rcb_laddr; /* socket's address */ 1921769Skarels struct sockproto rcb_proto; /* protocol family, protocol */ 205634Sroot caddr_t rcb_pcb; /* protocol specific stuff */ 2113451Ssam struct route rcb_route; /* routing information */ 225634Sroot short rcb_flags; 235634Sroot }; 245634Sroot 255634Sroot /* 265634Sroot * Since we can't interpret canonical addresses, 275634Sroot * we mark an address present in the flags field. 285634Sroot */ 296509Ssam #define RAW_LADDR 01 306509Ssam #define RAW_FADDR 02 3113451Ssam #define RAW_DONTROUTE 04 /* no routing, default */ 325634Sroot 335634Sroot #define sotorawcb(so) ((struct rawcb *)(so)->so_pcb) 345634Sroot 355634Sroot /* 365634Sroot * Nominal space allocated to a raw socket. 375634Sroot */ 385634Sroot #define RAWSNDQ 2048 395634Sroot #define RAWRCVQ 2048 405634Sroot 415634Sroot /* 425667Ssam * Format of raw interface header prepended by 435667Ssam * raw_input after call from protocol specific 445667Ssam * input routine. 455634Sroot */ 465634Sroot struct raw_header { 476509Ssam struct sockproto raw_proto; /* format of packet */ 485646Ssam struct sockaddr raw_dst; /* dst address for rawintr */ 495646Ssam struct sockaddr raw_src; /* src address for sbappendaddr */ 505634Sroot }; 515634Sroot 525634Sroot #ifdef KERNEL 535634Sroot struct rawcb rawcb; /* head of list */ 545634Sroot #endif 55