pub struct Chain<'a> { /* private fields */ }Expand description
Implementations§
Source§impl<'a> Chain<'a>
impl<'a> Chain<'a>
Sourcepub fn new<T: AsRef<CStr>>(name: T, table: &'a Table) -> Chain<'a>
pub fn new<T: AsRef<CStr>>(name: T, table: &'a Table) -> Chain<'a>
Creates a new chain instance inside the given Table and with the given name.
Sourcepub fn set_hook(&mut self, hook: Hook, priority: Priority)
pub fn set_hook(&mut self, hook: Hook, priority: Priority)
Sets the hook and priority for this chain. Without calling this method the chain well become a “regular chain” without any hook and will thus not receive any traffic unless some rule forward packets to it via goto or jump verdicts.
By calling set_hook with a hook the chain that is created will be registered with that
hook and is thus a “base chain”. A “base chain” is an entry point for packets from the
networking stack.
Sourcepub fn set_type(&mut self, chain_type: ChainType)
pub fn set_type(&mut self, chain_type: ChainType)
Set the type of a base chain. This only applies if the chain has been registered
with a hook by calling set_hook.
Sourcepub fn set_policy(&mut self, policy: Policy)
pub fn set_policy(&mut self, policy: Policy)
Sets the default policy for this chain. That means what action netfilter will apply to packets processed by this chain, but that did not match any rules in it.
Sourcepub fn set_device<T: AsRef<CStr>>(&mut self, device: T)
pub fn set_device<T: AsRef<CStr>>(&mut self, device: T)
Sets the device for this chain. This only applies if the chain has been registered with an ingress hook by calling set_hook.