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",
|
"description": "TUN adapter for D",
|
||||||
"license": "LGPL-3.0",
|
"license": "LGPL-3.0",
|
||||||
"name": "libtun",
|
"name": "libtun",
|
||||||
"targetType": "library",
|
"targetType": "library"
|
||||||
"preBuildCommands": ["cc $PACKAGE_DIR/source/libtun/tunctl.c -o $PACKAGE_DIR/source/tunctl.o -c"],
|
|
||||||
"lflags": ["$PACKAGE_DIR/source/tunctl.o"]
|
|
||||||
}
|
}
|
|
@ -8,11 +8,13 @@ import core.stdc.stdio;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TUN maintenance routines in `tunctl.c`
|
* TUN maintenance routines in `tunctl.c`
|
||||||
|
* TODO: Use import C here
|
||||||
*/
|
*/
|
||||||
extern (C) int createTun(char* interfaceName, int iffFlags);
|
import libtun.tunctl;
|
||||||
extern (C) int destroyTun(int fd);
|
// extern (C) int createTun(char* interfaceName, int iffFlags);
|
||||||
extern (C) int tunWrite(int fd, char* data, int length);
|
// extern (C) int destroyTun(int fd);
|
||||||
extern (C) int tunRead(int fd, char* data, int amount);
|
// extern (C) int tunWrite(int fd, char* data, int length);
|
||||||
|
// extern (C) int tunRead(int fd, char* data, int amount);
|
||||||
|
|
||||||
public class TUNAdapter
|
public class TUNAdapter
|
||||||
{
|
{
|
||||||
|
@ -50,6 +52,11 @@ public class TUNAdapter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setAddress()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public void close()
|
public void close()
|
||||||
{
|
{
|
||||||
sanityCheck();
|
sanityCheck();
|
||||||
|
|
Loading…
Reference in New Issue