Diagnostic

Enum Diagnostic 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

HeaderCrcMismatch

Header CRC does not match recomputed CRC.

Fields

§protocol: ProtocolKind

Originating protocol.

§computed: u16

CRC computed from the wire bytes.

§on_wire: u16

CRC carried in bytes 39-40 of the header.

§my_call: Callsign

MY callsign from the header (for log correlation).

§

HeaderFlagsNonZero

Header carries non-zero flag bytes (the DSVT-embedded form is supposed to zero them — see HeaderData.cpp:665-667).

Fields

§protocol: ProtocolKind

Originating protocol.

§flag1: u8

Observed flag1.

§flag2: u8

Observed flag2.

§flag3: u8

Observed flag3.

§

CallsignNonPrintable

Callsign field contains a byte outside ASCII printable range.

Fields

§protocol: ProtocolKind

Originating protocol.

§field: CallsignField

Which callsign field (rpt2 / rpt1 / ur / my / suffix).

§offset_in_field: u8

Byte offset within the 8-byte (or 4-byte for suffix) field.

§byte: u8

The non-printable byte observed.

§

StreamIdSwitchWithoutEot

Stream id flipped mid-stream without an EOT in between.

Fields

§protocol: ProtocolKind

Originating protocol.

§previous: StreamId

Previous stream id (now abandoned).

§new: StreamId

New stream id (just observed).

§elapsed_since_last_frame: Duration

How long since the last frame on previous.

§

VoiceSeqOutOfRange

Voice data sequence number outside 0..21.

Fields

§protocol: ProtocolKind

Originating protocol.

§stream_id: StreamId

The stream the seq belongs to.

§got: u8

The out-of-range seq value (0x40 bit stripped).

§

VoiceEotBitMismatch

Voice data with bit 0x40 set on a non-EOT-length packet, or EOT-length packet without bit 0x40 set.

Fields

§protocol: ProtocolKind

Originating protocol.

§packet_len: usize

Total packet length (including DPlus prefix where applicable).

§seq_byte: u8

Observed seq byte.

§

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: ProtocolKind

Originating protocol.

§observed: [u8; 6]

Last 6 bytes of the EOT packet as observed.

§

DuplicateLink1Ack

LINK1 ACK arrived after LINK2 was already sent.

Fields

§peer: SocketAddr

The peer that sent the duplicate.

§

UnknownLink2Reply

8-byte LINK2 reply at offsets [4..8] is neither OKRW nor BUSY.

Fields

§reply: [u8; 4]

The 4-byte tag (typically interpreted as ASCII).

§

AuthHostSkipped

Auth response chunk had a record dropped per the lenient filter.

Fields

§offset: usize

Byte offset of the dropped record.

§reason: AuthHostSkipReason

Why it was dropped.

§

AuthChunkTrailingBytes

Auth chunk had trailing bytes that don’t form a complete record.

Fields

§offset: usize

Byte offset where the trailing bytes started.

§bytes: usize

How many trailing bytes there were.

Trait Implementations§

Source§

impl Clone for Diagnostic

Source§

fn clone(&self) -> Diagnostic

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Diagnostic

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Diagnostic

Source§

fn eq(&self, other: &Diagnostic) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for Diagnostic

Source§

impl StructuralPartialEq for Diagnostic

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more