pub enum ContentValidationError {
Show 18 variants
InvalidMagicNumber(u32),
InvalidReservedField(u16),
InvalidTsResolution(u8, bool, u8),
InvalidLinktype(DataLink),
NoInterface,
InvalidInterfaceId(u32),
FailedToDecodeTimestamp {
timestamp_high: u32,
timestamp_low: u32,
resolution: InterfaceTsResolution,
offset: i64,
},
FailedToEncodeTimestamp {
timestamp: Duration,
resolution: InterfaceTsResolution,
offset: i64,
},
InvalidOriginalLen(u32, usize),
InvalidCapturedLen {
expected: usize,
actual: usize,
},
RecordWrongSize {
expected: usize,
actual: usize,
},
RecordWrongMinSize {
min: usize,
actual: usize,
},
RecordTooBig(usize),
RecordNameNotUtf8(Utf8Error),
RecordNamesEmpty,
CustomBlockConversionError(u32, Box<dyn Error + Sync + Send>),
BlockContentTooBig(u64),
OptionTooBig(usize),
}Expand description
Errors that can occur while validating decoded pcapng content.
Variants§
InvalidMagicNumber(u32)
The magic number of the pcapng SectionBlock is invalid.
InvalidReservedField(u16)
A reserved field is not zero.
InvalidTsResolution(u8, bool, u8)
The timestamp resolution value is invalid.
InvalidLinktype(DataLink)
The linktype in invalid (superior to u16::MAX)
NoInterface
No interface in the current section state.
InvalidInterfaceId(u32)
The interface ID does not exist in the current section state.
FailedToDecodeTimestamp
A raw timestamp and its interface offset could not be represented as a duration since the Unix epoch.
Fields
resolution: InterfaceTsResolutionInterface timestamp resolution.
FailedToEncodeTimestamp
A timestamp could not be encoded in the raw 64-bit timestamp field.
Fields
resolution: InterfaceTsResolutionInterface timestamp resolution.
InvalidOriginalLen(u32, usize)
The original length of the packet is lower than its actual length
InvalidCapturedLen
The captured length of the packet does not match the expected length.
RecordWrongSize
The Name Resolution record entry size is invalid.
RecordWrongMinSize
The Name Resolution record entry is smaller than its minimum valid size.
RecordTooBig(usize)
The Name Resolution record entry is too big to be written
RecordNameNotUtf8(Utf8Error)
A record name is not valid UTF-8.
RecordNamesEmpty
A Name Resolution record does not contain any names.
CustomBlockConversionError(u32, Box<dyn Error + Sync + Send>)
Error converting a custom block payload.
BlockContentTooBig(u64)
The content of a block is too big to fit on a block.
OptionTooBig(usize)
The content of a PcapNgOption is too big to be written
Trait Implementations§
Source§impl Debug for ContentValidationError
impl Debug for ContentValidationError
Source§impl Display for ContentValidationError
impl Display for ContentValidationError
Source§impl Error for ContentValidationError
impl Error for ContentValidationError
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()