<!--
{
  "availability" : [
    "macCatalyst: 13.0.0 -",
    "macOS: 10.10.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "vmnet",
  "identifier" : "/documentation/vmnet/vmnet_write(_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "vmnet"
    ],
    "preciseIdentifier" : "c:@F@vmnet_write"
  },
  "title" : "vmnet_write(_:_:_:)"
}
-->

# vmnet_write(_:_:_:)

Attempts to write specified packets to an interface.

```
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

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

## Discussion

None of the packet to be written should exceed the size of the value of [`vmnet_max_packet_size_key`](/documentation/vmnet/vmnet_max_packet_size_key) for the interface.

---

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)