Trait dfw::iptables::IPTables[][src]

pub trait IPTables {
    fn get_policy(&self, table: &str, chain: &str) -> Result<String>;
fn set_policy(&self, table: &str, chain: &str, policy: &str) -> Result<bool>;
fn execute(&self, table: &str, command: &str) -> Result<Output>;
fn exists(&self, table: &str, chain: &str, rule: &str) -> Result<bool>;
fn chain_exists(&self, table: &str, chain: &str) -> Result<bool>;
fn insert(
        &self,
        table: &str,
        chain: &str,
        rule: &str,
        position: i32
    ) -> Result<bool>;
fn insert_unique(
        &self,
        table: &str,
        chain: &str,
        rule: &str,
        position: i32
    ) -> Result<bool>;
fn replace(
        &self,
        table: &str,
        chain: &str,
        rule: &str,
        position: i32
    ) -> Result<bool>;
fn append(&self, table: &str, chain: &str, rule: &str) -> Result<bool>;
fn append_unique(
        &self,
        table: &str,
        chain: &str,
        rule: &str
    ) -> Result<bool>;
fn append_replace(
        &self,
        table: &str,
        chain: &str,
        rule: &str
    ) -> Result<bool>;
fn delete(&self, table: &str, chain: &str, rule: &str) -> Result<bool>;
fn delete_all(&self, table: &str, chain: &str, rule: &str) -> Result<bool>;
fn list(&self, table: &str, chain: &str) -> Result<Vec<String>>;
fn list_table(&self, table: &str) -> Result<Vec<String>>;
fn list_chains(&self, table: &str) -> Result<Vec<String>>;
fn new_chain(&self, table: &str, chain: &str) -> Result<bool>;
fn flush_chain(&self, table: &str, chain: &str) -> Result<bool>;
fn rename_chain(
        &self,
        table: &str,
        old_chain: &str,
        new_chain: &str
    ) -> Result<bool>;
fn delete_chain(&self, table: &str, chain: &str) -> Result<bool>;
fn flush_table(&self, table: &str) -> Result<bool>;
fn commit(&self) -> Result<bool>; }

Compatibility trait to generalize the API used by rust-iptables.

Required Methods

Get the default policy for a table/chain.

Set the default policy for a table/chain.

Executes a given command on the chain. Returns the command output if successful.

Checks for the existence of the rule in the table/chain. Returns true if the rule exists.

Checks for the existence of the chain in the table. Returns true if the chain exists.

Inserts rule in the position to the table/chain. Returns true if the rule is inserted.

Inserts rule in the position to the table/chain if it does not exist. Returns true if the rule is inserted.

Replaces rule in the position to the table/chain. Returns true if the rule is replaced.

Appends rule to the table/chain. Returns true if the rule is appended.

Appends rule to the table/chain if it does not exist. Returns true if the rule is appended.

Appends or replaces rule to the table/chain if it does not exist. Returns true if the rule is appended or replaced.

Deletes rule from the table/chain. Returns true if the rule is deleted.

Deletes all repetition of the rule from the table/chain. Returns true if the rules are deleted.

Lists rules in the table/chain.

Lists rules in the table.

Lists the name of each chain in the table.

Creates a new user-defined chain. Returns true if the chain is created.

Flushes (deletes all rules) a chain. Returns true if the chain is flushed.

Renames a chain in the table. Returns true if the chain is renamed.

Deletes a user-defined chain in the table. Returns true if the chain is deleted.

Flushes all chains in a table. Returns true if the chains are flushed.

Commit the changes queued. Only has an effect on some implementations

Implementations on Foreign Types

impl IPTables for IPTables
[src]

Implementors