rusty_pcap/
lib.rs

1use thiserror::Error;
2
3pub mod file_header;
4pub mod link_type;
5pub mod packet_header;
6pub mod sync;
7#[cfg(feature = "tokio-async")]
8pub mod tokio_impl;
9#[derive(Debug, Error)]
10pub enum PcapParseError {
11    #[error(transparent)]
12    IO(#[from] std::io::Error),
13    #[error("Invalid magic number got {0:?}")]
14    InvalidMagicNumber([u8; 4]),
15    #[error("Invalid link type: {0}")]
16    InvalidLinkType(u16),
17    #[error(
18        "Invalid packet length: snap length {snap_length} is greater than included length {incl_len}"
19    )]
20    InvalidPacketLength { snap_length: u32, incl_len: u32 },
21}
22#[derive(Debug, Clone, Copy, PartialEq, Eq)]
23pub enum Endianness {
24    LittleEndian,
25    BigEndian,
26}