home *** CD-ROM | disk | FTP | other *** search
/ Black Box 4 / BlackBox.cdr / lan / soss.arj / INCLUDE / NETBUF.H < prev    next >
C/C++ Source or Header  |  1991-04-11  |  1KB  |  44 lines

  1. /*  Copyright 1986 by Carnegie Mellon  */
  2. /*  Copyright 1983 by the Massachusetts Institute of Technology  */
  3.  
  4. #ifndef NETBUF_H            /* DDP */
  5. #define NETBUF_H    1        /* DDP */
  6.  
  7. #include <net.h>
  8.  
  9. /* The buffer organization is somewhat intertwined with the queue organization.
  10.     Each buffer is in a queue, either the free queue or the used queue
  11.     (or the buffer is currently being used by a user program or the
  12.     interrupt level routines, in which case it does not appear in a
  13.     queue). When a buffer is in a queue, it has a pointer to the next
  14.     buffer in the queue. If there is no next buffer, its pointer points
  15.     at nullbuf. Also, each buffer knows its own length. */
  16.  
  17. /* This include file gives the structure of buffers. */
  18.  
  19. #define NBUFINIT    10            /* A Goodly Number */
  20.  
  21. #ifdef LPKT                    /* DDP/LKR */
  22. #define LBUFINIT    1324            /* DDP/LKR */
  23. #else                        /* DDP/LKR */
  24. #define LBUFINIT    620            /* A Goodly Length */
  25. #endif                        /* DDP/LKR */
  26.  
  27. #define nullbuf (struct net_buf *)0    /* The null buffer and/or queue
  28.                         entry */
  29. extern int NBUF;            /* # of packet buffers */
  30. extern int LBUF;            /* length of each packet buffers */
  31.  
  32. struct net_buf {
  33.     q_elt    nb_elt;     /* queue link */
  34.     char    *nb_prot;    /* beginning of contents of packet */
  35.     long    nb_tstamp;        /* packet timestamp */
  36.     unsigned nb_len;            /* Length of buffer */
  37.     char    *nb_buff;        /* The buffer itself! */
  38.     };
  39.  
  40. typedef struct net_buf *PACKET;
  41.  
  42.  
  43. #endif                /* DDP */
  44.