pub enum NpduDecodeError {
AddressTooLong {
field: NpduAddressField,
length: u8,
dnet: Option<u16>,
source: Option<NpduAddress>,
},
Malformed(Error),
}Expand description
Why decode_npdu refused an NPDU.
Variants§
AddressTooLong
The DLEN or SLEN octet is larger than NpduAddress::MAX_MAC_LEN
(#1141), so the address names no node on a standard data link or on
one this stack serves.
Clause 6.4.4 gives routers Reject-Message-To-Network reason 6
(ADDRESSING_ERROR) for an NPDU whose DADR or SADR length is invalid.
dnet is the network the reject names,
and source is where it goes when a
router relayed the refused NPDU (#1158).
Fields
field: NpduAddressFieldWhich address the length octet introduces.
dnet: Option<u16>The NPDU’s DNET, when its control octet announces one. It precedes both length octets on the wire, so it is always known here.
source: Option<NpduAddress>The NPDU’s SNET/SADR, when the over-long field is the DADR and a
complete, valid source follows the DLEN octets the frame announces.
It is None when the SADR itself is the over-long field, since
that source names no node.
Malformed(Error)
Any other malformation: a short buffer, an unknown protocol version, a reserved network number, SLEN 0, or a truncated address or field.
Trait Implementations§
Source§impl Debug for NpduDecodeError
impl Debug for NpduDecodeError
Source§impl Display for NpduDecodeError
impl Display for NpduDecodeError
Source§impl Error for NpduDecodeError
impl Error for NpduDecodeError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<Error> for NpduDecodeError
impl From<Error> for NpduDecodeError
Source§impl From<NpduDecodeError> for Error
impl From<NpduDecodeError> for Error
Source§fn from(error: NpduDecodeError) -> Self
fn from(error: NpduDecodeError) -> Self
An over-long address becomes Error::OutOfRange: the length octet
is well formed, but its value is past the limit.