routeable

package
v0.0.23 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: Unlicense, ISC Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Address net.IP

Address is the network address that routes to the gateway and thus the internet

View Source
var F, E, W, I, D, T log.LevelPrinter = log.GetLogPrinterSet(subsystem)
View Source
var Gateway net.IP

Gateway stores the current network default gateway as discovered by github.com/jackpal/gateway

View Source
var IPNet *net.IPNet

IPNet is the subnet of the Gateway's LAN

View Source
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

func GetAddressesAndInterfaces() (
	Interfaces []*net.Interface,
	Addresses map[string]struct{},
)

GetAddressesAndInterfaces returns all of the addresses and interfaces that would be resolved from an automatic addresses that can connect two processes at all

func GetAllInterfacesAndAddresses

func GetAllInterfacesAndAddresses() (
	interfaces []*net.Interface,
	udpAddrs []*net.UDPAddr,
)

func GetInterface

func GetInterface() (ifc *net.Interface, address string, e error)

GetInterface returns the address and interface of multicast-and-internet capable interfaces

func GetListenable

func GetListenable() net.IP

Types

This section is empty.

Jump to

Keyboard shortcuts

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