iface

package
v0.0.0-...-f3a3a28 Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: GPL-3.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultRouteInterface

func DefaultRouteInterface() (string, error)

func GetInterfaceNames

func GetInterfaceNames() (list []string)

Types

type Interface

type Interface struct {
	Index        int
	Name         string
	Addrs        []netip.Prefix
	HardwareAddr net.HardwareAddr
	// contains filtered or unexported fields
}

func GetInterfaceByIndex

func GetInterfaceByIndex(index int) (*Interface, error)

func GetInterfaceByName

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

func (*Interface) PickIPv4Addr

func (iface *Interface) PickIPv4Addr(dst netip.Addr) netip.Addr

func (*Interface) PickIPv6Addr

func (iface *Interface) PickIPv6Addr(dst netip.Addr) netip.Addr

Jump to

Keyboard shortcuts

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