wintun
Safe rust idiomatic bindings for the Wintun C library: https://wintun.net
All features of the Wintun library are wrapped using pure rust types and functions to make usage feel ergonomic.
Usage
Add a dependency on this library to your Cargo.toml
[]
= "0.1"
Inside your code load the wintun.dll signed driver file, downloaded from https://wintun.net
Then either call [Adapter::create] or [Adapter::open] to obtain a wintun
adapter. Start a session with [Adapter::start_session].
Example
use Arc;
//Must be run as Administrator because we create network adapters
See examples/wireguard.rs for a more complete example that writes received packets to a pcap
file.
Features
panic_on_unsent_packets: Panics if a send packet is dropped without being sent. Useful for debugging packet issues because unsent packets that are dropped without being sent hold up wintun's internal ring buffer.
TODO:
- Add async support Requires hooking into a windows specific reactor and registering read interest on wintun's read handle. Asyncify other slow operations via tokio::spawn_blocking. As always, PR's are welcome!
License: MIT