libtun 0.0.1-alpha
TUN adapter for D
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
libtun
TUN/TAP adapter for D-based applications
Usage
First add it to your dub-based project via:
dub add libtun
Adapter
The Adapter
class provides you with all you need to get started. One can construct a new adapter as follows:
import libtun.adapter;
void main()
{
try
{
TUNAdapter tun = new TUNAdapter("interface0", AdapterType.TUN);
}
catch(TUNException)
{
}
}
Reading and writing is easy:
byte[] data;
try
{
tun.receive(data);
tun.write([65,66,66,65]);
}
catch(TUNException)
{
}
There are two types of adapters:
AdapterType.TUN
- This is for creating a TUN device
AdapterType.TAP
- This is for creating a TAP device
License
LGPLv3
- Registered by Tristan B. Velloza Kildaire
- 0.0.1-alpha released 2 years ago
- deavmi/libtun
- LGPL-3.0
- Copyright © 2021, Tristan B. Kildaire
- Authors:
- Dependencies:
- none
- Versions:
-
0.0.19 2022-Nov-28 0.0.18 2022-Nov-28 0.0.17 2022-Nov-28 0.0.16 2022-Nov-28 0.0.15 2022-Nov-28 - Download Stats:
-
-
0 downloads today
-
0 downloads this week
-
0 downloads this month
-
44 downloads total
-
- Score:
- 0.8
- Short URL:
- libtun.dub.pm