home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / Headers / bsd / net / raw_cb.h < prev    next >
C/C++ Source or Header  |  1997-04-27  |  3KB  |  87 lines

  1. /* 
  2.  * Mach Operating System
  3.  * Copyright (c) 1987 Carnegie-Mellon University
  4.  * All rights reserved.  The CMU software License Agreement specifies
  5.  * the terms and conditions for use and redistribution.
  6.  *
  7.  * Copyright (c) 1994 NeXT Computer, Inc
  8.  */
  9. /*
  10.  * HISTORY
  11.  * 11-Jul-93  Mac Gillon (mgillon) at NeXT
  12.  *    Integrated MULTICAST support
  13.  *
  14.  * 26-Sep-89  Morris Meyer (mmeyer) at NeXT
  15.  *    NFS 4.0 Changes: Back out statistics gathering support.
  16.  *
  17.  * 13-Aug-87  Peter King (king) at NeXT
  18.  *    SUN_RPC: Added rcb_cc and rcb_mbcnt for statistics gathering.
  19.  *            Added RAW_TALLY flag to turn on statistics gathering
  20.  */ 
  21.  
  22. /*
  23.  * Copyright (c) 1980, 1986 Regents of the University of California.
  24.  * All rights reserved.  The Berkeley software License Agreement
  25.  * specifies the terms and conditions for redistribution.
  26.  *
  27.  *    @(#)raw_cb.h    7.3 (Berkeley) 6/27/88 plus MULTICAST 1.0
  28.  */
  29.  
  30. /*    @(#)raw_cb.h    2.1 88/05/30 4.0NFSSRC SMI;    from UCB 7.1 6/5/86    */
  31.  
  32. /*
  33.  * Raw protocol interface control block.  Used
  34.  * to tie a socket to the generic raw interface.
  35.  */
  36. struct rawcb {
  37.     struct    rawcb *rcb_next;    /* doubly linked list */
  38.     struct    rawcb *rcb_prev;
  39.     struct    socket *rcb_socket;    /* back pointer to socket */
  40.     struct    sockaddr rcb_faddr;    /* destination address */
  41.     struct    sockaddr rcb_laddr;    /* socket's address */
  42.     struct    sockproto rcb_proto;/* protocol family, protocol */
  43.     caddr_t    rcb_pcb;            /* protocol specific stuff */
  44.     struct    mbuf *rcb_options;    /* protocol specific options */
  45.     struct    route rcb_route;    /* routing information */
  46.     short    rcb_flags;
  47. #ifdef MULTICAST
  48.     struct    mbuf *rcb_moptions;    /* proto specific multicast options */
  49. #endif
  50. /* SUN_RPC */
  51.         int     rcb_cc;            /* bytes of rawintr queued data */
  52.         int     rcb_mbcnt;        /* bytes of rawintr queued mbufs */
  53. /* SUN_RPC */
  54. };
  55.  
  56. /*
  57.  * Since we can't interpret canonical addresses,
  58.  * we mark an address present in the flags field.
  59.  */
  60. #define    RAW_LADDR    01
  61. #define    RAW_FADDR    02
  62. #define    RAW_DONTROUTE    04        /* no routing, default */
  63. #define RAW_TALLY       0x08            /* tally delivered packets (SUN_RPC) */
  64.  
  65. #define    sotorawcb(so)        ((struct rawcb *)(so)->so_pcb)
  66.  
  67. /*
  68.  * Nominal space allocated to a raw socket.
  69.  */
  70. #define    RAWSNDQ        2048
  71. #define    RAWRCVQ        2048
  72.  
  73. /*
  74.  * Format of raw interface header prepended by
  75.  * raw_input after call from protocol specific
  76.  * input routine.
  77.  */
  78. struct raw_header {
  79.     struct    sockproto raw_proto;    /* format of packet */
  80.     struct    sockaddr raw_dst;    /* dst address for rawintr */
  81.     struct    sockaddr raw_src;    /* src address for sbappendaddr */
  82. };
  83.  
  84. #ifdef KERNEL
  85. struct rawcb rawcb;            /* head of list */
  86. #endif
  87.