Help us shape the future of Go! Take the 2026 Go Developer Survey

networkfd

package
v0.6.18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package networkfd creates file-descriptor-backed network devices.

Index

Constants

View Source
const DefaultMTU = 1500

Variables

This section is empty.

Functions

func ConfigureDatagramSocketBuffers

func ConfigureDatagramSocketBuffers(fd int, mtu int) error

ConfigureDatagramSocketBuffers sets socket buffers sized for mtu.

func HostConn

func HostConn(hostFD int) (*os.File, net.Conn, error)

HostConn wraps hostFD as a net.Conn. The returned file is retained so callers can close both the connection and file explicitly.

func NewAttachment

NewAttachment creates a VZ file-handle network attachment from guestFD.

func NewDevice

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

type Pair struct {
	HostFD  int
	GuestFD int
}

Pair is a connected datagram socket pair for a VZ file-handle network device.

func NewSocketPair

func NewSocketPair(mtu int) (Pair, error)

NewSocketPair returns a connected AF_UNIX datagram socket pair.

func (Pair) Close

func (p Pair) Close()

Close closes both descriptors in p.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL