pub struct PacketMetadata {
pub src_ip: Ipv4Address,
pub dst_ip: Ipv4Address,
pub src_port: Port,
pub dst_port: Port,
pub protocol: Protocol,
pub tcp_flags: u8,
pub conn_state: Option<ConntrackState>,
pub packet_len: u16,
}Expand description
Extracted packet metadata used for rule evaluation
This avoids passing raw packet bytes – the caller extracts relevant header fields before calling the firewall engine.
Fields§
§src_ip: Ipv4AddressSource IPv4 address
dst_ip: Ipv4AddressDestination IPv4 address
src_port: PortSource port (0 for ICMP)
dst_port: PortDestination port (0 for ICMP)
protocol: ProtocolIP protocol
tcp_flags: u8TCP flags (raw byte)
conn_state: Option<ConntrackState>Connection tracking state (if known)
packet_len: u16Total packet length in bytes
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§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PacketMetadata
impl Debug for PacketMetadata
Auto Trait Implementations§
impl Freeze for PacketMetadata
impl RefUnwindSafe for PacketMetadata
impl Send for PacketMetadata
impl Sync for PacketMetadata
impl Unpin for PacketMetadata
impl UnwindSafe for PacketMetadata
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)