arp

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2016 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package arp provides utilities for looking up MAC/IP addresses on a LAN.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(ip net.IP, hwaddr net.HardwareAddr)

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[uint32]net.HardwareAddr

List returns the current runtime ARP table.

func NewARPReply

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

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

func NewARPRequest

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

NewARPRequest creates a bew ARP packet of type "request.

Types

type Address

type Address struct {
	IP           net.IP
	HardwareAddr net.HardwareAddr
	Interface    net.Interface
}

Address represents an ARP address.

func Lookup

func Lookup(ip uint32) (*Address, error)

Lookup returns the Address given an IP, if the IP is not found within the table, a lookup is attempted.

Jump to

Keyboard shortcuts

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