srt_protocol/packet/
error.rs

1use std::{error::Error, fmt, str::Utf8Error};
2
3#[derive(Debug, Eq, PartialEq)]
4#[non_exhaustive]
5pub enum PacketParseError {
6    NotEnoughData,
7    BadUdtVersion(i32),
8    BadConnectionType(i32),
9    BadSocketType(u16),
10    BadControlType(u16),
11    UnsupportedSrtExtensionType(u16),
12    BadSrtExtensionMessage, // could be split
13    BadCryptoLength(u32),
14    BadCipherKind(u8),
15    BadKeyPacketType(u8),
16    BadKeySign(u16),
17    BadAuth(u8),
18    BadStreamEncapsulation(u8),
19    StreamEncapsulationNotSrt,
20    BadDataEncryption(u8),
21    StreamTypeNotUtf8(Utf8Error),
22    ZeroAckSequenceNumber,
23    BadFilter(String),
24}
25
26impl fmt::Display for PacketParseError {
27    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
28        <Self as fmt::Debug>::fmt(self, f)
29    }
30}
31
32impl Error for PacketParseError {}