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-routingNF_INET_LOCAL_IN
(1) - Local inputNF_INET_FORWARD
(2) - ForwardingNF_INET_LOCAL_OUT
(3) - Local outputNF_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
impl Clone for NetfilterOpts
Source§fn clone(&self) -> NetfilterOpts
fn clone(&self) -> NetfilterOpts
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for NetfilterOpts
impl Debug for NetfilterOpts
Source§impl Default for NetfilterOpts
impl Default for NetfilterOpts
Source§fn default() -> NetfilterOpts
fn default() -> NetfilterOpts
Returns the “default value” for a type. Read more
Source§impl From<NetfilterOpts> for bpf_netfilter_opts
impl From<NetfilterOpts> for bpf_netfilter_opts
Source§fn from(opts: NetfilterOpts) -> Self
fn from(opts: NetfilterOpts) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for NetfilterOpts
impl RefUnwindSafe for NetfilterOpts
impl Send for NetfilterOpts
impl Sync for NetfilterOpts
impl Unpin for NetfilterOpts
impl UnwindSafe for NetfilterOpts
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)