Hypertube
Hypertube is a library for the creation and usage of TUN devices. Hypertube is meant to be a replacement for tun that aims to improve the cli and allow for writing to and reading from multiple queues at the same time.
Hypertube is not a perfect replacement for tun
Hypertube is not currently cross-platform, but I plan for it to be in the future.
Usage
To create a TUN device, use a DeviceBuilder.
There are several ways to create a DeviceBuilder:
hypertube::builder()DeviceBuilder::new()orDeviceBuilder::default()Device::builder()
Eg.
let device = builder
.build
.unwrap;
Now to write to a Device.
In order to write to or read from a Device you need to create a queue.
There are two types of queues, blocking and nonblocking.
let device = builder
.with_num_queues
.build
.unwrap;
let queue1 = device.queue;
let queue2 = device.queue_nonblocking;
queue2.write;
let mut buf = ;
queue1.read;
Blocking and nonblocking queues are accessed from the same pool of queues.
The pool of queues is created when the device is built.
In the future, the ability to add or remove queues after the Device is created should be added.
Todo
- Documentation
- Non blocking queues
- IPV6 support
- Cross-platform support