pub enum NetInterface {
Loopback,
LocalHost,
LocalSubnet(IpRange),
Wan,
Named(String),
}Expand description
Classification of a network interface for the policy decision.
The engine can decide differently based on it:
Loopback+LocalHost→ oftenProtectionLevel::None(bytes do not leave the host).LocalSubnet→ management networks withSigninstead ofEncrypt.Wan→ the most restrictive policy.Named→ user-configured classification (e.g.tun0as VPN-protected,can0-gwas a vehicle-bus gateway).
Variants§
Loopback
127.0.0.0/8 or ::1.
LocalHost
Host-local transport outside loopback (shared memory, Unix domain socket) — bytes do not leave the host kernel.
LocalSubnet(IpRange)
Address in a configured private range (e.g.
10.0.0.0/24, 192.168.0.0/16).
Wan
Everything else — public IP, unknown interface.
Named(String)
User-configured interface class by name.
Trait Implementations§
Source§impl Clone for NetInterface
impl Clone for NetInterface
Source§fn clone(&self) -> NetInterface
fn clone(&self) -> NetInterface
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NetInterface
impl Debug for NetInterface
impl Eq for NetInterface
Source§impl Hash for NetInterface
impl Hash for NetInterface
Source§impl PartialEq for NetInterface
impl PartialEq for NetInterface
Source§fn eq(&self, other: &NetInterface) -> bool
fn eq(&self, other: &NetInterface) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for NetInterface
Auto Trait Implementations§
impl Freeze for NetInterface
impl RefUnwindSafe for NetInterface
impl Send for NetInterface
impl Sync for NetInterface
impl Unpin for NetInterface
impl UnsafeUnpin for NetInterface
impl UnwindSafe for NetInterface
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