123161Smckusick /* 229067Smckusick * Copyright (c) 1980, 1986 Regents of the University of California. 3*33183Sbostic * All rights reserved. 423161Smckusick * 5*33183Sbostic * Redistribution and use in source and binary forms are permitted 6*33183Sbostic * provided that this notice is preserved and that due credit is given 7*33183Sbostic * to the University of California at Berkeley. The name of the University 8*33183Sbostic * may not be used to endorse or promote products derived from this 9*33183Sbostic * software without specific prior written permission. This software 10*33183Sbostic * is provided ``as is'' without express or implied warranty. 11*33183Sbostic * 12*33183Sbostic * @(#)raw_cb.h 7.2 (Berkeley) 12/30/87 1323161Smckusick */ 145634Sroot 155634Sroot /* 165634Sroot * Raw protocol interface control block. Used 175634Sroot * to tie a socket to the generic raw interface. 185634Sroot */ 195634Sroot struct rawcb { 205634Sroot struct rawcb *rcb_next; /* doubly linked list */ 215634Sroot struct rawcb *rcb_prev; 225634Sroot struct socket *rcb_socket; /* back pointer to socket */ 236509Ssam struct sockaddr rcb_faddr; /* destination address */ 246509Ssam struct sockaddr rcb_laddr; /* socket's address */ 2521769Skarels struct sockproto rcb_proto; /* protocol family, protocol */ 265634Sroot caddr_t rcb_pcb; /* protocol specific stuff */ 2726035Skarels struct mbuf *rcb_options; /* protocol specific options */ 2813451Ssam struct route rcb_route; /* routing information */ 295634Sroot short rcb_flags; 305634Sroot }; 315634Sroot 325634Sroot /* 335634Sroot * Since we can't interpret canonical addresses, 345634Sroot * we mark an address present in the flags field. 355634Sroot */ 366509Ssam #define RAW_LADDR 01 376509Ssam #define RAW_FADDR 02 3813451Ssam #define RAW_DONTROUTE 04 /* no routing, default */ 395634Sroot 405634Sroot #define sotorawcb(so) ((struct rawcb *)(so)->so_pcb) 415634Sroot 425634Sroot /* 435634Sroot * Nominal space allocated to a raw socket. 445634Sroot */ 455634Sroot #define RAWSNDQ 2048 465634Sroot #define RAWRCVQ 2048 475634Sroot 485634Sroot /* 495667Ssam * Format of raw interface header prepended by 505667Ssam * raw_input after call from protocol specific 515667Ssam * input routine. 525634Sroot */ 535634Sroot struct raw_header { 546509Ssam struct sockproto raw_proto; /* format of packet */ 555646Ssam struct sockaddr raw_dst; /* dst address for rawintr */ 565646Ssam struct sockaddr raw_src; /* src address for sbappendaddr */ 575634Sroot }; 585634Sroot 595634Sroot #ifdef KERNEL 605634Sroot struct rawcb rawcb; /* head of list */ 615634Sroot #endif 62