Documentation ¶
Index ¶
- Variables
- func Addrs(name string) []string
- func FreePort() (port int, err error)
- func HostFirstIPv4() (string, error)
- func HostFirstIPv6() (string, error)
- func HostIP() ([]string, error)
- func InterfaceByIP(ip string) (*net.Interface, error)
- func InterfaceByMAC(mac net.HardwareAddr) (*net.Interface, error)
- func InterfaceByName(name string) (*net.Interface, error)
- func LoopbackAddrs() []string
- func LoopbackInterface() (*net.Interface, error)
- func MacByIP(ip string) (net.HardwareAddr, error)
- func MacByName(name string) (net.HardwareAddr, error)
- func NonLoopbackAddrs() []string
- func NonLoopbackInterfaces() ([]*net.Interface, error)
- func Route(dst string) (iface *net.Interface, gateway, preferredSrc net.IP, err error)
- func RouteWithSrc(input net.HardwareAddr, src, dst string) (iface *net.Interface, gateway, preferredSrc net.IP, err error)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotFound is returned when the requested item is not found. ErrNotFound = errors.New("Not found") )
Functions ¶
func HostFirstIPv4 ¶
HostFirstIPv6 returns the first non-loopback IPv4 address of the host.
func HostFirstIPv6 ¶
HostFirstIPv6 returns the first non-loopback IPv6 address of the host.
func InterfaceByIP ¶
InterfaceByIP returns the interface with the given IP address.
func InterfaceByMAC ¶
func InterfaceByMAC(mac net.HardwareAddr) (*net.Interface, error)
InterfaceByMAC returns the interface with the given MAC address.
func InterfaceByName ¶
InterfaceByName returns the interface with the given name.
func LoopbackAddrs ¶
func LoopbackAddrs() []string
LoopbackAddrs returns the loopback IP addresses of interfaces.
func LoopbackInterface ¶
LoopbackInterface returns the loopback interface.
func MacByIP ¶
func MacByIP(ip string) (net.HardwareAddr, error)
MacByIP returns the MAC address of the interface with the given IP address.
func MacByName ¶
func MacByName(name string) (net.HardwareAddr, error)
MacByName returns the MAC address of the interface with the given name.
func NonLoopbackAddrs ¶
func NonLoopbackAddrs() []string
NonLoopbackAddrs returns the non-loopback IP addresses of interfaces.
func NonLoopbackInterfaces ¶
NonLoopbackInterfaces returns the non-loopback interfaces.
func Route ¶
Route returns the interface, gateway and preferred source IP address for the given destination.
func RouteWithSrc ¶
func RouteWithSrc(input net.HardwareAddr, src, dst string) (iface *net.Interface, gateway, preferredSrc net.IP, err error)
RouteWithSrc returns the interface, gateway and preferred source IP address for the given destination and source.
Types ¶
This section is empty.