pub enum IpTablesCommands {
Restore,
RestoreFrom {
source_ip: IpAddr,
},
DropFrom {
source_ip: IpAddr,
},
Get,
}
Expand description
All Iptables commands require root privileges
so we’ll run them with sudo
assuming that the user
has sudo access. We’ll fail otherwise.
Variants§
Restore
Flush all rules across all the peers so that all nodes can communicate with each other.
RestoreFrom
Remove all inbound rules in the target node for a given source IP.
DropFrom
Add a rule to drop all inbound traffic into the target node originating from a given source IP.
Get
List all inbound rules in the target node.
Trait Implementations§
Source§impl Clone for IpTablesCommands
impl Clone for IpTablesCommands
Source§fn clone(&self) -> IpTablesCommands
fn clone(&self) -> IpTablesCommands
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Command for IpTablesCommands
impl Command for IpTablesCommands
Source§impl Debug for IpTablesCommands
impl Debug for IpTablesCommands
Source§impl From<IpTablesCommands> for Commands
impl From<IpTablesCommands> for Commands
Source§fn from(command: IpTablesCommands) -> Self
fn from(command: IpTablesCommands) -> Self
Converts to this type from the input type.
Source§impl PartialEq for IpTablesCommands
impl PartialEq for IpTablesCommands
impl Eq for IpTablesCommands
impl StructuralPartialEq for IpTablesCommands
Auto Trait Implementations§
impl Freeze for IpTablesCommands
impl RefUnwindSafe for IpTablesCommands
impl Send for IpTablesCommands
impl Sync for IpTablesCommands
impl Unpin for IpTablesCommands
impl UnwindSafe for IpTablesCommands
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.