libbpf_rs

Struct NetfilterOpts

Source
pub struct NetfilterOpts {
    pub protocol_family: i32,
    pub hooknum: i32,
    pub priority: i32,
    pub flags: u32,
    /* private fields */
}
Expand description

Options to be provided when attaching a program to a netfilter hook.

Fields§

§protocol_family: i32

Protocol family for netfilter; supported values are NFPROTO_IPV4 (2) for IPv4 and NFPROTO_IPV6 (10) for IPv6.

§hooknum: i32

Hook number for netfilter; supported values include:

  • NF_INET_PRE_ROUTING (0) - Pre-routing
  • NF_INET_LOCAL_IN (1) - Local input
  • NF_INET_FORWARD (2) - Forwarding
  • NF_INET_LOCAL_OUT (3) - Local output
  • NF_INET_POST_ROUTING (4) - Post-routing
§priority: i32

Priority of the netfilter hook. Lower values are invoked first. Values NF_IP_PRI_FIRST (-2147483648) and NF_IP_PRI_LAST (2147483647) are not allowed. If BPF_F_NETFILTER_IP_DEFRAG is set in flags, the priority must be higher than NF_IP_PRI_CONNTRACK_DEFRAG (-400).

§flags: u32

Bitmask of flags for the netfilter hook.

  • NF_IP_PRI_CONNTRACK_DEFRAG - Enables defragmentation of IP fragments. This hook will only see defragmented packets.

Trait Implementations§

Source§

impl Clone for NetfilterOpts

Source§

fn clone(&self) -> NetfilterOpts

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for NetfilterOpts

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for NetfilterOpts

Source§

fn default() -> NetfilterOpts

Returns the “default value” for a type. Read more
Source§

impl From<NetfilterOpts> for bpf_netfilter_opts

Source§

fn from(opts: NetfilterOpts) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.