mirror of
https://github.com/soypat/lneto.git
synced 2026-08-08 08:53:40 +00:00
27 lines
690 B
Go
27 lines
690 B
Go
package arp
|
|
|
|
import "errors"
|
|
|
|
//go:generate stringer -type=Operation -linecomment -output stringers.go .
|
|
|
|
const (
|
|
sizeHeader = 8
|
|
sizeHeaderv4 = sizeHeader + 6*2 + 4*2
|
|
sizeHeaderv6 = sizeHeader + 6*2 + 16*2
|
|
)
|
|
|
|
var (
|
|
errARPBufferFull = errors.New("ARP client need handling:too many ops pending")
|
|
errShortARP = errors.New("packet too short to be ARP")
|
|
errARPUnsupported = errors.New("ARP not supprortedf")
|
|
errLargeSizes = errors.New("size of ARP protocol+hardware is unusually large")
|
|
)
|
|
|
|
// Operation represents the type of ARP packet, either request or reply/response.
|
|
type Operation uint16
|
|
|
|
const (
|
|
OpRequest Operation = 1 // request
|
|
OpReply Operation = 2 // reply
|
|
)
|