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

# vmnet_write(_:_:_:)

Attempts to write specified packets to an interface.

## Declaration

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

## Parameters

- `interface`: The interface reference.
- `packets`: An array of packets to be written.
- `pktcnt`: The number of packets to write. On return, this parameter is populated with the number of packets the framework wrote.

## Return Value

Return Value vmnet on success, or an error code on failure. See vmnet for possible values.

## Discussion

Discussion None of the packet to be written should exceed the size of the value of vmnet_max_packet_size_key for the interface.

## See Also

### Reading and Writing Packets

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