<!--
{
  "availability" : [
    "DriverKit: -"
  ],
  "documentType" : "symbol",
  "framework" : "NetworkingDriverKit",
  "identifier" : "/documentation/NetworkingDriverKit/IOUserNetworkPacketQueue",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "NetworkingDriverKit"
    ],
    "preciseIdentifier" : "c:@S@IOUserNetworkPacketQueue"
  },
  "title" : "IOUserNetworkPacketQueue"
}
-->

# IOUserNetworkPacketQueue

The base class for the queues that manage the packets moving to and from your device.

```
class IOUserNetworkPacketQueue;
```

## Overview

This class provides the common functionality for the submission and completion queues you use to manage network packets. You do not create instances of this class directly. Instead, you instantiate the following concrete subclasses:

- [`IOUserNetworkRxSubmissionQueue`](/documentation/NetworkingDriverKit/IOUserNetworkRxSubmissionQueue)
- [`IOUserNetworkRxCompletionQueue`](/documentation/NetworkingDriverKit/IOUserNetworkRxCompletionQueue)
- [`IOUserNetworkTxSubmissionQueue`](/documentation/NetworkingDriverKit/IOUserNetworkTxSubmissionQueue)
- [`IOUserNetworkTxCompletionQueue`](/documentation/NetworkingDriverKit/IOUserNetworkTxCompletionQueue)

Submission queues contain the packets that your driver dequeues and processes. After you process the dequeued packets, you place them on the matching completion queue to let the system know that you are finished with them. The system eventually recycles the completed packets back to the corresponding submission queue so that the cycle may begin again.

## Topics

### Configuring the Packet Queue

[`virtual bool init();`](/documentation/NetworkingDriverKit/IOUserNetworkPacketQueue/init)

Initializes the packet submission queue.

[`virtual void free();`](/documentation/NetworkingDriverKit/IOUserNetworkPacketQueue/free)

Performs any final cleanup for the queue.

### Enabling the Packet Queue

[`virtual kern_return_t SetEnable(bool isEnable);`](/documentation/NetworkingDriverKit/IOUserNetworkPacketQueue/SetEnable-76sm5)

Enables or disables the queue.

### Queueing and Dequeueing Packets

[`virtual kern_return_t EnqueuePacket(IOUserNetworkPacket *packet);`](/documentation/NetworkingDriverKit/IOUserNetworkPacketQueue/EnqueuePacket)

Adds a single network packet to the queue for processing.

[`virtual uint32_t EnqueuePackets(IOUserNetworkPacket **packets, uint32_t packetCount);`](/documentation/NetworkingDriverKit/IOUserNetworkPacketQueue/EnqueuePackets-qzx)

Adds multiple network packets to the queue for processing.

[`virtual kern_return_t DequeuePacket(IOUserNetworkPacket **packet);`](/documentation/NetworkingDriverKit/IOUserNetworkPacketQueue/DequeuePacket)

Retrieves a single network packet from the queue.

[`virtual uint32_t DequeuePackets(IOUserNetworkPacket **packets, uint32_t maxDequeueCount);`](/documentation/NetworkingDriverKit/IOUserNetworkPacketQueue/DequeuePackets)

Retrieves multiple network packets from the queue.

### Configuring the Queue Attributes

[`virtual kern_return_t SetPacketBufferPool(IOUserNetworkPacketBufferPool *pool);`](/documentation/NetworkingDriverKit/IOUserNetworkPacketQueue/SetPacketBufferPool)

Assigns the specified buffer pool with this queue.

[`virtual kern_return_t SetPacketDirection(IOUserNetworkPacketDirection direction);`](/documentation/NetworkingDriverKit/IOUserNetworkPacketQueue/SetPacketDirection)

Specifies whether packets flow into or out of the queue.

### Managing the Data Queue

[`virtual kern_return_t CopyDataQueue(IODataQueueDispatchSource **dataQueue);`](/documentation/NetworkingDriverKit/IOUserNetworkPacketQueue/CopyDataQueue)

Returns the dispatch queue that this object uses to execute tasks.

[`kern_return_t SetDataQueue(IODataQueueDispatchSource *dataQueue);`](/documentation/NetworkingDriverKit/IOUserNetworkPacketQueue/SetDataQueue)

Assigns the specified dispatch source to this object.

### Instance Methods

[`virtual IOReturn enqueuePackets(IOUserNetworkPacket **inPackets, uint32_t count, IOOptionBits options);`](/documentation/NetworkingDriverKit/IOUserNetworkPacketQueue/enqueuePackets-13ln6)

[`virtual IOReturn requestDequeue(void *refCon, IOOptionBits options);`](/documentation/NetworkingDriverKit/IOUserNetworkPacketQueue/requestDequeue)

[`virtual IOReturn requestEnqueue(void *refCon, IOOptionBits options);`](/documentation/NetworkingDriverKit/IOUserNetworkPacketQueue/requestEnqueue)

[`virtual IOReturn setEnable(bool isEnable);`](/documentation/NetworkingDriverKit/IOUserNetworkPacketQueue/setEnable-8eikm)

[`virtual IOReturn setPacketPoller(IOUserNetworkPacketPoller *poller);`](/documentation/NetworkingDriverKit/IOUserNetworkPacketQueue/setPacketPoller)

## Relationships

### Inherited By

[`IOUserNetworkRxSubmissionQueue`](/documentation/NetworkingDriverKit/IOUserNetworkRxSubmissionQueue)

[`IOUserNetworkRxCompletionQueue`](/documentation/NetworkingDriverKit/IOUserNetworkRxCompletionQueue)

[`IOUserNetworkTxCompletionQueue`](/documentation/NetworkingDriverKit/IOUserNetworkTxCompletionQueue)

[`IOUserNetworkTxSubmissionQueue`](/documentation/NetworkingDriverKit/IOUserNetworkTxSubmissionQueue)

### Inherits From

[`OSObject`](/documentation/DriverKit/OSObject)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)