mirror of
https://github.com/soypat/lneto.git
synced 2026-09-05 14:29:11 +00:00
Error rewrites (#43)
* 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
This commit is contained in:
+13
-5
@@ -1,6 +1,10 @@
|
||||
package arp
|
||||
|
||||
import "errors"
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/soypat/lneto"
|
||||
)
|
||||
|
||||
//go:generate stringer -type=Operation -linecomment -output stringers.go .
|
||||
|
||||
@@ -11,10 +15,14 @@ const (
|
||||
)
|
||||
|
||||
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 supported")
|
||||
errLargeSizes = errors.New("size of ARP protocol+hardware is unusually large")
|
||||
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.
|
||||
|
||||
Reference in New Issue
Block a user