Copyright ©1995 by NeXT Computer, Inc.  All Rights Reserved.

IONetbufQueue



Inherits From: Object
Declared In: driverkit/IONetbufQueue.h



Class Description

IONetbufQueue is used by network device drivers to store packets until they're transmitted. IONetbufQueue is a first-in first-out (FIFO) queue.



Instance Variables

None declared in this class.



Method Types

Creating and initializing instances
initWithMaxCount:
Adding and removing netbufs from the queue
enqueue:
dequeue
Getting the size of the queue count
maxCount





Instance Methods

count
(unsigned int)count

Returns the number of netbufs in the IONetbufQueue.

See also:  maxCount



dequeue
(netbuf_t)dequeue

Removes and returns the netbuf that has been in the queue the longest. Returns NULL if no netbufs are in the queue.



enqueue:
(void)enqueue:(netbuf_t)netbuf

Adds the specified netbuf to the queue, unless the queue already has reached its maximum length. If the queue is at its maximum length, the netbuf is freed.

See also:  count, maxCount



initWithMaxCount:
initWithMaxCount:(unsigned int)maxCount

Initializes and returns a newly allocated IONetbufQueue. The maximum number of netbufs in the queue is set to maxCount.



maxCount
(unsigned int)maxCount

Returns the maximum number of netbufs that can be in the IONetbufQueue. This number is set at initialization time.

See also:  maxCount, initWithMaxCount: