Struct iptables::IPTables [] [src]

pub struct IPTables {
    pub cmd: &'static str,
    pub has_check: bool,
    pub has_wait: bool,
}

Contains the iptables command and shows if it supports -w and -C options. Use new method to create a new instance of this struct.

Fields

The utility command which must be 'iptables' or 'ip6tables'.

Indicates if iptables has -C (--check) option

Indicates if iptables has -w (--wait) option

Methods

impl IPTables
[src]

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.