mirror of
https://github.com/soypat/lneto.git
synced 2026-08-09 09:23:40 +00:00
fa5ba918bb
* pcap: reuse Frame memory * slog: reduce heap allocations of addresses; also prevent heap alloc of dhcp options in pcap * dns: heapless improvement; add StackAsync buffer for more heapless operation; start thinking of errors * errors: begin standardise errors in lneto * errors: finish standardization of errors * fix merge issues * add more lneto errors to rest of package * format errors.go
35 lines
762 B
Go
35 lines
762 B
Go
package arp
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"github.com/soypat/lneto"
|
|
)
|
|
|
|
//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 (
|
|
errQueryPending = errors.New("arp: query pending")
|
|
errQueryNotFound = errors.New("arp: query not found")
|
|
|
|
// errGeneric aliases for common ARP errors.
|
|
errARPBufferFull = lneto.ErrBufferFull
|
|
errShortARP = lneto.ErrShortBuffer
|
|
errARPUnsupported = lneto.ErrUnsupported
|
|
errLargeSizes = lneto.ErrPacketDrop
|
|
)
|
|
|
|
// Operation represents the type of ARP packet, either request or reply/response.
|
|
type Operation uint16
|
|
|
|
const (
|
|
OpRequest Operation = 1 // request
|
|
OpReply Operation = 2 // reply
|
|
)
|