libtun 0.0.13
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
TUNAdapter
The TUNAdapter
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. Kildaire
- 0.0.13 released 7 months ago
- deavmi/libtun
- LGPL-3.0
- Copyright © 2021, Tristan B. Kildaire
- Authors:
- Dependencies:
- none
- Versions:
-
0.0.13 2021-Oct-25 0.0.12 2021-Oct-24 0.0.11 2021-Oct-24 0.0.10 2021-Oct-24 0.0.9 2021-Oct-24 - Download Stats:
-
-
0 downloads today
-
0 downloads this week
-
0 downloads this month
-
15 downloads total
-
- Score:
- 0.7
- Short URL:
- libtun.dub.pm