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