[][src]Struct nfq::Message

pub struct Message { /* fields omitted */ }

A network packet with associated metadata.

Methods

impl Message[src]

pub fn get_nfmark(&self) -> u32[src]

Get the nfmark (fwmark) of the packet.

pub fn set_nfmark(&mut self, mark: u32)[src]

Set the associated nfmark (fwmark) of the packet.

pub fn get_indev(&self) -> u32[src]

Get the interface index of the interface the packet arrived on. If the packet is locally generated, or the input interface is no longer known (e.g. POSTROUTING chain), 0 is returned.

pub fn get_physindev(&self) -> u32[src]

Get the interface index of the bridge port the packet arrived on. If the packet is locally generated, or the input interface is no longer known (e.g. POSTROUTING chain), 0 is returned.

pub fn get_outdev(&self) -> u32[src]

Get the interface index of the interface the packet is to be transmitted from. If the packet is locally destinated, or the output interface is unknown (e.g. PREROUTING chain), 0 is returned.

pub fn get_physoutdev(&self) -> u32[src]

Get the interface index of the bridge port the packet is to be transmitted from. If the packet is locally destinated, or the output interface is unknown (e.g. PREROUTING chain), 0 is returned.

pub fn get_original_len(&self) -> usize[src]

Get the original length of the packet.

pub fn is_seg_offloaded(&self) -> bool[src]

Check if the packet is GSO-offloaded.

pub fn is_checksum_ready(&self) -> bool[src]

Check if the checksums are ready, e.g. due to offload.

pub fn get_security_context(&self) -> Option<&str>[src]

Get the security context string of the local process sending the packet. If not applicable, None is returned.

pub fn get_uid(&self) -> Option<u32>[src]

Get the UID of the local process sending the packet. If not applicable, None is returned.

pub fn get_gid(&self) -> Option<u32>[src]

Get the GID of the local process sending the packet. If not applicable, None is returned.

pub fn get_timestamp(&self) -> Option<SystemTime>[src]

Get the timestamp of the packet.

pub fn get_hw_addr(&self) -> Option<&[u8]>[src]

Get the hardware address associated with the packet. For Ethernet packets, the hardware address returned will be the MAC address of the packet source host, if any.

pub fn get_hw_protocol(&self) -> u16[src]

Get the link layer protocol number, e.g. the EtherType field on Ethernet links.

pub fn get_hook(&self) -> u8[src]

Get the netfilter hook number that handles this packet.

pub fn get_payload(&self) -> &[u8][src]

Get the content of the payload.

pub fn get_payload_mut(&mut self) -> &mut [u8][src]

Get the content of the payload in mutable state. If the final verdict is not Verdict::Drop, the change be committed to the kernel.

Note: Once the method is called, the payload will be written back regardles whether the underlying storage is actually modified, therefore it is not optimal performance-wise.

pub fn set_payload(&mut self, payload: impl Into<Vec<u8>>)[src]

Set the content of the payload. If the final verdict is not Verdict::Drop, the updated payload will be committed to the kernel.

pub fn get_verdict(&self) -> Verdict[src]

Get the current verdict.

pub fn set_verdict(&mut self, verdict: Verdict)[src]

Set the current verdict.

Trait Implementations

Auto Trait Implementations

impl RefUnwindSafe for Message

impl !Sync for Message

impl Unpin for Message

impl !UnwindSafe for Message

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.