pub struct TunnelConfig {
pub name: String,
pub tunnel_type: TunnelType,
pub mtu: u16,
pub local_address: Ipv4Address,
pub peer_address: Ipv4Address,
pub subnet_mask: Ipv4Address,
}Expand description
Configuration for a tunnel interface
Fields§
§name: StringInterface name (e.g., “tun0”, “tap0”)
tunnel_type: TunnelTypeTunnel type (L3 TUN or L2 TAP)
mtu: u16Maximum transmission unit
local_address: Ipv4AddressLocal IP address assigned to this tunnel
peer_address: Ipv4AddressRemote peer IP address
subnet_mask: Ipv4AddressSubnet mask for the tunnel network
Implementations§
Source§impl TunnelConfig
impl TunnelConfig
Sourcepub fn new(
name: &str,
tunnel_type: TunnelType,
local_address: Ipv4Address,
peer_address: Ipv4Address,
subnet_mask: Ipv4Address,
) -> Self
pub fn new( name: &str, tunnel_type: TunnelType, local_address: Ipv4Address, peer_address: Ipv4Address, subnet_mask: Ipv4Address, ) -> Self
Create a new tunnel configuration with default MTU
Trait Implementations§
Source§impl Clone for TunnelConfig
impl Clone for TunnelConfig
Source§fn clone(&self) -> TunnelConfig
fn clone(&self) -> TunnelConfig
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TunnelConfig
impl Debug for TunnelConfig
Source§impl PartialEq for TunnelConfig
impl PartialEq for TunnelConfig
impl StructuralPartialEq for TunnelConfig
Auto Trait Implementations§
impl Freeze for TunnelConfig
impl RefUnwindSafe for TunnelConfig
impl Send for TunnelConfig
impl Sync for TunnelConfig
impl Unpin for TunnelConfig
impl UnwindSafe for TunnelConfig
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)