pub struct TunnelManager { /* private fields */ }Expand description
Manager for all tunnel interfaces on the system
Implementations§
Source§impl TunnelManager
impl TunnelManager
Sourcepub fn create_tunnel(&mut self, config: TunnelConfig) -> Result<(), TunnelError>
pub fn create_tunnel(&mut self, config: TunnelConfig) -> Result<(), TunnelError>
Create and register a new tunnel interface
Sourcepub fn destroy_tunnel(&mut self, name: &str) -> Result<(), TunnelError>
pub fn destroy_tunnel(&mut self, name: &str) -> Result<(), TunnelError>
Destroy (remove) a tunnel interface
Sourcepub fn get_tunnel(&self, name: &str) -> Option<&TunnelInterface>
pub fn get_tunnel(&self, name: &str) -> Option<&TunnelInterface>
Get a reference to a tunnel interface
Sourcepub fn get_tunnel_mut(&mut self, name: &str) -> Option<&mut TunnelInterface>
pub fn get_tunnel_mut(&mut self, name: &str) -> Option<&mut TunnelInterface>
Get a mutable reference to a tunnel interface
Sourcepub fn list_tunnels(&self) -> Vec<&str>
pub fn list_tunnels(&self) -> Vec<&str>
List all tunnel interface names
Sourcepub fn tunnel_count(&self) -> usize
pub fn tunnel_count(&self) -> usize
Get the number of tunnels
Sourcepub fn routes(&self) -> &RouteInjection
pub fn routes(&self) -> &RouteInjection
Access the route injection table
Sourcepub fn routes_mut(&mut self) -> &mut RouteInjection
pub fn routes_mut(&mut self) -> &mut RouteInjection
Access the route injection table mutably