Struct smoltcp::phy::TunTapInterface
source · pub struct TunTapInterface { /* private fields */ }
Expand description
A virtual TUN (IP) or TAP (Ethernet) interface.
Implementations§
source§impl TunTapInterface
impl TunTapInterface
sourcepub fn new(name: &str, medium: Medium) -> Result<TunTapInterface>
pub fn new(name: &str, medium: Medium) -> Result<TunTapInterface>
Attaches to a TUN/TAP interface called name
, or creates it if it does not exist.
If name
is a persistent interface configured with UID of the current user,
no special privileges are needed. Otherwise, this requires superuser privileges
or a corresponding capability set on the executable.