mirror of
https://gitlab.com/Monsterovich/lanemu.git
synced 2024-07-07 06:01:16 +02:00
Tuntap refactoring
This commit is contained in:
parent
676789508a
commit
4c2393d36a
|
@ -35,7 +35,7 @@ OBJECTDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}
|
|||
|
||||
# Object Files
|
||||
OBJECTFILES= \
|
||||
${OBJECTDIR}/org_p2pvpn_tuntap_TunTapLinux.o
|
||||
${OBJECTDIR}/tuntap.o
|
||||
|
||||
|
||||
# C Compiler Flags
|
||||
|
@ -62,10 +62,10 @@ dist/Release/libTunTapLinux64.so: ${OBJECTFILES}
|
|||
${MKDIR} -p dist/Release
|
||||
${LINK.c} -o dist/Release/libTunTapLinux64.so ${OBJECTFILES} ${LDLIBSOPTIONS} -shared -fPIC
|
||||
|
||||
${OBJECTDIR}/org_p2pvpn_tuntap_TunTapLinux.o: org_p2pvpn_tuntap_TunTapLinux.c
|
||||
${OBJECTDIR}/tuntap.o: tuntap.c
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.c) -O2 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/org_p2pvpn_tuntap_TunTapLinux.o org_p2pvpn_tuntap_TunTapLinux.c
|
||||
$(COMPILE.c) -O2 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/tuntap.o tuntap.c
|
||||
|
||||
# Subprojects
|
||||
.build-subprojects:
|
||||
|
|
|
@ -35,7 +35,7 @@ OBJECTDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}
|
|||
|
||||
# Object Files
|
||||
OBJECTFILES= \
|
||||
${OBJECTDIR}/org_p2pvpn_tuntap_TunTapLinux.o
|
||||
${OBJECTDIR}/tuntap.o
|
||||
|
||||
|
||||
# C Compiler Flags
|
||||
|
@ -62,10 +62,10 @@ dist/Release/libTunTapLinux.so: ${OBJECTFILES}
|
|||
${MKDIR} -p dist/Release
|
||||
${LINK.c} -o dist/Release/libTunTapLinux.so ${OBJECTFILES} ${LDLIBSOPTIONS} -shared -fPIC
|
||||
|
||||
${OBJECTDIR}/org_p2pvpn_tuntap_TunTapLinux.o: org_p2pvpn_tuntap_TunTapLinux.c
|
||||
${OBJECTDIR}/tuntap.o: tuntap.c
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.c) -O2 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/org_p2pvpn_tuntap_TunTapLinux.o org_p2pvpn_tuntap_TunTapLinux.c
|
||||
$(COMPILE.c) -O2 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/tuntap.o tuntap.c
|
||||
|
||||
# Subprojects
|
||||
.build-subprojects:
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<logicalFolder name="HeaderFiles"
|
||||
displayName="Header Files"
|
||||
projectFiles="true">
|
||||
<itemPath>org_p2pvpn_tuntap_TunTapLinux.h</itemPath>
|
||||
<itemPath>tuntap.h</itemPath>
|
||||
</logicalFolder>
|
||||
<logicalFolder name="ResourceFiles"
|
||||
displayName="Resource Files"
|
||||
|
@ -13,7 +13,7 @@
|
|||
<logicalFolder name="SourceFiles"
|
||||
displayName="Source Files"
|
||||
projectFiles="true">
|
||||
<itemPath>org_p2pvpn_tuntap_TunTapLinux.c</itemPath>
|
||||
<itemPath>tuntap.c</itemPath>
|
||||
</logicalFolder>
|
||||
<logicalFolder name="ExternalFiles"
|
||||
displayName="Important Files"
|
||||
|
@ -33,18 +33,15 @@
|
|||
<cTool>
|
||||
<developmentMode>5</developmentMode>
|
||||
<architecture>2</architecture>
|
||||
<commandLine>$(shell pkg-config --cflags jdk)</commandLine>
|
||||
<preprocessorList>
|
||||
<Elem>USE_TRANSIENT</Elem>
|
||||
</preprocessorList>
|
||||
<commandLine>$(shell pkg-config --cflags jdk) ${EXTRA_CFLAGS}</commandLine>
|
||||
</cTool>
|
||||
<linkerTool>
|
||||
<output>dist/Release/libTunTapLinux64.so</output>
|
||||
</linkerTool>
|
||||
</compileType>
|
||||
<item path="org_p2pvpn_tuntap_TunTapLinux.c" ex="false" tool="0" flavor2="0">
|
||||
<item path="tuntap.c" ex="false" tool="0" flavor2="0">
|
||||
</item>
|
||||
<item path="org_p2pvpn_tuntap_TunTapLinux.h" ex="false" tool="3" flavor2="0">
|
||||
<item path="tuntap.h" ex="false" tool="3" flavor2="0">
|
||||
</item>
|
||||
</conf>
|
||||
<conf name="Release-i386" type="2">
|
||||
|
@ -57,18 +54,15 @@
|
|||
<cTool>
|
||||
<developmentMode>5</developmentMode>
|
||||
<architecture>1</architecture>
|
||||
<commandLine>$(shell pkg-config --cflags jdk)</commandLine>
|
||||
<preprocessorList>
|
||||
<Elem>USE_TRANSIENT</Elem>
|
||||
</preprocessorList>
|
||||
<commandLine>$(shell pkg-config --cflags jdk) ${EXTRA_CFLAGS}</commandLine>
|
||||
</cTool>
|
||||
<linkerTool>
|
||||
<output>dist/Release/libTunTapLinux.so</output>
|
||||
</linkerTool>
|
||||
</compileType>
|
||||
<item path="org_p2pvpn_tuntap_TunTapLinux.c" ex="false" tool="0" flavor2="9">
|
||||
<item path="tuntap.c" ex="false" tool="0" flavor2="0">
|
||||
</item>
|
||||
<item path="org_p2pvpn_tuntap_TunTapLinux.h" ex="false" tool="3" flavor2="0">
|
||||
<item path="tuntap.h" ex="false" tool="3" flavor2="0">
|
||||
</item>
|
||||
</conf>
|
||||
</confs>
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
#endif
|
||||
|
||||
#include <jni.h>
|
||||
#include "org_p2pvpn_tuntap_TunTapLinux.h"
|
||||
#include "tuntap.h"
|
||||
|
||||
void setFdDev(JNIEnv *env, jobject this, int fd, char* dev) {
|
||||
jfieldID jfd, jdev;
|
||||
|
@ -73,11 +73,6 @@ int getFd(JNIEnv *env, jobject this) {
|
|||
return (*env)->GetIntField(env, this, jfd);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: jtuntap_TunTap
|
||||
* Method: openTun
|
||||
* Signature: ()I
|
||||
*/
|
||||
JFUNC(jint, openTun) {
|
||||
struct ifreq ifr;
|
||||
int fd;
|
||||
|
@ -130,20 +125,10 @@ JFUNC(jint, openTun) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: jtuntap_TunTap
|
||||
* Method: close
|
||||
* Signature: ()V
|
||||
*/
|
||||
JFUNC(void, close) {
|
||||
close(getFd(env, this));
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: jtuntap_TunTap
|
||||
* Method: write
|
||||
* Signature: ([BI)V
|
||||
*/
|
||||
JFUNC(void, write, jbyteArray jb, jint len) {
|
||||
int fd;
|
||||
jbyte *b;
|
||||
|
@ -156,11 +141,6 @@ JFUNC(void, write, jbyteArray jb, jint len) {
|
|||
(*env)->ReleaseByteArrayElements(env, jb, b, JNI_ABORT);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: jtuntap_TunTap
|
||||
* Method: read
|
||||
* Signature: ([B)I
|
||||
*/
|
||||
JFUNC(jint, read, jbyteArray jb) {
|
||||
int fd;
|
||||
jbyte *b;
|
|
@ -19,45 +19,15 @@
|
|||
*/
|
||||
|
||||
#include <jni.h>
|
||||
/* Header for class org_p2pvpn_tuntap_TunTapLinux */
|
||||
|
||||
#ifndef _Included_org_p2pvpn_tuntap_TunTapLinux
|
||||
#define _Included_org_p2pvpn_tuntap_TunTapLinux
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#ifndef TUNTAP_H
|
||||
#define TUNTAP_H
|
||||
|
||||
#define JFUNC(type, name, ...) JNIEXPORT type JNICALL Java_org_p2pvpn_tuntap_TunTapLinux_##name (JNIEnv *env, jobject this, ##__VA_ARGS__)
|
||||
|
||||
/*
|
||||
* Class: org_p2pvpn_tuntap_TunTapLinux
|
||||
* Method: openTun
|
||||
* Signature: ()I
|
||||
*/
|
||||
JFUNC(jint, openTun);
|
||||
|
||||
/*
|
||||
* Class: org_p2pvpn_tuntap_TunTapLinux
|
||||
* Method: close
|
||||
* Signature: ()V
|
||||
*/
|
||||
JFUNC(void, close);
|
||||
|
||||
/*
|
||||
* Class: org_p2pvpn_tuntap_TunTapLinux
|
||||
* Method: write
|
||||
* Signature: ([BI)V
|
||||
*/
|
||||
JFUNC(void, write, jbyteArray, jint);
|
||||
|
||||
/*
|
||||
* Class: org_p2pvpn_tuntap_TunTapLinux
|
||||
* Method: read
|
||||
* Signature: ([B)I
|
||||
*/
|
||||
JFUNC(jint, read, jbyteArray);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
|
@ -35,7 +35,7 @@ OBJECTDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}
|
|||
|
||||
# Object Files
|
||||
OBJECTFILES= \
|
||||
${OBJECTDIR}/org_p2pvpn_tuntap_TunTapWindows.o
|
||||
${OBJECTDIR}/tuntap.o
|
||||
|
||||
|
||||
# C Compiler Flags
|
||||
|
@ -62,10 +62,10 @@ dist/Release/libTunTapWindows.dll: ${OBJECTFILES}
|
|||
${MKDIR} -p dist/Release
|
||||
${LINK.c} -o dist/Release/libTunTapWindows.dll ${OBJECTFILES} ${LDLIBSOPTIONS} -shared -fPIC
|
||||
|
||||
${OBJECTDIR}/org_p2pvpn_tuntap_TunTapWindows.o: org_p2pvpn_tuntap_TunTapWindows.c
|
||||
${OBJECTDIR}/tuntap.o: tuntap.c
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.c) -O2 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/org_p2pvpn_tuntap_TunTapWindows.o org_p2pvpn_tuntap_TunTapWindows.c
|
||||
$(COMPILE.c) -O2 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/tuntap.o tuntap.c
|
||||
|
||||
# Subprojects
|
||||
.build-subprojects:
|
||||
|
|
|
@ -35,7 +35,7 @@ OBJECTDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}
|
|||
|
||||
# Object Files
|
||||
OBJECTFILES= \
|
||||
${OBJECTDIR}/org_p2pvpn_tuntap_TunTapWindows.o
|
||||
${OBJECTDIR}/tuntap.o
|
||||
|
||||
|
||||
# C Compiler Flags
|
||||
|
@ -62,10 +62,10 @@ dist/Release/libTunTapWindows64.dll: ${OBJECTFILES}
|
|||
${MKDIR} -p dist/Release
|
||||
${LINK.c} -o dist/Release/libTunTapWindows64.dll ${OBJECTFILES} ${LDLIBSOPTIONS} -shared -fPIC
|
||||
|
||||
${OBJECTDIR}/org_p2pvpn_tuntap_TunTapWindows.o: org_p2pvpn_tuntap_TunTapWindows.c
|
||||
${OBJECTDIR}/tuntap.o: tuntap.c
|
||||
${MKDIR} -p ${OBJECTDIR}
|
||||
${RM} "$@.d"
|
||||
$(COMPILE.c) -O2 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/org_p2pvpn_tuntap_TunTapWindows.o org_p2pvpn_tuntap_TunTapWindows.c
|
||||
$(COMPILE.c) -O2 -fPIC -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/tuntap.o tuntap.c
|
||||
|
||||
# Subprojects
|
||||
.build-subprojects:
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<logicalFolder name="HeaderFiles"
|
||||
displayName="Header Files"
|
||||
projectFiles="true">
|
||||
<itemPath>org_p2pvpn_tuntap_TunTapWindows.h</itemPath>
|
||||
<itemPath>tuntap.h</itemPath>
|
||||
</logicalFolder>
|
||||
<logicalFolder name="ResourceFiles"
|
||||
displayName="Resource Files"
|
||||
|
@ -13,7 +13,7 @@
|
|||
<logicalFolder name="SourceFiles"
|
||||
displayName="Source Files"
|
||||
projectFiles="true">
|
||||
<itemPath>org_p2pvpn_tuntap_TunTapWindows.c</itemPath>
|
||||
<itemPath>tuntap.c</itemPath>
|
||||
</logicalFolder>
|
||||
<logicalFolder name="ExternalFiles"
|
||||
displayName="Important Files"
|
||||
|
@ -40,9 +40,9 @@
|
|||
<output>dist/Release/libTunTapWindows.dll</output>
|
||||
</linkerTool>
|
||||
</compileType>
|
||||
<item path="org_p2pvpn_tuntap_TunTapWindows.c" ex="false" tool="0" flavor2="0">
|
||||
<item path="tuntap.c" ex="false" tool="0" flavor2="0">
|
||||
</item>
|
||||
<item path="org_p2pvpn_tuntap_TunTapWindows.h" ex="false" tool="3" flavor2="0">
|
||||
<item path="tuntap.h" ex="false" tool="3" flavor2="0">
|
||||
</item>
|
||||
</conf>
|
||||
<conf name="Release-x86_64" type="2">
|
||||
|
@ -62,9 +62,9 @@
|
|||
<output>dist/Release/libTunTapWindows64.dll</output>
|
||||
</linkerTool>
|
||||
</compileType>
|
||||
<item path="org_p2pvpn_tuntap_TunTapWindows.c" ex="false" tool="0" flavor2="9">
|
||||
<item path="tuntap.c" ex="false" tool="0" flavor2="9">
|
||||
</item>
|
||||
<item path="org_p2pvpn_tuntap_TunTapWindows.h" ex="false" tool="3" flavor2="0">
|
||||
<item path="tuntap.h" ex="false" tool="3" flavor2="0">
|
||||
</item>
|
||||
</conf>
|
||||
</confs>
|
||||
|
|
|
@ -26,8 +26,7 @@
|
|||
#include <winioctl.h>
|
||||
|
||||
#include <jni.h>
|
||||
#include "org_p2pvpn_tuntap_TunTapWindows.h"
|
||||
|
||||
#include "tuntap.h"
|
||||
|
||||
#define ADAPTER_KEY "SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}"
|
||||
#define NETWORK_CONNECTIONS_KEY "SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}"
|
||||
|
@ -57,7 +56,6 @@ typedef struct {
|
|||
OVERLAPPED write_overlapped;
|
||||
} TapData;
|
||||
|
||||
// return: error?
|
||||
int findTapDevice(char *deviceID, int deviceIDLen, char *deviceName, int deviceNameLen, int skip) {
|
||||
HKEY adapterKey;
|
||||
int i;
|
||||
|
@ -76,9 +74,9 @@ int findTapDevice(char *deviceID, int deviceIDLen, char *deviceName, int deviceN
|
|||
|
||||
strncpy(deviceID, "", deviceIDLen);
|
||||
|
||||
for (i=0;
|
||||
deviceID[0]=='\0' &&
|
||||
ERROR_SUCCESS==RegEnumKey(adapterKey, i, keyI, sizeof(keyI));
|
||||
for (i = 0;
|
||||
deviceID[0] == '\0' &&
|
||||
ERROR_SUCCESS == RegEnumKey(adapterKey, i, keyI, sizeof(keyI));
|
||||
i++) {
|
||||
char componentId[256];
|
||||
|
||||
|
@ -90,9 +88,9 @@ int findTapDevice(char *deviceID, int deviceIDLen, char *deviceName, int deviceN
|
|||
}
|
||||
|
||||
len = sizeof(componentId);
|
||||
status=RegQueryValueEx(key, "ComponentId", NULL, NULL, componentId, &len);
|
||||
status = RegQueryValueEx(key, "ComponentId", NULL, NULL, componentId, &len);
|
||||
if (status == ERROR_SUCCESS &&
|
||||
strncmp(componentId, TAP_COMPONENT_ID_PREFIX, strlen(TAP_COMPONENT_ID_PREFIX))==0) {
|
||||
strncmp(componentId, TAP_COMPONENT_ID_PREFIX, strlen(TAP_COMPONENT_ID_PREFIX)) == 0) {
|
||||
if (skip<1) {
|
||||
len = deviceIDLen;
|
||||
RegQueryValueEx(key, "NetCfgInstanceId", NULL, NULL, deviceID, &len);
|
||||
|
@ -106,16 +104,22 @@ int findTapDevice(char *deviceID, int deviceIDLen, char *deviceName, int deviceN
|
|||
|
||||
RegCloseKey(adapterKey);
|
||||
|
||||
if (deviceID[0]==0) return 1;
|
||||
if (deviceID[0] == 0) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
snprintf(keyName, sizeof(keyName), "%s\\%s\\Connection", NETWORK_CONNECTIONS_KEY, deviceID);
|
||||
status = RegOpenKeyEx(HKEY_LOCAL_MACHINE, keyName, 0, KEY_READ, &key);
|
||||
if (status!=ERROR_SUCCESS) return 1;
|
||||
if (status != ERROR_SUCCESS) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
len = deviceNameLen;
|
||||
status=RegQueryValueEx(key, "Name", NULL, NULL, deviceName, &len);
|
||||
status = RegQueryValueEx(key, "Name", NULL, NULL, deviceName, &len);
|
||||
RegCloseKey(key);
|
||||
if (status!=ERROR_SUCCESS) return 1;
|
||||
if (status != ERROR_SUCCESS) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -145,13 +149,7 @@ TapData *getTapData(JNIEnv *env, jobject this) {
|
|||
return (TapData*)((*env)->GetLongField(env, this, jfd));
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_p2pvpn_tuntap_TunTapWindows
|
||||
* Method: openTun
|
||||
* Signature: ()I
|
||||
*
|
||||
* return: 1: not TAP found, 2: could not open TAP
|
||||
*/
|
||||
/* return: 1: not TAP found, 2: could not open TAP */
|
||||
JFUNC(jint, openTun) {
|
||||
char deviceId[256];
|
||||
char deviceName[256];
|
||||
|
@ -180,7 +178,7 @@ JFUNC(jint, openTun) {
|
|||
0,
|
||||
OPEN_EXISTING,
|
||||
FILE_ATTRIBUTE_SYSTEM | FILE_FLAG_OVERLAPPED,
|
||||
0 );
|
||||
0);
|
||||
|
||||
if (tapData->fd == INVALID_HANDLE_VALUE) {
|
||||
printf("Could not open '%s'!\n", tapPath);
|
||||
|
@ -209,11 +207,6 @@ JFUNC(jint, openTun) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_p2pvpn_tuntap_TunTapWindows
|
||||
* Method: close
|
||||
* Signature: ()V
|
||||
*/
|
||||
JFUNC(void, close) {
|
||||
TapData *tapData;
|
||||
|
||||
|
@ -223,11 +216,6 @@ JFUNC(void, close) {
|
|||
free(tapData);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_p2pvpn_tuntap_TunTapWindows
|
||||
* Method: write
|
||||
* Signature: ([BI)V
|
||||
*/
|
||||
JFUNC(void, write, jbyteArray jb, jint len) {
|
||||
TapData *tapData;
|
||||
jbyte *b;
|
||||
|
@ -240,19 +228,15 @@ JFUNC(void, write, jbyteArray jb, jint len) {
|
|||
result = GetOverlappedResult(tapData->fd, &tapData->write_overlapped,
|
||||
&written, FALSE);
|
||||
|
||||
if (!result && GetLastError() == ERROR_IO_INCOMPLETE)
|
||||
if (!result && GetLastError() == ERROR_IO_INCOMPLETE) {
|
||||
WaitForSingleObject(tapData->write_event, INFINITE);
|
||||
}
|
||||
|
||||
WriteFile(tapData->fd, b, len, &written, &tapData->write_overlapped);
|
||||
|
||||
(*env)->ReleaseByteArrayElements(env, jb, b, JNI_ABORT);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: org_p2pvpn_tuntap_TunTapWindows
|
||||
* Method: read
|
||||
* Signature: ([B)I
|
||||
*/
|
||||
JFUNC(jint, read, jbyteArray jb) {
|
||||
TapData *tapData;
|
||||
jbyte *b;
|
||||
|
@ -264,11 +248,9 @@ JFUNC(jint, read, jbyteArray jb) {
|
|||
|
||||
result = ReadFile(tapData->fd, b, (*env)->GetArrayLength(env, jb), &len, &tapData->read_overlapped);
|
||||
|
||||
if (!result) {
|
||||
if (GetLastError() == ERROR_IO_PENDING) {
|
||||
WaitForSingleObject(tapData->read_event, INFINITE);
|
||||
GetOverlappedResult(tapData->fd, &tapData->read_overlapped, &len, FALSE);
|
||||
}
|
||||
if (!result && GetLastError() == ERROR_IO_PENDING) {
|
||||
WaitForSingleObject(tapData->read_event, INFINITE);
|
||||
GetOverlappedResult(tapData->fd, &tapData->read_overlapped, &len, FALSE);
|
||||
}
|
||||
|
||||
(*env)->ReleaseByteArrayElements(env, jb, b, 0);
|
|
@ -19,45 +19,15 @@
|
|||
*/
|
||||
|
||||
#include <jni.h>
|
||||
/* Header for class org_p2pvpn_tuntap_TunTapWindows */
|
||||
|
||||
#ifndef _Included_org_p2pvpn_tuntap_TunTapWindows
|
||||
#define _Included_org_p2pvpn_tuntap_TunTapWindows
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#ifndef TUNTAP_H
|
||||
#define TUNTAP_H
|
||||
|
||||
#define JFUNC(type, name, ...) JNIEXPORT type JNICALL Java_org_p2pvpn_tuntap_TunTapWindows_##name (JNIEnv *env, jobject this, ##__VA_ARGS__)
|
||||
|
||||
/*
|
||||
* Class: org_p2pvpn_tuntap_TunTapWindows
|
||||
* Method: openTun
|
||||
* Signature: ()I
|
||||
*/
|
||||
JFUNC(jint, openTun);
|
||||
|
||||
/*
|
||||
* Class: org_p2pvpn_tuntap_TunTapWindows
|
||||
* Method: close
|
||||
* Signature: ()V
|
||||
*/
|
||||
JFUNC(void, close);
|
||||
|
||||
/*
|
||||
* Class: org_p2pvpn_tuntap_TunTapWindows
|
||||
* Method: write
|
||||
* Signature: ([BI)V
|
||||
*/
|
||||
JFUNC(void, write, jbyteArray, jint);
|
||||
|
||||
/*
|
||||
* Class: org_p2pvpn_tuntap_TunTapWindows
|
||||
* Method: read
|
||||
* Signature: ([B)I
|
||||
*/
|
||||
JFUNC(jint, read, jbyteArray);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
Loading…
Reference in a new issue