Struct dfw::iptables::IPTablesLogger [−][src]
pub struct IPTablesLogger { /* fields omitted */ }
IPTables
implementation which does not interact with the iptables
binary and does not modify the rules active on the host. It does keep a log of every action
executed.
Methods
impl IPTablesLogger
[src]
impl IPTablesLogger
pub fn new() -> IPTablesLogger
[src]
pub fn new() -> IPTablesLogger
Create a new instance of IPTablesLogger
pub fn logs(&self) -> Vec<(String, Option<String>)>
[src]
pub fn logs(&self) -> Vec<(String, Option<String>)>
Get the collected logs.
Trait Implementations
impl Default for IPTablesLogger
[src]
impl Default for IPTablesLogger
fn default() -> IPTablesLogger
[src]
fn default() -> IPTablesLogger
Returns the "default value" for a type. Read more
impl IPTables for IPTablesLogger
[src]
impl IPTables for IPTablesLogger
fn get_policy(&self, table: &str, chain: &str) -> Result<String>
[src]
fn get_policy(&self, table: &str, chain: &str) -> Result<String>
Get the default policy for a table/chain.
fn set_policy(&self, table: &str, chain: &str, policy: &str) -> Result<bool>
[src]
fn set_policy(&self, table: &str, chain: &str, policy: &str) -> Result<bool>
Set the default policy for a table/chain.
fn exists(&self, table: &str, chain: &str, rule: &str) -> Result<bool>
[src]
fn exists(&self, table: &str, chain: &str, rule: &str) -> Result<bool>
Checks for the existence of the rule
in the table/chain. Returns true if the rule exists. Read more
fn chain_exists(&self, table: &str, chain: &str) -> Result<bool>
[src]
fn chain_exists(&self, table: &str, chain: &str) -> Result<bool>
Checks for the existence of the chain
in the table. Returns true if the chain exists. Read more
fn insert(
&self,
table: &str,
chain: &str,
rule: &str,
position: i32
) -> Result<bool>
[src]
fn insert(
&self,
table: &str,
chain: &str,
rule: &str,
position: i32
) -> Result<bool>
Inserts rule
in the position
to the table/chain. Returns true
if the rule is inserted. Read more
fn insert_unique(
&self,
table: &str,
chain: &str,
rule: &str,
position: i32
) -> Result<bool>
[src]
fn insert_unique(
&self,
table: &str,
chain: &str,
rule: &str,
position: i32
) -> Result<bool>
Inserts rule
in the position
to the table/chain if it does not exist. Returns true
if the rule is inserted. Read more
fn replace(
&self,
table: &str,
chain: &str,
rule: &str,
position: i32
) -> Result<bool>
[src]
fn replace(
&self,
table: &str,
chain: &str,
rule: &str,
position: i32
) -> Result<bool>
Replaces rule
in the position
to the table/chain. Returns true
if the rule is replaced. Read more
fn append(&self, table: &str, chain: &str, rule: &str) -> Result<bool>
[src]
fn append(&self, table: &str, chain: &str, rule: &str) -> Result<bool>
Appends rule
to the table/chain. Returns true
if the rule is appended. Read more
fn append_unique(&self, table: &str, chain: &str, rule: &str) -> Result<bool>
[src]
fn append_unique(&self, table: &str, chain: &str, rule: &str) -> Result<bool>
Appends rule
to the table/chain if it does not exist. Returns true
if the rule is appended. Read more
fn append_replace(&self, table: &str, chain: &str, rule: &str) -> Result<bool>
[src]
fn append_replace(&self, table: &str, chain: &str, rule: &str) -> Result<bool>
Appends or replaces rule
to the table/chain if it does not exist. Returns true
if the rule is appended or replaced. Read more
fn delete(&self, table: &str, chain: &str, rule: &str) -> Result<bool>
[src]
fn delete(&self, table: &str, chain: &str, rule: &str) -> Result<bool>
Deletes rule
from the table/chain. Returns true
if the rule is deleted. Read more
fn delete_all(&self, table: &str, chain: &str, rule: &str) -> Result<bool>
[src]
fn delete_all(&self, table: &str, chain: &str, rule: &str) -> Result<bool>
Deletes all repetition of the rule
from the table/chain. Returns true
if the rules are deleted. Read more
fn list(&self, table: &str, chain: &str) -> Result<Vec<String>>
[src]
fn list(&self, table: &str, chain: &str) -> Result<Vec<String>>
Lists rules in the table/chain.
fn list_table(&self, table: &str) -> Result<Vec<String>>
[src]
fn list_table(&self, table: &str) -> Result<Vec<String>>
Lists rules in the table.
fn list_chains(&self, table: &str) -> Result<Vec<String>>
[src]
fn list_chains(&self, table: &str) -> Result<Vec<String>>
Lists the name of each chain in the table.
fn new_chain(&self, table: &str, chain: &str) -> Result<bool>
[src]
fn new_chain(&self, table: &str, chain: &str) -> Result<bool>
Creates a new user-defined chain. Returns true
if the chain is created. Read more
fn flush_chain(&self, table: &str, chain: &str) -> Result<bool>
[src]
fn flush_chain(&self, table: &str, chain: &str) -> Result<bool>
Flushes (deletes all rules) a chain. Returns true
if the chain is flushed. Read more
fn rename_chain(
&self,
table: &str,
old_chain: &str,
new_chain: &str
) -> Result<bool>
[src]
fn rename_chain(
&self,
table: &str,
old_chain: &str,
new_chain: &str
) -> Result<bool>
Renames a chain in the table. Returns true
if the chain is renamed. Read more
fn delete_chain(&self, table: &str, chain: &str) -> Result<bool>
[src]
fn delete_chain(&self, table: &str, chain: &str) -> Result<bool>
Deletes a user-defined chain in the table. Returns true
if the chain is deleted. Read more
fn flush_table(&self, table: &str) -> Result<bool>
[src]
fn flush_table(&self, table: &str) -> Result<bool>
Flushes all chains in a table. Returns true
if the chains are flushed. Read more
fn commit(&self) -> Result<bool>
[src]
fn commit(&self) -> Result<bool>
Commit the changes queued. Only has an effect on some implementations Read more
fn execute(&self, table: &str, command: &str) -> Result<Output>
[src]
fn execute(&self, table: &str, command: &str) -> Result<Output>
Executes a given command
on the chain. Returns the command output if successful. Read more
Auto Trait Implementations
impl Send for IPTablesLogger
impl Send for IPTablesLogger
impl !Sync for IPTablesLogger
impl !Sync for IPTablesLogger