Struct pcap_parser::pcapng::SimplePacketBlock
source · [−]pub struct SimplePacketBlock<'a> {
pub block_type: u32,
pub block_len1: u32,
pub origlen: u32,
pub data: &'a [u8],
pub block_len2: u32,
}
Expand description
The Simple Packet Block (SPB) is a lightweight container for storing the packets coming from the network.
This struct is a thin abstraction layer, and stores the raw block data.
For ex the data
field is stored with the padding.
It implements the PcapNGPacketBlock
trait, which provides helper functions.
Fields
block_type: u32
Block type (little endian)
block_len1: u32
origlen: u32
Original packet length
data: &'a [u8]
block_len2: u32
Trait Implementations
sourceimpl<'a> Debug for SimplePacketBlock<'a>
impl<'a> Debug for SimplePacketBlock<'a>
sourceimpl<'a> PcapNGPacketBlock for SimplePacketBlock<'a>
impl<'a> PcapNGPacketBlock for SimplePacketBlock<'a>
sourcefn big_endian(&self) -> bool
fn big_endian(&self) -> bool
Return true if block is encoded as big-endian
sourcefn truncated(&self) -> bool
fn truncated(&self) -> bool
Return true if block data was truncated (typically when snaplen < origlen)
sourceimpl<'a> ToVec for SimplePacketBlock<'a>
Available on crate feature serialize
only.
impl<'a> ToVec for SimplePacketBlock<'a>
Available on crate feature
serialize
only.Auto Trait Implementations
impl<'a> RefUnwindSafe for SimplePacketBlock<'a>
impl<'a> Send for SimplePacketBlock<'a>
impl<'a> Sync for SimplePacketBlock<'a>
impl<'a> Unpin for SimplePacketBlock<'a>
impl<'a> UnwindSafe for SimplePacketBlock<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more