[][src]Struct nfq::Queue

pub struct Queue { /* fields omitted */ }

A NetFilter queue.

Methods

impl Queue[src]

pub fn open() -> Result<Queue>[src]

Open a NetFilter socket and queue connection.

pub fn set_recv_enobufs(&mut self, enable: bool) -> Result<()>[src]

Change whether ENOBUFS should be received by the application if the kernel queue is full. As user-space usually cannot do any special about this, open will turn this off by default.

pub fn bind(&mut self, queue_num: u16) -> Result<()>[src]

Bind to a specific queue number.

This method will set the copy range to 65535 by default. It can be changed by using set_copy_range.

pub fn set_fail_open(&mut self, queue_num: u16, enabled: bool) -> Result<()>[src]

Set whether the kernel should drop or accept a packet if the queue is full.

pub fn set_recv_gso(&mut self, queue_num: u16, enabled: bool) -> Result<()>[src]

Set whether we should receive GSO-enabled and partial checksum packets.

pub fn set_recv_uid_gid(&mut self, queue_num: u16, enabled: bool) -> Result<()>[src]

Set whether we should receive UID/GID along with packets.

pub fn set_recv_security_context(
    &mut self,
    queue_num: u16,
    enabled: bool
) -> Result<()>
[src]

Set whether we should receive security context strings along with packets.

pub fn set_copy_range(&mut self, queue_num: u16, range: u16) -> Result<()>[src]

Set copy range. Packet larger than the specified range will be truncated. If the range given is 0, only metadata will be copied.

To get the original length of truncated packet, use Message::get_original_len.

pub fn set_queue_max_len(&mut self, queue_num: u16, len: u32) -> Result<()>[src]

Set the maximum kernel queue length. If the application cannot recv fast enough, newly queued packet will be dropped (or accepted if fail open is enabled).

pub fn unbind(&mut self, queue_num: u16) -> Result<()>[src]

Unbind from a specific queue number.

pub fn recv(&mut self) -> Result<Message>[src]

Receive a packet from the queue.

pub fn verdict(&mut self, msg: Message) -> Result<()>[src]

Verdict a message.

Trait Implementations

impl Drop for Queue[src]

impl Send for Queue[src]

Auto Trait Implementations

impl RefUnwindSafe for Queue

impl !Sync for Queue

impl Unpin for Queue

impl !UnwindSafe for Queue

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.