mirror of https://github.com/deavmi/libtun.git
Switched to using ImportC
This commit is contained in:
parent
8ad431a76b
commit
2fbfef56f8
4
dub.json
4
dub.json
|
@ -6,7 +6,5 @@
|
|||
"description": "TUN adapter for D",
|
||||
"license": "LGPL-3.0",
|
||||
"name": "libtun",
|
||||
"targetType": "library",
|
||||
"preBuildCommands": ["cc $PACKAGE_DIR/source/libtun/tunctl.c -o $PACKAGE_DIR/source/tunctl.o -c"],
|
||||
"lflags": ["$PACKAGE_DIR/source/tunctl.o"]
|
||||
"targetType": "library"
|
||||
}
|
|
@ -8,11 +8,13 @@ import core.stdc.stdio;
|
|||
|
||||
/**
|
||||
* TUN maintenance routines in `tunctl.c`
|
||||
* TODO: Use import C here
|
||||
*/
|
||||
extern (C) int createTun(char* interfaceName, int iffFlags);
|
||||
extern (C) int destroyTun(int fd);
|
||||
extern (C) int tunWrite(int fd, char* data, int length);
|
||||
extern (C) int tunRead(int fd, char* data, int amount);
|
||||
import libtun.tunctl;
|
||||
// extern (C) int createTun(char* interfaceName, int iffFlags);
|
||||
// extern (C) int destroyTun(int fd);
|
||||
// extern (C) int tunWrite(int fd, char* data, int length);
|
||||
// extern (C) int tunRead(int fd, char* data, int amount);
|
||||
|
||||
public class TUNAdapter
|
||||
{
|
||||
|
@ -50,6 +52,11 @@ public class TUNAdapter
|
|||
}
|
||||
}
|
||||
|
||||
public void setAddress()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void close()
|
||||
{
|
||||
sanityCheck();
|
||||
|
|
Loading…
Reference in New Issue