networkfd

package
v0.6.17 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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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