mirror of
https://github.com/soypat/lneto.git
synced 2026-07-26 10:38:47 +00:00
813b7b5e57
* good code today * add netdev.Runner * round off APIs more * better interface method documentation * improve DHCP netstack API * add pico w netdev example * remove temp file * keep thinking about this. this is hard :/ * fix ci * small fixer * working dhcp * fix rebase API mismatches * begin adding espradio example * keep working on espradio, icmp not working * fix icmp by fixing dhcp
38 lines
1.8 KiB
Go
38 lines
1.8 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
|
|
_ // little stitious
|
|
ErrInvalidField // invalid field
|
|
ErrInvalidLengthField // invalid length field
|
|
ErrExhausted // resource exhausted
|
|
ErrAlreadyRegistered // protocol already registered
|
|
ErrTruncatedFrame // truncated frame
|
|
ErrMissingHALConfig // missing HAL configuration
|
|
// 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.
|
|
- ErrInvalidArgs // invalid func arguments i.e: different from Config since this refers to non-config arguments. usually nil values.
|
|
*/
|
|
)
|
|
|
|
func (err errGeneric) Error() string {
|
|
return err.String()
|
|
}
|