home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.2 (Developer) / NS_dev_3.2.iso / NextDeveloper / Headers / driverkit / IONetbufQueue.h < prev    next >
Text File  |  1993-07-30  |  852b  |  51 lines

  1. /*
  2.  * Copyright (c) 1993 NeXT Computer, Inc.
  3.  *
  4.  * Class which implements a fifo queue of Netbufs.
  5.  *
  6.  * HISTORY
  7.  *
  8.  * 2 Feb 1993 David E. Bohman at NeXT
  9.  *    Created.
  10.  */
  11.  
  12. #ifdef    KERNEL
  13.  
  14. #import <objc/Object.h>
  15. #import <bsd/net/netbuf.h>
  16.  
  17. /*
  18.  * A request to enqueue a Netbuf
  19.  * when there are already maxCount
  20.  * Netbufs queued, causes the new
  21.  * Netbuf to be freed without notice.
  22.  *
  23.  * Freeing an IONetbufQueue instance
  24.  * causes any queued Netbufs to be freed.
  25.  */
  26. @interface IONetbufQueue:Object
  27. {
  28. @private
  29.     struct _queueEntry {
  30.     struct _queueEntry
  31.                 *_next;
  32.     }        *_queueHead,
  33.             *_queueTail;
  34.     unsigned    _queueCount;
  35.     unsigned    _maxCount;
  36. }
  37.  
  38. - initWithMaxCount:(unsigned)maxCount;
  39.  
  40. - (unsigned)count;        // returns number of Netbufs queued
  41.  
  42. - (unsigned)maxCount;
  43.  
  44. - (void)enqueue:(netbuf_t)nb;
  45.  
  46. - (netbuf_t)dequeue;
  47.  
  48. @end
  49.  
  50. #endif    KERNEL
  51.