pub struct PacketMetadata {
pub l2_offset: u16,
pub l3_offset: u16,
pub l4_offset: u16,
pub protocol: Protocol,
pub ip_version: IpVersion,
pub flow_hash: u64,
pub src_port: u16,
pub dst_port: u16,
pub flags: u8,
/* private fields */
}Expand description
Pre-parsed packet metadata for fast path processing.
Storing parsed header offsets and protocol information avoids repeated parsing in the hot path.
Fields§
§l2_offset: u16Offset to L2 (Ethernet) header from packet start.
l3_offset: u16Offset to L3 (IP) header from packet start.
l4_offset: u16Offset to L4 (TCP/UDP) header from packet start.
protocol: ProtocolL4 protocol type.
ip_version: IpVersionIP version.
flow_hash: u64Cached flow hash for connection tracking lookups.
src_port: u16Source port (for TCP/UDP).
dst_port: u16Destination port (for TCP/UDP).
flags: u8Packet flags (e.g., TCP flags).
Implementations§
Trait Implementations§
Source§impl Clone for PacketMetadata
impl Clone for PacketMetadata
Source§fn clone(&self) -> PacketMetadata
fn clone(&self) -> PacketMetadata
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PacketMetadata
Source§impl Debug for PacketMetadata
impl Debug for PacketMetadata
Source§impl Default for PacketMetadata
impl Default for PacketMetadata
Source§fn default() -> PacketMetadata
fn default() -> PacketMetadata
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PacketMetadata
impl RefUnwindSafe for PacketMetadata
impl Send for PacketMetadata
impl Sync for PacketMetadata
impl Unpin for PacketMetadata
impl UnsafeUnpin for PacketMetadata
impl UnwindSafe for PacketMetadata
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