Registry / networking / tun-tap

tun-tap

JSON →
library0.1.4rscratesunverified

TUN/TAP interface wrapper for creating virtual network interfaces on Unix and Windows.

# Cargo.toml [dependencies] tun-tap = "0.1.4"
INSTALL
IMPORT
SIG · TUN-TAP
T
tun-tap
networkingrustv0.1.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Iface
use tun_tap::Iface;

Creates a TUN interface and receives a packet.

use tun_tap::Iface; fn main() -> std::io::Result<()> { let mut iface = Iface::new("tun0", tun_tap::Mode::Tun)?; let mut buf = [0u8; 1500]; let n = iface.recv(&mut buf)?; println!("Received {} bytes", n); Ok(()) }
Debug
Known issues
gotchaRequires root/admin privileges to create TUN/TAP interfaces on most systems.
fix
Run the application with appropriate permissions (e.g., sudo on Linux).
affects: >=0.1.0
Upgrade
Version history
0.1.4latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
15 hits · last 30 days
node
14
OpenAI (training)
1
Resources
tun-tap — cargo add tun-tap · libregistry