iface

package
v1.19.34-clash.3 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2026 License: GPL-3.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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(addr netip.Addr) (bool, error)

Types

type Interface

type Interface struct {
	Index        int
	MTU          int
	Name         string
	HardwareAddr net.HardwareAddr
	Flags        net.Flags
	Addresses    []netip.Prefix
}

func ResolveInterface

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

func ResolveInterfaceByAddr

func ResolveInterfaceByAddr(addr netip.Addr) (*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)

Directories

Path Synopsis
Package anet fix "route ip+net: netlinkrib: permission denied" on android copy and modify from https://github.com/wlynxg/anet/tree/5501d401a269290292909e6cc75f105571f97cfa
Package anet fix "route ip+net: netlinkrib: permission denied" on android copy and modify from https://github.com/wlynxg/anet/tree/5501d401a269290292909e6cc75f105571f97cfa

Jump to

Keyboard shortcuts

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