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: u32Block type (little endian)
block_len1: u32§origlen: u32Original packet length
data: &'a [u8]§block_len2: u32Trait Implementations§
Source§impl<'a> Debug for SimplePacketBlock<'a>
impl<'a> Debug for SimplePacketBlock<'a>
Source§impl PcapNGPacketBlock for SimplePacketBlock<'_>
impl PcapNGPacketBlock for SimplePacketBlock<'_>
Source§fn big_endian(&self) -> bool
fn big_endian(&self) -> bool
Return true if block is encoded as big-endian
Source§fn truncated(&self) -> bool
fn truncated(&self) -> bool
Return true if block data was truncated (typically when snaplen < origlen)
Source§fn raw_packet_data(&self) -> &[u8] ⓘ
fn raw_packet_data(&self) -> &[u8] ⓘ
Return the raw captured packet data, with padding if present, and eventually truncated.
Source§impl ToVec for SimplePacketBlock<'_>
Available on crate feature serialize only.
impl ToVec for SimplePacketBlock<'_>
Available on crate feature
serialize only.Auto Trait Implementations§
impl<'a> Freeze for SimplePacketBlock<'a>
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§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more