123161Smckusick /* 2*29067Smckusick * Copyright (c) 1980, 1986 Regents of the University of California. 323161Smckusick * All rights reserved. The Berkeley software License Agreement 423161Smckusick * specifies the terms and conditions for redistribution. 523161Smckusick * 6*29067Smckusick * @(#)raw_cb.h 7.1 (Berkeley) 06/04/86 723161Smckusick */ 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 */ 2126035Skarels struct mbuf *rcb_options; /* protocol specific options */ 2213451Ssam struct route rcb_route; /* routing information */ 235634Sroot short rcb_flags; 245634Sroot }; 255634Sroot 265634Sroot /* 275634Sroot * Since we can't interpret canonical addresses, 285634Sroot * we mark an address present in the flags field. 295634Sroot */ 306509Ssam #define RAW_LADDR 01 316509Ssam #define RAW_FADDR 02 3213451Ssam #define RAW_DONTROUTE 04 /* no routing, default */ 335634Sroot 345634Sroot #define sotorawcb(so) ((struct rawcb *)(so)->so_pcb) 355634Sroot 365634Sroot /* 375634Sroot * Nominal space allocated to a raw socket. 385634Sroot */ 395634Sroot #define RAWSNDQ 2048 405634Sroot #define RAWRCVQ 2048 415634Sroot 425634Sroot /* 435667Ssam * Format of raw interface header prepended by 445667Ssam * raw_input after call from protocol specific 455667Ssam * input routine. 465634Sroot */ 475634Sroot struct raw_header { 486509Ssam struct sockproto raw_proto; /* format of packet */ 495646Ssam struct sockaddr raw_dst; /* dst address for rawintr */ 505646Ssam struct sockaddr raw_src; /* src address for sbappendaddr */ 515634Sroot }; 525634Sroot 535634Sroot #ifdef KERNEL 545634Sroot struct rawcb rawcb; /* head of list */ 555634Sroot #endif 56