arpdis

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StaleTimeNormal      = time.Minute * 5
	StaleTimeUnreachable = time.Minute * 10

	TypeNormal      = 0
	TypeUnreachable = 1
	TypeStatic      = 2
)
View Source
const (
	ProtocolICMP     = 1
	ProtocolIPv6ICMP = 58
)

Variables

This section is empty.

Functions

func Add

func Add(addr *Addr)

Add adds a IP-MAC map to a runtime ARP table.

func Delete

func Delete(ip net.IP)

Delete removes an IP from the runtime ARP table.

func List

func List() map[string]*Addr

List returns the current runtime ARP table.

func NewARPReply

func NewARPReply(src *Addr, dst *Addr) ([]byte, error)

NewARPReply creates a new ARP packet of type "reply".

func NewARPRequest

func NewARPRequest(src *Addr, dst *Addr) ([]byte, error)

NewARPRequest creates a bew ARP packet of type "request.

Types

type Addr

type Addr struct {
	IP           net.IP
	HardwareAddr net.HardwareAddr

	Type int8
	// contains filtered or unexported fields
}

func Lookup

func Lookup(ip net.IP, onlyTable bool) *Addr

Jump to

Keyboard shortcuts

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