Documentation ¶
Index ¶
- Variables
- func Discover() (e error)
- func GetAddressesAndInterfaces() (Interfaces []*net.Interface, Addresses map[string]struct{})
- func GetAllInterfacesAndAddresses() (interfaces []*net.Interface, udpAddrs []*net.UDPAddr)
- func GetInterface() (ifc *net.Interface, address string, e error)
- func GetListenable() net.IP
Constants ¶
This section is empty.
Variables ¶
var Address net.IP
Address is the network address that routes to the gateway and thus the internet
var F, E, W, I, D, T log.LevelPrinter = log.GetLogPrinterSet(subsystem)
var Gateway net.IP
Gateway stores the current network default gateway as discovered by github.com/jackpal/gateway
var IPNet *net.IPNet
IPNet is the subnet of the Gateway's LAN
var Interface *net.Interface
Interface is the net.Interface of the Address above
Functions ¶
func Discover ¶
func Discover() (e error)
Discover enumerates and evaluates all known network interfaces and addresses and filters it down to the ones that reach both a LAN and the internet
We are only interested in IPv4 addresses because for the most part, domestic ISPs do not issue their customers with IPv6 routing, it's still a pain in the ass outside of large data centre connections
func GetAddressesAndInterfaces ¶
GetAddressesAndInterfaces returns all of the addresses and interfaces that would be resolved from an automatic addresses that can connect two processes at all
func GetInterface ¶
GetInterface returns the address and interface of multicast-and-internet capable interfaces
func GetListenable ¶
Types ¶
This section is empty.