net

package
v0.0.0-...-626b81c Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2018 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ArpTableParser = regexp.MustCompile("^[^\\d\\.]+([\\d\\.]+).+\\s+([a-f0-9:]{17}).+\\s+(.+)$")
View Source
var ArpTableTokens = 4
View Source
var IPv4RouteParser = regexp.MustCompile("^([\\d\\.]+)\\s+([\\d\\.]+)\\s+([\\d\\.]+)\\s+([A-Z]+)\\s+\\d+\\s+\\d+\\s+\\d+\\s+(.+)$")
View Source
var IPv4RouteTokens = 6

Functions

func ArpLookup

func ArpLookup(iface string, address string, refresh bool) (string, error)

func ArpParsed

func ArpParsed() bool

func OuiInit

func OuiInit()

func OuiLookup

func OuiLookup(mac string) string

Types

type ArpTable

type ArpTable map[string]string

func ArpDiff

func ArpDiff(current, before ArpTable) ArpTable

func ArpUpdate

func ArpUpdate(iface string) (ArpTable, error)

type Endpoint

type Endpoint struct {
	IP               net.IP                 `json:"-"`
	HW               net.HardwareAddr       `json:"-"`
	IpAddress        string                 `json:"address"`
	SubnetBits       uint32                 `json:"-"`
	IpAddressUint32  uint32                 `json:"-"`
	HwAddress        string                 `json:"mac"`
	Hostname         string                 `json:"hostname"`
	Vendor           string                 `json:"vendor"`
	ResolvedCallback OnHostResolvedCallback `json:"-"`
}

func FindGateway

func FindGateway(iface *Endpoint) (*Endpoint, error)

func FindInterface

func FindInterface(name string) (*Endpoint, error)

func NewEndpoint

func NewEndpoint(ip, mac string) *Endpoint

func NewEndpointNoResolve

func NewEndpointNoResolve(ip, mac, name string, bits uint32) *Endpoint

func (*Endpoint) CIDR

func (t *Endpoint) CIDR() string

func (*Endpoint) Name

func (t *Endpoint) Name() string

func (*Endpoint) String

func (t *Endpoint) String() string

type OnHostResolvedCallback

type OnHostResolvedCallback func(e *Endpoint)

Jump to

Keyboard shortcuts

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