pub enum Error {
NotACapture {
magic: [u8; 4],
},
Truncated,
Malformed {
reason: String,
},
Io(Error),
UnsupportedLinkType {
link_type: u32,
},
}Expand description
What went wrong reading a capture.
Variants§
NotACapture
The leading bytes are neither a pcap magic nor a pcapng section header.
Whatever the file is — a text log, a JSONL journal, a truncated download — it is not a capture, and no amount of further reading will make it one.
Truncated
The file ends part-way through a record.
Kept apart from Error::Malformed because it is the expected state
of a capture whose tcpdump was killed rather than stopped, which any
real corpus contains. Everything yielded before it is good; only the
tail is missing. See Error::is_truncated.
Malformed
A record’s fields contradict the format or each other. More bytes will not help.
Io(Error)
Reading the file failed.
UnsupportedLinkType
Frames recorded from a link layer this crate does not dissect.
Raised rather than silently skipped: a capture taken on a pktap or
usbmon interface would otherwise yield zero packets and look exactly
like a capture with no Pro DJ Link traffic in it.
Fields
link_type: u32The tcpdump.org link-layer header type code.
Implementations§
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()