freebsd

package
v0.28.4 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDoesNotExist     = errors.New("does not exist")
	ErrNameDoesNotMatch = errors.New("name does not match")
)

Functions

This section is empty.

Types

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

Link represents a network interface.

func LinkByName

func LinkByName(name string) (*Link, error)

LinkByName retrieves a network interface by its name.

func NewLink(name string) *Link

func (*Link) Add

func (l *Link) Add() error

Add creates a new network interface.

func (*Link) AssignAddr

func (l *Link) AssignAddr(ip, netmask string) error

AssignAddr assigns an IP address and netmask to the network interface.

func (*Link) Del

func (l *Link) Del() error

Del removes an existing network interface.

func (*Link) Down

func (l *Link) Down() error

func (*Link) Recreate

func (l *Link) Recreate() error

Recreate - create new interface, remove current before create if it exists

func (*Link) SetMTU

func (l *Link) SetMTU(mtu int) error

SetMTU sets the MTU of the network interface.

func (*Link) Up

func (l *Link) Up() error

Jump to

Keyboard shortcuts

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