libtun ~master

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:

  1. AdapterType.TUN
    • This is for creating a TUN device
  2. AdapterType.TAP
    • This is for creating a TAP device

License

LGPLv3

Authors:
  • Tristan B. Kildaire
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
Show all 22 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 44 downloads total

Score:
0.8
Short URL:
libtun.dub.pm