mirror of
https://github.com/soypat/lneto.git
synced 2026-08-07 00:13:43 +00:00
ec44889896
* begin adding icmp client * rely on anon structs * add tests * tests passing * icmp fleshed out * rework icmp to include ip addr * rename StackAsync.Demux/Encapsulate to RecvEthernet and SendEthernet * remove legacy unreachable TCP tests * remove uses of deprecated internet.StackNode in preference of lneto.StackNode * documentation * rename methods to signal no I/O happening
35 lines
1.5 KiB
Go
35 lines
1.5 KiB
Go
package lneto
|
|
|
|
type errGeneric uint8
|
|
|
|
// Generic errors common to internet functioning.
|
|
const (
|
|
_ errGeneric = iota // non-initialized err
|
|
ErrBug // lneto-bug(use build tag "debugheaplog")
|
|
ErrPacketDrop // packet dropped
|
|
ErrBadCRC // incorrect checksum
|
|
ErrZeroSource // zero source(port/addr)
|
|
ErrZeroDestination // zero destination(port/addr)
|
|
ErrShortBuffer // short buffer
|
|
ErrBufferFull // buffer full
|
|
ErrInvalidAddr // invalid address
|
|
ErrUnsupported // unsupported
|
|
ErrMismatch // mismatch
|
|
ErrMismatchLen // mismatched length
|
|
ErrInvalidConfig // invalid configuration
|
|
ErrInvalidField // invalid field
|
|
ErrInvalidLengthField // invalid length field
|
|
ErrExhausted // resource exhausted
|
|
ErrAlreadyRegistered // protocol already registered
|
|
|
|
// Below are potentially good future error additions
|
|
// based on one or two encountered use cases, example use case included.
|
|
/*
|
|
- ErrUnregistered/ErrAborted // connection unregistered. i.e: ICMP client aborted during active ping, ping process returns this.
|
|
*/
|
|
)
|
|
|
|
func (err errGeneric) Error() string {
|
|
return err.String()
|
|
}
|