mirror of
https://github.com/soypat/lneto.git
synced 2026-07-26 10:38:47 +00:00
63f7870fe5
* add handler.encapsulateNode * implement round robin handler approach * simplify round robin implementation * leave TODO * internet.node touch up * fix conflict resolve f-up * replace certain ErrShortBuffer with ErrTruncatedFrame error
34 lines
724 B
Go
34 lines
724 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.
|
|
errShortARP = lneto.ErrTruncatedFrame
|
|
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
|
|
)
|