iface

package
v0.0.0-...-686dedc Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2024 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()

func Interfaces

func Interfaces() (map[string]*Interface, error)

func IsLocalIp

func IsLocalIp(ip netip.Addr) (bool, error)

Types

type Interface

type Interface struct {
	Index        int
	MTU          int
	Name         string
	Addresses    []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