https://github.com/vorner/tuntap
Rust's wrapper for creation of TUN/TAP devices
https://github.com/vorner/tuntap
Last synced: over 1 year ago
JSON representation
Rust's wrapper for creation of TUN/TAP devices
- Host: GitHub
- URL: https://github.com/vorner/tuntap
- Owner: vorner
- License: apache-2.0
- Created: 2017-12-02T18:01:35.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-03-09T18:04:21.000Z (over 2 years ago)
- Last Synced: 2025-03-17T11:54:09.167Z (over 1 year ago)
- Language: Rust
- Size: 59.6 KB
- Stars: 149
- Watchers: 8
- Forks: 27
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# TunTap
[](https://travis-ci.org/vorner/tuntap)
TUN/TAP wrapper for Rust.
The TUN/TAP allows implementing a virtual network adapter in userspace. This
provides the bindings for Rust.
Create an `Iface` object and `send` or `recv` packets. Making some sense of the
packets is, however, out of scope, you need something else for that.
There's [documentation](https://docs.rs/tun-tap) and some
[examples](https://github.com/vorner/tuntap/tree/master/examples).
## Known issues
* Tested only on Linux. Probably doesn't work anywhere else, but pull requests
adding support for other OSes are welcome.
* The asynchronous interface is very minimal and probably inefficient. It'll
need to be extended to allow more flexible or efficient use.
## Testing
In order to run the tests correctly, a `tun10` device with `10.10.10.1/24` needs
to be created first. You can simply run:
```shell
sh tests/setup.sh
```
To remove it:
```shell
sh tests/clean.sh
```
Sudo permission is required.
## License
Licensed under either of
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
at your option.
### Contribution
Unless you explicitly state otherwise, any contribution intentionally
submitted for inclusion in the work by you, as defined in the Apache-2.0
license, shall be dual licensed as above, without any additional terms
or conditions.