mirror of https://github.com/oxen-io/lokinet
finish wiring up jni shizz
parent
313898999d
commit
c26b67c379
@ -0,0 +1,10 @@
|
||||
|
||||
set(ANDROID_SRC
|
||||
jni/lokinet_config.cpp
|
||||
jni/lokinet_daemon.cpp
|
||||
jni/lokinet_vnp.cpp
|
||||
)
|
||||
add_library(${ANDROID_LIB} SHARED ${ANDROID_SRC})
|
||||
set_property(TARGET ${ANDROID_LIB} PROPERTY CXX_STANDARD 14)
|
||||
add_log_tag(${ANDROID_LIB})
|
||||
target_link_libraries(${ANDROID_LIB} ${STATIC_LIB} ${LIBS})
|
@ -0,0 +1,38 @@
|
||||
#include "network_loki_lokinet_LokinetConfig.h"
|
||||
#include <llarp.hpp>
|
||||
#include "lokinet_jni_common.hpp"
|
||||
|
||||
extern "C
|
||||
{
|
||||
JNIEXPORT jobject JNICALL
|
||||
Java_network_loki_lokinet_LokinetConfig_Obtain(JNIEnv* env, jclass* c)
|
||||
{
|
||||
llarp_config* conf = llarp_default_config();
|
||||
if(conf == nullptr)
|
||||
return nullptr;
|
||||
return env->NewDirectByteBuffer(conf, llarp_config_size());
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_network_loki_lokinet_LokinetConfig_Free(JNIEnv* env, jclass c,
|
||||
jobject buf)
|
||||
{
|
||||
llarp_config_free(FromBuffer< llarp_config >(env, buf));
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_network_loki_lokinet_LokinetConfig_Load(JNIEnv* env, jobject self,
|
||||
jstring fname)
|
||||
{
|
||||
llarp_config* conf = FromObjectMember< llarp_config >(env, self, "impl");
|
||||
if(conf == nullptr)
|
||||
return JNI_FALSE;
|
||||
return VisitStringAsStringView< jboolean >(
|
||||
env, fname, [conf](llarp::string_view val) -> jboolean {
|
||||
const auto filename = llarp::string_view_string(val);
|
||||
if(llarp_config_read_file(conf, filename.c_str()))
|
||||
return JNI_TRUE;
|
||||
return JNI_FALSE;
|
||||
});
|
||||
}
|
||||
}
|
@ -0,0 +1,82 @@
|
||||
#include "network_loki_lokinet_LokinetDaemon.h"
|
||||
#include "lokinet_jni_common.hpp"
|
||||
#include "lokinet_jni_vpnio.hpp"
|
||||
#include <llarp.h>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
JNIEXPORT jobject JNICALL
|
||||
Java_network_loki_lokinet_LokinetDaemon_Obtain(JNIEnv *env, jclass)
|
||||
{
|
||||
llarp_main *ptr = llarp_main_default_init();
|
||||
if(ptr == nullptr)
|
||||
return nullptr;
|
||||
return env->NewDirectByteBuffer(ptr, llarp_main_size());
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_network_loki_lokinet_LokinetDaemon_Free(JNIEnv *env, jclass, jobject buf)
|
||||
{
|
||||
llarp_main *ptr = FromBuffer< llarp_main >(env, buf);
|
||||
llarp_main_free(ptr);
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_network_loki_lokinet_LokinetDaemon_Configure(JNIEnv *env, jobject self,
|
||||
jobject conf)
|
||||
{
|
||||
llarp_main *ptr = FromObjectMember< llarp_main >(env, self, "impl");
|
||||
llarp_config *config = FromObjectMember< llarp_config >(env, conf, "impl");
|
||||
if(ptr == nullptr || config == nullptr)
|
||||
return JNI_FALSE;
|
||||
if(llarp_main_configure(ptr, config))
|
||||
return JNI_TRUE;
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_network_loki_lokinet_LokinetDaemon_Mainloop(JNIEnv *env, jobject self)
|
||||
{
|
||||
static llarp_main_runtime_opts opts;
|
||||
llarp_main *ptr = FromObjectMember< llarp_main >(env, self, "impl");
|
||||
if(ptr == nullptr)
|
||||
return -1;
|
||||
return llarp_main_run(ptr, opts);
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_network_loki_lokinet_LokinetDaemon_IsRunning(JNIEnv *env, jobject self)
|
||||
{
|
||||
llarp_main *ptr = FromObjectMember< llarp_main >(env, self, "impl");
|
||||
return (ptr != nullptr && llarp_main_is_running(ptr)) ? JNI_TRUE
|
||||
: JNI_FALSE;
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_network_loki_lokinet_LokinetDaemon_Stop(JNIEnv *env, jobject self)
|
||||
{
|
||||
llarp_main *ptr = FromObjectMember< llarp_main >(env, self, "impl");
|
||||
if(ptr == nullptr)
|
||||
return JNI_FALSE;
|
||||
if(not llarp_main_is_running(ptr))
|
||||
return JNI_FALSE;
|
||||
llarp_main_stop(ptr);
|
||||
return llarp_main_is_running(ptr) ? JNI_FALSE : JNI_TRUE;
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_network_loki_lokinet_LokinetDaemon_InjectVPN(JNIEnv *env, jobject self,
|
||||
jobject vpn)
|
||||
{
|
||||
llarp_main *ptr = FromObjectMember< llarp_main >(env, self, "impl");
|
||||
lokinet_jni_vpnio *impl =
|
||||
FromObjectMember< lokinet_jni_vpnio >(env, vpn, "impl");
|
||||
if(ptr == nullptr || impl == nullptr)
|
||||
return JNI_FALSE;
|
||||
if(not impl->Init(ptr))
|
||||
return JNI_FASE;
|
||||
return llarp_main_inject_default_vpn(ptr, &impl->io, impl->info)
|
||||
? JNI_TRUE
|
||||
: JNI_FALSE;
|
||||
}
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
#ifndef LOKINET_JNI_COMMON_HPP
|
||||
#define LOKINET_JNI_COMMON_HPP
|
||||
|
||||
#include <jni.h>
|
||||
#include <util/string_view.hpp>
|
||||
#include <functional>
|
||||
|
||||
/// visit string as native bytes
|
||||
template < typename T, typename V >
|
||||
static T
|
||||
VisitStringAsStringView(JNIEnv* env, jobject str, V visit)
|
||||
{
|
||||
const jclass stringClass = env->GetObjectClass(str);
|
||||
const jmethodID getBytes =
|
||||
env->GetMethodID(stringClass, "getBytes", "(Ljava/lang/String;)[B");
|
||||
|
||||
const jstring charsetName = env->NewStringUTF("UTF-8");
|
||||
const jbyteArray stringJbytes =
|
||||
(jbyteArray)env->CallObjectMethod(str, getBytes, charsetName);
|
||||
env->DeleteLocalRef(charsetName);
|
||||
|
||||
const jsize length = env->GetArrayLength(stringJbytes);
|
||||
const jbyte* pBytes = env->GetByteArrayElements(stringJbytes, NULL);
|
||||
|
||||
T result = visit(llarp::string_view(bBytes, length));
|
||||
|
||||
env->ReleaseByteArrayElements(stringJbytes, pBytes, JNI_ABORT);
|
||||
env->DeleteLocalRef(stringJbytes);
|
||||
|
||||
return std::move(result);
|
||||
}
|
||||
|
||||
/// cast jni buffer to T *
|
||||
template < typename T >
|
||||
static T*
|
||||
FromBuffer(JNIEnv* env, jobject o)
|
||||
{
|
||||
if(o == nullptr)
|
||||
return nullptr;
|
||||
return static_cast< T* >(env->GetDirectBufferAddress(o));
|
||||
}
|
||||
|
||||
/// get T * from object member called membername
|
||||
template < typename T >
|
||||
static T*
|
||||
FromObjectMember(JNIEnv* env, jobject self, const char* membername)
|
||||
{
|
||||
jclass cl = env->GetObjectClass(self);
|
||||
jfieldID name = env->GetFieldID(cl, membername, "Ljava/nio/Buffer;");
|
||||
jobject buffer = env->GetObjectField(self, name);
|
||||
return FromBuffer< T >(env, buffer);
|
||||
}
|
||||
|
||||
/// visit object string member called membername as bytes
|
||||
template < typename T, typename V >
|
||||
static T
|
||||
VisitObjectMemberStringAsStringView(JNIEnv* env, jobject self,
|
||||
const char* membername, V v)
|
||||
{
|
||||
jclass cl = env->GetObjectClass(self);
|
||||
jfieldID name = env->GetFieldID(cl, membername, "Ljava/lang/String;");
|
||||
jobject str = env->GetObjectField(self, name);
|
||||
return VisitStringAsStringView(env, str, v);
|
||||
}
|
||||
|
||||
/// get object member int called membername
|
||||
template < typename Int_t >
|
||||
void
|
||||
GetObjectMemberAsInt(JNIEnv* env, jobject self, const char* membername,
|
||||
Int_t& result)
|
||||
{
|
||||
jclass cl = env->GetObjectClass(self);
|
||||
jfieldID name = env->GetFieldID(cl, membername, "I");
|
||||
result = env->GetIntField(self, name);
|
||||
}
|
||||
|
||||
#endif
|
@ -0,0 +1,141 @@
|
||||
#ifndef LOKINET_JNI_VPNIO_HPP
|
||||
#define LOKINET_JNI_VPNIO_HPP
|
||||
|
||||
#include <llarp.h>
|
||||
#include <memory>
|
||||
#include <future>
|
||||
#include <util/string_view.hpp>
|
||||
#include <algorithm>
|
||||
|
||||
namespace lokinet
|
||||
{
|
||||
struct VPNIO
|
||||
{
|
||||
static VPNIO *
|
||||
Get(llarp_vpn_io *vpn)
|
||||
{
|
||||
return static_cast< VPNIO * >(vpn->user);
|
||||
}
|
||||
|
||||
virtual ~VPNIO() = default;
|
||||
|
||||
llarp_vpn_io io;
|
||||
llarp_vpn_ifaddr_info info{{0}, {0}, 0};
|
||||
std::unique_ptr< std::promise< void > > closeWaiter;
|
||||
|
||||
void
|
||||
Closed()
|
||||
{
|
||||
if(closeWaiter)
|
||||
closeWaiter->get_future().set_value();
|
||||
}
|
||||
|
||||
virtual void
|
||||
InjectSuccess() = 0;
|
||||
|
||||
virtual void
|
||||
InjectFail() = 0;
|
||||
|
||||
virtual void
|
||||
Tick() = 0;
|
||||
|
||||
VPNIO()
|
||||
{
|
||||
io.impl = nullptr;
|
||||
io.user = this;
|
||||
io.closed = [](llarp_vpn_io *vpn) { VPNIO::Get(vpn)->Closed(); };
|
||||
io.injected = [](llarp_vpn_io *vpn, bool good) {
|
||||
VPNIO *ptr = VPNIO::Get(vpn);
|
||||
if(good)
|
||||
ptr->InjectSuccess();
|
||||
else
|
||||
ptr->InjectFail();
|
||||
};
|
||||
io.tick = [](llarp_vpn_io *vpn) { VPNIO::Get(vpn)->Tick(); };
|
||||
}
|
||||
|
||||
bool
|
||||
Init(llarp_main *ptr)
|
||||
{
|
||||
return llarp_vpn_io_init(ptr, &io);
|
||||
}
|
||||
|
||||
void
|
||||
Close()
|
||||
{
|
||||
if(io.impl == nullptr)
|
||||
return;
|
||||
if(closeWaiter)
|
||||
return;
|
||||
closerWaiter = std::make_unique< std::promise< void > >();
|
||||
llarp_vpn_io_close_async(&io);
|
||||
closeWaiter->wait();
|
||||
closeWaiter.reset();
|
||||
io.impl = nullptr;
|
||||
}
|
||||
|
||||
llarp_vpn_pkt_reader *
|
||||
Reader()
|
||||
{
|
||||
return llarp_vpn_io_packet_reader(&io);
|
||||
}
|
||||
|
||||
llarp_vpn_pkt_writer *
|
||||
Writer()
|
||||
{
|
||||
return llarp_vpn_io_packet_writer(&io);
|
||||
}
|
||||
|
||||
ssize_t
|
||||
ReadPacket(void *dst, size_t len)
|
||||
{
|
||||
if(io.impl == nullptr)
|
||||
return -1;
|
||||
unsigned char *buf = (unsigned char *)dst;
|
||||
return llarp_vpn_io_readpkt(Reader(), buf, len);
|
||||
}
|
||||
|
||||
bool
|
||||
WritePacket(void *pkt, size_t len)
|
||||
{
|
||||
if(io.impl == nullptr)
|
||||
return false;
|
||||
unsigned char *buf = (unsigned char *)pkt;
|
||||
return llarp_vpn_io_writepkt(Writer(), buf, len);
|
||||
}
|
||||
|
||||
void
|
||||
SetIfName(llarp::string_view val)
|
||||
{
|
||||
const auto sz = std::min(val.size(), sizeof(info.ifname));
|
||||
std::copy_n(val.data(), sz, info.ifname);
|
||||
}
|
||||
|
||||
void
|
||||
SetIfAddr(llarp::string_view val)
|
||||
{
|
||||
const auto sz = std::min(val.size(), sizeof(info.ifaddr));
|
||||
std::copy_n(val.data(), sz, info.ifaddr);
|
||||
}
|
||||
};
|
||||
} // namespace lokinet
|
||||
|
||||
struct lokinet_jni_vpnio : public lokinet::VPNIO
|
||||
{
|
||||
void
|
||||
InjectSuccess() override
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
InjectFail() override
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
Tick() override
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,90 @@
|
||||
#include "network_loki_lokinet_LokinetVPN.h"
|
||||
#include "lokinet_jni_vpnio.hpp"
|
||||
#include "lokinet_jni_common.hpp"
|
||||
#include <net/ip.hpp>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_network_loki_lokinet_LokinetVPN_PacketSize(JNIEnv *, jclass)
|
||||
{
|
||||
return llarp::net::IPPacket::MaxSize;
|
||||
}
|
||||
|
||||
JNIEXPORT jobject JNICALL
|
||||
Java_network_loki_lokinet_LokinetVPN_Alloc(JNIEnv *env, jclass)
|
||||
{
|
||||
lokinet_jni_vpnio *vpn = new lokinet_jni_vpnio();
|
||||
return env->NewDirectByteBuffer(vpn, sizeof(lokinet_jni_vpnio));
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_network_loki_lokinet_LokinetVPN_Free(JNIEnv *env, jclass, jobject buf)
|
||||
{
|
||||
lokinet_jni_vpnio *vpn = FromBuffer< lokinet_jni_vpnio >(env, buf);
|
||||
if(vpn == nullptr)
|
||||
return;
|
||||
delete vpn;
|
||||
}
|
||||
JNIEXPORT void JNICALL
|
||||
Java_network_loki_lokinet_LokinetVPN_Stop(JNIEnv *env, jobject self)
|
||||
{
|
||||
lokinet_jni_vpnio *vpn =
|
||||
FromObjectMember< lokinet_jni_vpnio >(env, self, "impl");
|
||||
if(vpn)
|
||||
{
|
||||
vpn->Close();
|
||||
}
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_network_loki_lokinet_LokinetVPN_ReadPkt(JNIEnv *env, jobject self,
|
||||
jobject pkt)
|
||||
{
|
||||
lokinet_jni_vpnio *vpn =
|
||||
FromObjectMember< lokinet_jni_vpnio >(env, self, "impl");
|
||||
if(vpn == nullptr)
|
||||
return -1;
|
||||
void *pktbuf = env->GetDirectBufferAddress(pkt);
|
||||
auto pktlen = env->GetDirectBufferCapacity(pkt);
|
||||
if(pktbuf == nullptr)
|
||||
return -1;
|
||||
return vpn->ReadPacket(pktbuf, pktlen);
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_network_loki_lokinet_LokinetVPN_WritePkt(JNIEnv *env, jobject self,
|
||||
jobject pkt)
|
||||
{
|
||||
lokinet_jni_vpnio *vpn =
|
||||
FromObjectMember< lokinet_jni_vpnio >(env, self, "impl");
|
||||
if(vpn == nullptr)
|
||||
return false;
|
||||
void *pktbuf = env->GetDirectBufferAddress(pkt);
|
||||
auto pktlen = env->GetDirectBufferCapacity(pkt);
|
||||
if(pktbuf == nullptr)
|
||||
return false;
|
||||
return vpn->WritePacket(pktbuf, pktlen);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_network_loki_lokinet_LokinetVPN_SetInfo(JNIEnv *env, jobject self,
|
||||
jobject info)
|
||||
{
|
||||
lokinet_jni_vpnio *vpn =
|
||||
FromObjectMember< lokinet_jni_vpnio >(env, self, "impl");
|
||||
if(vpn == nullptr)
|
||||
return;
|
||||
VisitObjectMemberStringAsStringView< bool >(
|
||||
env, info, "ifaddr", [vpn](llarp::string_view val) -> bool {
|
||||
vpn->SetIfAddr(val);
|
||||
return true;
|
||||
});
|
||||
VisitObjectMemberStringAsStringView< bool >(
|
||||
env, info, "ifname", [vpn](llarp::string_view val) -> bool {
|
||||
vpn->SetIfName(val);
|
||||
return true;
|
||||
});
|
||||
GetObjectMemberAsInt(env, info, "netmask", vpn->info.netmask);
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
/* DO NOT EDIT THIS FILE - it is machine generated */
|
||||
#include <jni.h>
|
||||
/* Header for class network_loki_lokinet_LokinetConfig */
|
||||
|
||||
#ifndef _Included_network_loki_lokinet_LokinetConfig
|
||||
#define _Included_network_loki_lokinet_LokinetConfig
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
/*
|
||||
* Class: network_loki_lokinet_LokinetConfig
|
||||
* Method: Obtain
|
||||
* Signature: ()Ljava/nio/Buffer;
|
||||
*/
|
||||
JNIEXPORT jobject JNICALL
|
||||
Java_network_loki_lokinet_LokinetConfig_Obtain(JNIEnv *, jclass);
|
||||
|
||||
/*
|
||||
* Class: network_loki_lokinet_LokinetConfig
|
||||
* Method: Free
|
||||
* Signature: (Ljava/nio/Buffer;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_network_loki_lokinet_LokinetConfig_Free(JNIEnv *, jclass, jobject);
|
||||
|
||||
/*
|
||||
* Class: network_loki_lokinet_LokinetConfig
|
||||
* Method: Load
|
||||
* Signature: (Ljava/lang/String;)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_network_loki_lokinet_LokinetConfig_Load(JNIEnv *, jobject, jstring);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
@ -0,0 +1,70 @@
|
||||
/* DO NOT EDIT THIS FILE - it is machine generated */
|
||||
#include <jni.h>
|
||||
/* Header for class network_loki_lokinet_LokinetDaemon */
|
||||
|
||||
#ifndef _Included_network_loki_lokinet_LokinetDaemon
|
||||
#define _Included_network_loki_lokinet_LokinetDaemon
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
/*
|
||||
* Class: network_loki_lokinet_LokinetDaemon
|
||||
* Method: Obtain
|
||||
* Signature: ()Ljava/nio/Buffer;
|
||||
*/
|
||||
JNIEXPORT jobject JNICALL
|
||||
Java_network_loki_lokinet_LokinetDaemon_Obtain(JNIEnv *, jclass);
|
||||
|
||||
/*
|
||||
* Class: network_loki_lokinet_LokinetDaemon
|
||||
* Method: Free
|
||||
* Signature: (Ljava/nio/Buffer;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_network_loki_lokinet_LokinetDaemon_Free(JNIEnv *, jclass, jobject);
|
||||
|
||||
/*
|
||||
* Class: network_loki_lokinet_LokinetDaemon
|
||||
* Method: Configure
|
||||
* Signature: (Lnetwork/loki/lokinet/LokinetConfig;)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_network_loki_lokinet_LokinetDaemon_Configure(JNIEnv *, jobject, jobject);
|
||||
|
||||
/*
|
||||
* Class: network_loki_lokinet_LokinetDaemon
|
||||
* Method: Mainloop
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_network_loki_lokinet_LokinetDaemon_Mainloop(JNIEnv *, jobject);
|
||||
|
||||
/*
|
||||
* Class: network_loki_lokinet_LokinetDaemon
|
||||
* Method: IsRunning
|
||||
* Signature: ()Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_network_loki_lokinet_LokinetDaemon_IsRunning(JNIEnv *, jobject);
|
||||
|
||||
/*
|
||||
* Class: network_loki_lokinet_LokinetDaemon
|
||||
* Method: Stop
|
||||
* Signature: ()Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_network_loki_lokinet_LokinetDaemon_Stop(JNIEnv *, jobject);
|
||||
|
||||
/*
|
||||
* Class: network_loki_lokinet_LokinetDaemon
|
||||
* Method: InjectVPN
|
||||
* Signature: (Lnetwork/loki/lokinet/LokinetVPN;)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_network_loki_lokinet_LokinetDaemon_InjectVPN(JNIEnv *, jobject, jobject);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
@ -0,0 +1,69 @@
|
||||
/* DO NOT EDIT THIS FILE - it is machine generated */
|
||||
#include <jni.h>
|
||||
/* Header for class network_loki_lokinet_LokinetVPN */
|
||||
|
||||
#ifndef _Included_network_loki_lokinet_LokinetVPN
|
||||
#define _Included_network_loki_lokinet_LokinetVPN
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
/*
|
||||
* Class: network_loki_lokinet_LokinetVPN
|
||||
* Method: PacketSize
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_network_loki_lokinet_LokinetVPN_PacketSize(JNIEnv *, jclass);
|
||||
|
||||
/*
|
||||
* Class: network_loki_lokinet_LokinetVPN
|
||||
* Method: Alloc
|
||||
* Signature: ()Ljava/nio/Buffer;
|
||||
*/
|
||||
JNIEXPORT jobject JNICALL
|
||||
Java_network_loki_lokinet_LokinetVPN_Alloc(JNIEnv *, jclass);
|
||||
|
||||
/*
|
||||
* Class: network_loki_lokinet_LokinetVPN
|
||||
* Method: Free
|
||||
* Signature: (Ljava/nio/Buffer;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_network_loki_lokinet_LokinetVPN_Free(JNIEnv *, jclass, jobject);
|
||||
|
||||
/*
|
||||
* Class: network_loki_lokinet_LokinetVPN
|
||||
* Method: Stop
|
||||
* Signature: ()V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_network_loki_lokinet_LokinetVPN_Stop(JNIEnv *, jobject);
|
||||
|
||||
/*
|
||||
* Class: network_loki_lokinet_LokinetVPN
|
||||
* Method: ReadPkt
|
||||
* Signature: (Ljava/nio/ByteBuffer;)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_network_loki_lokinet_LokinetVPN_ReadPkt(JNIEnv *, jobject, jobject);
|
||||
|
||||
/*
|
||||
* Class: network_loki_lokinet_LokinetVPN
|
||||
* Method: WritePkt
|
||||
* Signature: (Ljava/nio/ByteBuffer;)Z
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_network_loki_lokinet_LokinetVPN_WritePkt(JNIEnv *, jobject, jobject);
|
||||
|
||||
/*
|
||||
* Class: network_loki_lokinet_LokinetVPN
|
||||
* Method: SetInfo
|
||||
* Signature: (Lnetwork/loki/lokinet/LokinetVPN/VPNInfo;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_network_loki_lokinet_LokinetVPN_SetInfo(JNIEnv *, jobject, jobject);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
@ -0,0 +1,14 @@
|
||||
/* DO NOT EDIT THIS FILE - it is machine generated */
|
||||
#include <jni.h>
|
||||
/* Header for class network_loki_lokinet_LokinetVPN_VPNInfo */
|
||||
|
||||
#ifndef _Included_network_loki_lokinet_LokinetVPN_VPNInfo
|
||||
#define _Included_network_loki_lokinet_LokinetVPN_VPNInfo
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
Loading…
Reference in New Issue