Contents

VZFileHandleNetworkDeviceAttachment

A network device that transmits raw network packets and frames using a datagram socket.

Declaration

class VZFileHandleNetworkDeviceAttachment

Overview

A VZFileHandleNetworkDeviceAttachment object maps a network interface to a connected datagram socket. This attachment transmits data at the data link layer. You configure and manage the socket in your app, and manage the corresponding data transfers.

To configure a network device with a socket-based file handle:

  1. Create a socket with the SOCK_DGRAM type in your app.

  2. Create a FileHandle from the socket’s file descriptor.

  3. Create the VZFileHandleNetworkDeviceAttachment object using the file handle.

  4. Assign the attachment object to the attachment property of a VZVirtioNetworkDeviceConfiguration object.

  5. Add the VZVirtioNetworkDeviceConfiguration object to the networkDevices property of your VZVirtualMachineConfiguration.

This attachment doesn’t require your app to have the com.apple.vm.networking entitlement.

Topics

Creating the attachment point

Getting the file handle

Specifying the network packet size

See Also

Attachment points