pub enum NpduDecodeError {
AddressTooLong {
field: AddressField,
length: u8,
dnet: Option<u16>,
source: Option<NpduAddress>,
},
Malformed(Malformed),
}Expand description
Why decode_npdu refused an NPDU: bacnet-npdu’s
DecodeError, with the source behind an
over-long DADR owned.
Variants§
AddressTooLong
The DLEN or SLEN octet is larger than 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: AddressFieldWhich 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(Malformed)
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 Clone for NpduDecodeError
impl Clone for NpduDecodeError
Source§impl Debug for NpduDecodeError
impl Debug for NpduDecodeError
Source§impl Display for NpduDecodeError
impl Display for NpduDecodeError
impl Eq for NpduDecodeError
Source§impl Error for NpduDecodeError
impl Error for NpduDecodeError
1.30.0 · 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<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::Range: the length octet is
well formed, but its value is past the limit. Its text is the
refusal’s own. Any other fault becomes Error::Decoding, with the
fault’s text: DecodingKind::Missing for a frame that ends inside
a field, DecodingKind::InvalidEncoding for the rest. Neither
knows the offset, so it reads 0.