netinfo

package
v0.0.0-...-a69ce32 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ARPPATH = "/proc/net/arp"
View Source
var ROUTEPATH = "/proc/net/route"

Functions

This section is empty.

Types

type Arp

type Arp struct {
	// contains filtered or unexported fields
}

func NewArp

func NewArp() (*Arp, error)

func (*Arp) GetHwAddr

func (r *Arp) GetHwAddr(ip uint32) ([]byte, error)

func (*Arp) Load

func (r *Arp) Load(fname string) error

func (*Arp) String

func (r *Arp) String() string

type ArpItem

type ArpItem struct {
	Ip     uint32
	Device string
	HwAddr []byte
}

func (*ArpItem) String

func (ai *ArpItem) String() string

type Local

type Local struct {
	// contains filtered or unexported fields
}

func NewLocal

func NewLocal() (*Local, error)

func (*Local) GetInterfaceByIp

func (l *Local) GetInterfaceByIp(ip uint32) (*LocalInterface, error)

func (*Local) GetInterfaceByName

func (l *Local) GetInterfaceByName(name string) (*LocalInterface, error)

func (*Local) String

func (l *Local) String() string

type LocalInterface

type LocalInterface struct {
	Ip     uint32
	Device string
	Mask   uint32
}

func (*LocalInterface) String

func (li *LocalInterface) String() string

type Route

type Route struct {
	// contains filtered or unexported fields
}

func NewRoute

func NewRoute() (*Route, error)

func (*Route) GetGateway

func (r *Route) GetGateway(dst uint32) (uint32, error)

func (*Route) Load

func (r *Route) Load(fname string) error

func (*Route) String

func (r *Route) String() string

type RouteItem

type RouteItem struct {
	Dest    uint32
	Gateway uint32
	Mask    uint32
	Device  string
}

func (*RouteItem) String

func (ri *RouteItem) String() string

Jump to

Keyboard shortcuts

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