Struct pcap_parser::pcapng::SimplePacketBlock [−][src]
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
Return true if block is encoded as big-endian
Return true if block data was truncated (typically when snaplen < origlen)
Return the raw captured packet data, with padding if present, and eventually truncated.
Check and correct all fields: use magic, fix lengths fields and other values if possible.
Serialize to bytes representation (little-endian). Do not check values