#[non_exhaustive]pub enum Diagnostic {
HeaderCrcMismatch {
protocol: ProtocolKind,
computed: u16,
on_wire: u16,
my_call: Callsign,
},
HeaderFlagsNonZero {
protocol: ProtocolKind,
flag1: u8,
flag2: u8,
flag3: u8,
},
CallsignNonPrintable {
protocol: ProtocolKind,
field: CallsignField,
offset_in_field: u8,
byte: u8,
},
StreamIdSwitchWithoutEot {
protocol: ProtocolKind,
previous: StreamId,
new: StreamId,
elapsed_since_last_frame: Duration,
},
VoiceSeqOutOfRange {
protocol: ProtocolKind,
stream_id: StreamId,
got: u8,
},
VoiceEotBitMismatch {
protocol: ProtocolKind,
packet_len: usize,
seq_byte: u8,
},
VoiceEotTrailerMismatch {
protocol: ProtocolKind,
observed: [u8; 6],
},
DuplicateLink1Ack {
peer: SocketAddr,
},
UnknownLink2Reply {
reply: [u8; 4],
},
AuthHostSkipped {
offset: usize,
reason: AuthHostSkipReason,
},
AuthChunkTrailingBytes {
offset: usize,
bytes: usize,
},
}Expand description
One observable malformation detected by a lenient parser.
Lenient parsing rule: the codec must NEVER reject a packet
solely because of a recoverable malformation. Every malformation
becomes a Diagnostic and the packet still parses with whatever
content was extractable. Strict-mode is implemented in the
consumer’s DiagnosticSink, never in the parser.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
HeaderCrcMismatch
Header CRC does not match recomputed CRC.
Fields
protocol: ProtocolKindOriginating protocol.
HeaderFlagsNonZero
Header carries non-zero flag bytes (the DSVT-embedded form
is supposed to zero them — see HeaderData.cpp:665-667).
Fields
protocol: ProtocolKindOriginating protocol.
CallsignNonPrintable
Callsign field contains a byte outside ASCII printable range.
Fields
protocol: ProtocolKindOriginating protocol.
field: CallsignFieldWhich callsign field (rpt2 / rpt1 / ur / my / suffix).
StreamIdSwitchWithoutEot
Stream id flipped mid-stream without an EOT in between.
Fields
protocol: ProtocolKindOriginating protocol.
VoiceSeqOutOfRange
Voice data sequence number outside 0..21.
Fields
protocol: ProtocolKindOriginating protocol.
VoiceEotBitMismatch
Voice data with bit 0x40 set on a non-EOT-length packet, or EOT-length packet without bit 0x40 set.
Fields
protocol: ProtocolKindOriginating protocol.
VoiceEotTrailerMismatch
EOT trailer pattern doesn’t match 0x55 0x55 0x55 0x55 0xC8 0x7A.
xlxd writes a different trailer; reflectors talking to xlxd
may emit either form.
Fields
protocol: ProtocolKindOriginating protocol.
DuplicateLink1Ack
LINK1 ACK arrived after LINK2 was already sent.
Fields
peer: SocketAddrThe peer that sent the duplicate.
UnknownLink2Reply
8-byte LINK2 reply at offsets [4..8] is neither OKRW nor BUSY.
AuthHostSkipped
Auth response chunk had a record dropped per the lenient filter.
Fields
reason: AuthHostSkipReasonWhy it was dropped.
AuthChunkTrailingBytes
Auth chunk had trailing bytes that don’t form a complete record.
Trait Implementations§
Source§impl Clone for Diagnostic
impl Clone for Diagnostic
Source§fn clone(&self) -> Diagnostic
fn clone(&self) -> Diagnostic
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more