util

package
v0.0.0-...-d8f7d12 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func GetMyIP

func GetMyIP() (net.IP, error)

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