arp

package
v0.0.0-...-ba9fc6b Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package arp implements the ARP network protocol. It is used to resolve IPv4 addresses into link-local MAC addresses, and advertises IPv4 addresses of its stack with the local network.

To use it in the networking stack, pass arp.NewProtocol() as one of the network protocols when calling stack.New. Then add an "arp" address to every NIC on the stack that should respond to ARP requests. That is:

if err := s.AddAddress(1, arp.ProtocolNumber, "arp"); err != nil {
	// handle err
}

Index

Constants

View Source
const (
	// ProtocolNumber is the ARP protocol number.
	ProtocolNumber = header.ARPProtocolNumber

	// ProtocolAddress is the address expected by the ARP endpoint.
	ProtocolAddress = tcpip.Address("arp")
)

Variables

This section is empty.

Functions

func NewProtocol

func NewProtocol() stack.NetworkProtocol

NewProtocol returns an ARP network protocol.

Types

This section is empty.

Jump to

Keyboard shortcuts

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