Documentation
¶
Overview ¶
Package networkfd creates file-descriptor-backed network devices.
Index ¶
- Constants
- func ConfigureDatagramSocketBuffers(fd int, mtu int) error
- func HostConn(hostFD int) (*os.File, net.Conn, error)
- func NewAttachment(guestFD int, mtu int) (foundation.NSFileHandle, vz.VZFileHandleNetworkDeviceAttachment, error)
- func NewDevice(attachment vz.VZFileHandleNetworkDeviceAttachment) (vz.VZVirtioNetworkDeviceConfiguration, error)
- func NewFileHandleFromFD(fd int) foundation.NSFileHandle
- type Pair
Constants ¶
View Source
const DefaultMTU = 1500
Variables ¶
This section is empty.
Functions ¶
func ConfigureDatagramSocketBuffers ¶
ConfigureDatagramSocketBuffers sets socket buffers sized for mtu.
func HostConn ¶
HostConn wraps hostFD as a net.Conn. The returned file is retained so callers can close both the connection and file explicitly.
func NewAttachment ¶
func NewAttachment(guestFD int, mtu int) (foundation.NSFileHandle, vz.VZFileHandleNetworkDeviceAttachment, error)
NewAttachment creates a VZ file-handle network attachment from guestFD.
func NewDevice ¶
func NewDevice(attachment vz.VZFileHandleNetworkDeviceAttachment) (vz.VZVirtioNetworkDeviceConfiguration, error)
NewDevice creates a Virtio network device for attachment.
func NewFileHandleFromFD ¶
func NewFileHandleFromFD(fd int) foundation.NSFileHandle
NewFileHandleFromFD wraps fd in an NSFileHandle that closes on dealloc.
Types ¶
type Pair ¶
Pair is a connected datagram socket pair for a VZ file-handle network device.
func NewSocketPair ¶
NewSocketPair returns a connected AF_UNIX datagram socket pair.
Click to show internal directories.
Click to hide internal directories.