iface

package
v0.1.110 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2025 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindEthIfaceByIp

func FindEthIfaceByIp(ipaddr string) (ifaceName string, err error)

lo, eth

func FindEthIfaceNames

func FindEthIfaceNames() (ifaceNames []string, err error)

func FindEthIfaces

func FindEthIfaces() (ethIfaces []net.Interface, err error)

func FindIface added in v0.1.73

func FindIface(iface string) (*net.Interface, error)

net.InterfaceByName(), err 会有 "no such network interface" if strings.Contains(err.Error(), "no such network interface") {

func FindIfaceByIp

func FindIfaceByIp(ipaddr string) (ifaceName string, err error)

lo, eth

func GetAvailableTunName

func GetAvailableTunName(tunPrefix string) (string, error)

format can be: tun0, tun_0, so the prefix should be tun/tun_

func GetAvailableUTunName

func GetAvailableUTunName() (string, error)

macos: utun

func GetIfacesNameByPrefix

func GetIfacesNameByPrefix(prefix string) ([]string, error)

func IsIfaceExist added in v0.1.73

func IsIfaceExist(iface string) (bool, error)

func IsIfaceUp added in v0.1.73

func IsIfaceUp(iface string) (bool, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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