util

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 7 Imported by: 16

Documentation

Index

Constants

View Source
const (
	RouteFlagUp = 1 << iota
	RouteFlagGateway
	RouteFlagHost
)

Variables

This section is empty.

Functions

func CompareIPs

func CompareIPs(left, right net.IP) bool

CompareIPs returns true if the left IP is less than the right IP, else false.

func CopyIP

func CopyIP(ip net.IP) net.IP

func DecrementIP

func DecrementIP(ip net.IP)

func GetMyIP

func GetMyIP() (net.IP, error)

func IncrementIP

func IncrementIP(ip net.IP)

func InvertIP

func InvertIP(input net.IP)

func ShrinkIP

func ShrinkIP(netIP net.IP) net.IP

Types

type DefaultRouteInfo

type DefaultRouteInfo struct {
	Address   net.IP
	Interface string
	Mask      net.IPMask
}

func GetDefaultRoute

func GetDefaultRoute() (*DefaultRouteInfo, error)

type ResolverConfiguration

type ResolverConfiguration struct {
	Domain        string
	Nameservers   []net.IP
	SearchDomains []string
}

func GetResolverConfiguration

func GetResolverConfiguration() (*ResolverConfiguration, error)

type RouteEntry

type RouteEntry struct {
	BaseAddr      net.IP
	BroadcastAddr net.IP
	Flags         uint32
	GatewayAddr   net.IP
	InterfaceName string
	Mask          net.IPMask
}

type RouteTable

type RouteTable struct {
	DefaultRoute *DefaultRouteInfo
	RouteEntries []*RouteEntry
}

func GetRouteTable

func GetRouteTable() (*RouteTable, error)

Jump to

Keyboard shortcuts

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