pub struct OwnedPacket {
pub data: Vec<u8>,
pub timestamp: Timestamp,
pub original_len: usize,
pub status: PacketStatus,
pub direction: PacketDirection,
pub rxhash: u32,
pub vlan_tci: u16,
pub vlan_tpid: u16,
pub ll_protocol: u16,
pub source_ll_addr: [u8; 8],
pub source_ll_addr_len: u8,
}Expand description
An owned copy of a captured packet, independent of the ring buffer.
Created via Packet::to_owned(). Carries enough metadata for DPI,
flow tracking, and PCAP-style export — the trade-off is ~50 bytes per
owned packet vs the bare-data minimum.
Fields§
§data: Vec<u8>Raw packet bytes (from MAC header).
timestamp: TimestampKernel timestamp.
original_len: usizeOriginal packet length on the wire (may exceed data.len() if truncated).
status: PacketStatusDecoded per-packet status flags from tp_status.
direction: PacketDirectionDirection relative to the capturing host.
rxhash: u32Kernel-supplied flow hash (tp_rxhash); 0 if fill_rxhash was disabled.
vlan_tci: u16Raw VLAN TCI; check status.vlan_valid.
vlan_tpid: u16Raw VLAN TPID; check status.vlan_tpid_valid.
ll_protocol: u16EtherType / link-layer protocol (host byte order).
source_ll_addr: [u8; 8]Source link-layer address (up to 8 bytes — the kernel’s
sockaddr_ll::sll_addr capacity).
source_ll_addr_len: u8Valid bytes in source_ll_addr (matches kernel sll_halen,
clamped to 8).
Implementations§
Source§impl OwnedPacket
impl OwnedPacket
Sourcepub fn source_ll_addr(&self) -> &[u8] ⓘ
pub fn source_ll_addr(&self) -> &[u8] ⓘ
Source link-layer address as a slice of the valid portion.
Source§impl OwnedPacket
impl OwnedPacket
Sourcepub fn parse(&self) -> Result<SlicedPacket<'_>, SliceError>
pub fn parse(&self) -> Result<SlicedPacket<'_>, SliceError>
Parse Ethernet/IP/TCP/UDP headers from owned packet data (feature: parse).
Trait Implementations§
Source§impl Clone for OwnedPacket
impl Clone for OwnedPacket
Source§fn clone(&self) -> OwnedPacket
fn clone(&self) -> OwnedPacket
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more