iface

package
v1.31.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIfaceNotFound = errors.New("interface not found")
	ErrAddrNotFound  = errors.New("addr not found")
)

Functions

func FlushCache

func FlushCache()

Types

type Interface

type Interface struct {
	Index        int
	Name         string
	Addrs        []*netip.Prefix
	HardwareAddr net.HardwareAddr
}

func ResolveInterface

func ResolveInterface(name string) (*Interface, error)

func (*Interface) PickIPv4Addr

func (iface *Interface) PickIPv4Addr(destination netip.Addr) (*netip.Prefix, error)

func (*Interface) PickIPv6Addr

func (iface *Interface) PickIPv6Addr(destination netip.Addr) (*netip.Prefix, error)

Jump to

Keyboard shortcuts

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