Universal Tun/Tap for Rust

Crates.io

This library aims to provide robust, well-tested, unified APIs to open Tun/Tap devices on different OSes. It is runtime-agnostic so that you can create your cross-platform wrappers for Tokio, async-std and so on.

Usage

It simply provides options to open Tun/Tap device files. More options are listed in the documentation.

```rust use utuntap::tun;

let (mut file, filename) = tun::OpenOptions::new() .packet_info(false) // Only available on Linux .number(10) .open() .expect("failed to open device"); ```

Support Platforms

| OS | CI Status | Comment | | -- | ------ | ------- | | Linux | Build Status | musl is also supported. | | OpenBSD | builds.sr.ht status | According to the manual, each packet read or written is prefixed with a tunnel header consisting of a 4-byte network byte order integer containing the address family. The values are listed here. |