arp

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2025 License: MIT Imports: 7 Imported by: 1

Documentation

Overview

Package arp queries the system ARP cache.

Index

Constants

This section is empty.

Variables

View Source
var DefaultResolver = &Resolver{TTL: 100 * time.Millisecond}

DefaultResolver is the resolver used by the package-level Lookup functions.

Functions

func LookupIP

func LookupIP(hw net.HardwareAddr) (net.IP, error)

LookupIP returns the IP address associated with the given hardware address, as recorded in the system ARP cache.

func LookupMAC

func LookupMAC(ip net.IP) (net.HardwareAddr, error)

LookupMAC returns the hardware address associated with the given IP address, as recorded in the system ARP cache.

Types

type Resolver

type Resolver struct {
	// TTL is the minimum time between updates.
	TTL time.Duration
	// contains filtered or unexported fields
}

func (*Resolver) LookupIP

func (r *Resolver) LookupIP(hw net.HardwareAddr) (net.IP, error)

LookupIP returns the IP address associated with the given hardware address, as recorded in the system ARP cache.

func (*Resolver) LookupMAC

func (r *Resolver) LookupMAC(ip net.IP) (net.HardwareAddr, error)

LookupMAC returns the hardware address associated with the given IP address, as recorded in the system ARP cache.

type Table

type Table map[string]string

func ReadTable

func ReadTable(filename string) (Table, error)

Jump to

Keyboard shortcuts

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