---
title: "vmnet_read(_:_:_:)"
framework: vmnet
role: symbol
role_heading: Function
platforms: [Mac Catalyst 13.0+, macOS 10.10+]
path: "vmnet/vmnet_read(_:_:_:)"
---

# vmnet_read(_:_:_:)

Attempts to read a specified number of packets from an interface.

## Declaration

```swift
func vmnet_read(_ interface: interface_ref, _ packets: UnsafeMutablePointer<vmpktdesc>, _ pktcnt: UnsafeMutablePointer<Int32>) -> vmnet_return_t
```

## Parameters

- `interface`: The interface reference.
- `packets`: On return, this parameter is populated with an array of packets read.
- `pktcnt`: The number of packets to read. On return, this parameter is populated with the number of packets read, or 0 no packets are available to be read.

## Return Value

Return Value Returns vmnet on success, or an error code on failure. See vmnet for possible values. Discussion Each packet buffer passed should be at least as large as the value of vmnet_max_packet_size_key for the interface.

## See Also

### Reading and Writing Packets

- [vmnet_write(_:_:_:)](vmnet/vmnet_write(_:_:_:).md)
