linux

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// VsockPortExec is the port for command execution
	VsockPortExec = 5000
	// VsockPortVFS is the port for VFS protocol
	VsockPortVFS = 5001
	// VsockPortReady is the port for ready signal
	VsockPortReady = 5002
)
View Source
const (
	TUNSETPERSIST = 0x400454cb
)

Variables

This section is empty.

Functions

func ConfigureInterface

func ConfigureInterface(name, cidr string) error

func CreateTAP

func CreateTAP(name string) (int, error)

func DeleteInterface

func DeleteInterface(name string) error

func GenerateMAC

func GenerateMAC(vmID string) string

func SetMTU

func SetMTU(name string, mtu int) error

func SetupIPForwarding

func SetupIPForwarding() error

Types

type LinuxBackend

type LinuxBackend struct{}

func NewLinuxBackend

func NewLinuxBackend() *LinuxBackend

func (*LinuxBackend) Create

func (b *LinuxBackend) Create(ctx context.Context, config *vm.VMConfig) (vm.Machine, error)

func (*LinuxBackend) Name

func (b *LinuxBackend) Name() string

type LinuxMachine

type LinuxMachine struct {
	// contains filtered or unexported fields
}

func (*LinuxMachine) Close

func (m *LinuxMachine) Close(ctx context.Context) error

func (*LinuxMachine) Exec

func (m *LinuxMachine) Exec(ctx context.Context, command string, opts *api.ExecOptions) (*api.ExecResult, error)

func (*LinuxMachine) ExecInteractive

func (m *LinuxMachine) ExecInteractive(ctx context.Context, command string, opts *api.ExecOptions, rows, cols uint16, stdin io.Reader, stdout io.Writer, resizeCh <-chan [2]uint16) (int, error)

ExecInteractive executes a command with PTY support for interactive sessions

func (*LinuxMachine) NetworkFD

func (m *LinuxMachine) NetworkFD() (int, error)

func (*LinuxMachine) PID

func (m *LinuxMachine) PID() int

func (*LinuxMachine) RootfsPath

func (m *LinuxMachine) RootfsPath() string

func (*LinuxMachine) Start

func (m *LinuxMachine) Start(ctx context.Context) error

func (*LinuxMachine) Stop

func (m *LinuxMachine) Stop(ctx context.Context) error

func (*LinuxMachine) TapName

func (m *LinuxMachine) TapName() string

TapName returns the TAP interface name

func (*LinuxMachine) VsockCID

func (m *LinuxMachine) VsockCID() uint32

VsockCID returns the guest CID

func (*LinuxMachine) VsockFD

func (m *LinuxMachine) VsockFD() (int, error)

func (*LinuxMachine) VsockPath

func (m *LinuxMachine) VsockPath() string

VsockPath returns the vsock UDS path for connecting to guest services

func (*LinuxMachine) Wait

func (m *LinuxMachine) Wait(ctx context.Context) error

Jump to

Keyboard shortcuts

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