13 changed files with 197 additions and 240 deletions
@ -1,44 +1,76 @@
|
||||
/* |
||||
* ZeroTier SDK - Network Virtualization Everywhere |
||||
* Copyright (C) 2011-2017 ZeroTier, Inc. https://www.zerotier.com/ |
||||
* |
||||
* This program is free software: you can redistribute it and/or modify |
||||
* it under the terms of the GNU General Public License as published by |
||||
* the Free Software Foundation, either version 3 of the License, or |
||||
* (at your option) any later version. |
||||
* |
||||
* This program is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
* GNU General Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU General Public License |
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
||||
* |
||||
* -- |
||||
* |
||||
* You can be released from the requirements of the license by purchasing |
||||
* a commercial license. Buying such a license is mandatory as soon as you |
||||
* develop commercial closed-source software that incorporates or links |
||||
* directly against ZeroTier software without disclosing the source code |
||||
* of your own application. |
||||
*/ |
||||
|
||||
package zerotier; |
||||
|
||||
class ZeroTier { |
||||
|
||||
@native def start(path: String): Int |
||||
// socket families |
||||
// socket types |
||||
// basic service controls |
||||
@native def start(path: String, blocking: Boolean): Int |
||||
@native def startjoin(path: String, nwid: String): Int |
||||
@native def stop(): Unit |
||||
@native def running(): Int |
||||
@native def join(nwid: String): Unit |
||||
@native def leave(nwid: String): Unit |
||||
//@native def path(): |
||||
//@native def id(): Int |
||||
// advanced service controls |
||||
//@native def get_path(): Unit |
||||
//@native def get_id(): Int |
||||
//@native def get_6plane_addr(): Unit |
||||
//@native def get_rfc4193_addr(): Unit |
||||
// socket API |
||||
@native def socket(socket_family: Int, socket_type: Int, protocol: Int): Int |
||||
@native def connect(fd: Int, addr: Object, addrlen: Int): Int |
||||
@native def bind(fd: Int, addr: Object, addrlen: Int): Int |
||||
@native def connect(fd: Int, addr: String, port: Int): Int |
||||
@native def bind(fd: Int, addr: String, port: Int): Int |
||||
@native def listen(fd: Int, backlog: Int): Int |
||||
@native def accept(fd: Int, addr: Object, addrlen: Int): Int |
||||
@native def accept4(fd: Int, addr: Object, addrlen: Int, flags: Int): Int |
||||
@native def close(fd: Int): Int |
||||
@native def setsockopt(fd: Int, level: Int, optname: Int, optval: Object, optlen: Int): Int |
||||
@native def getsockopt(fd: Int, level: Int, optname: Int, optval: Object, optlen: Int): Int |
||||
@native def read(fd: Int, buf: Object, len: Int): Int |
||||
@native def write(fd: Int, buf: Object, len: Int): Int |
||||
@native def send(fd: Int, buf: Object, len: Int, flags: Int): Int |
||||
@native def sendto(fd: Int, buf: Object, len: Int, addr: Object, addrlen: Int): Int |
||||
@native def sendmsg(fd: Int, msg: Object, flags: Int): Int |
||||
@native def recv(fd: Int, buf: Object, len: Int, flags: Int): Int |
||||
@native def recvfrom(fd: Int, buf: Object, len: Int, addr: Object, addrlen: Int): Int |
||||
@native def recvmsg(fd: Int, msg: Object, flags: Int): Int |
||||
@native def shutdown(fd: Int, how: Int): Int |
||||
//@native def getsockname(): Int |
||||
//@native def getpeername(): Int |
||||
//@native def gethostname(): Int |
||||
//@native def sethostname(): Int |
||||
//@native def gethostbyname(): Object |
||||
@native def close(fd: Int): Int |
||||
//@native def poll(): Int |
||||
//@native def select(): Int |
||||
@native def fcntl(fd: Int, cmd: Int, flags: Int): Int |
||||
@native def ioctl(fd: Int, request: Long, argp: Object): Int |
||||
@native def send(fd: Int, buf: Object, len: Int, flags: Int): Int |
||||
@native def sendto(fd: Int, buf: Object, len: Int, addr: Object, addrlen: Int): Int |
||||
@native def sendmsg(fd: Int, msg: Object, flags: Int): Int |
||||
@native def recv(fd: Int, buf: Object, len: Int, flags: Int): Int |
||||
@native def recvfrom(fd: Int, buf: Object, len: Int, addr: Object, addrlen: Int): Int |
||||
@native def recvmsg(fd: Int, msg: Object, flags: Int): Int |
||||
@native def read(fd: Int, buf: Object, len: Int): Int |
||||
@native def write(fd: Int, buf: Object, len: Int): Int |
||||
@native def shutdown(fd: Int, how: Int): Int |
||||
// stack controls |
||||
//@native def add_dns(): Int |
||||
//@native def del_dns(): Int |
||||
} |
||||
|
||||
@ -1,165 +0,0 @@
|
||||
/* DO NOT EDIT THIS FILE - it is machine generated */ |
||||
#include <jni.h> |
||||
/* Header for class ZeroTier */ |
||||
|
||||
#ifndef _Included_ZeroTier |
||||
#define _Included_ZeroTier |
||||
#ifdef __cplusplus |
||||
extern "C" { |
||||
#endif |
||||
/*
|
||||
* Class: ZeroTier |
||||
* Method: ztjni_start |
||||
* Signature: (Ljava/lang/String;)V |
||||
*/ |
||||
JNIEXPORT void JNICALL Java_ZeroTier_ztjni_1start |
||||
(JNIEnv *, jobject, jstring); |
||||
|
||||
/*
|
||||
* Class: ZeroTier |
||||
* Method: ztjni_startjoin |
||||
* Signature: (Ljava/lang/String;Ljava/lang/String;)V |
||||
*/ |
||||
JNIEXPORT void JNICALL Java_ZeroTier_ztjni_1startjoin |
||||
(JNIEnv *, jobject, jstring, jstring); |
||||
|
||||
/*
|
||||
* Class: ZeroTier |
||||
* Method: ztjni_join |
||||
* Signature: (Ljava/lang/String;)V |
||||
*/ |
||||
JNIEXPORT void JNICALL Java_ZeroTier_ztjni_1join |
||||
(JNIEnv *, jobject, jstring); |
||||
|
||||
/*
|
||||
* Class: ZeroTier |
||||
* Method: ztjni_leave |
||||
* Signature: (Ljava/lang/String;)V |
||||
*/ |
||||
JNIEXPORT void JNICALL Java_ZeroTier_ztjni_1leave |
||||
(JNIEnv *, jobject, jstring); |
||||
|
||||
/*
|
||||
* Class: ZeroTier |
||||
* Method: ztjni_get_addresses |
||||
* Signature: (Ljava/lang/String;)Ljava/util/ArrayList; |
||||
*/ |
||||
JNIEXPORT jobject JNICALL Java_ZeroTier_ztjni_1get_1addresses |
||||
(JNIEnv *, jobject, jstring); |
||||
|
||||
/*
|
||||
* Class: ZeroTier |
||||
* Method: ztjni_running |
||||
* Signature: ()Z |
||||
*/ |
||||
JNIEXPORT jboolean JNICALL Java_ZeroTier_ztjni_1running |
||||
(JNIEnv *, jobject); |
||||
|
||||
/*
|
||||
* Class: ZeroTier |
||||
* Method: ztjni_socket |
||||
* Signature: (III)I |
||||
*/ |
||||
JNIEXPORT jint JNICALL Java_ZeroTier_ztjni_1socket |
||||
(JNIEnv *, jobject, jint, jint, jint); |
||||
|
||||
/*
|
||||
* Class: ZeroTier |
||||
* Method: ztjni_connect |
||||
* Signature: (ILjava/lang/String;I)I |
||||
*/ |
||||
JNIEXPORT jint JNICALL Java_ZeroTier_ztjni_1connect |
||||
(JNIEnv *, jobject, jint, jstring, jint); |
||||
|
||||
/*
|
||||
* Class: ZeroTier |
||||
* Method: ztjni_bind |
||||
* Signature: (ILjava/lang/String;I)I |
||||
*/ |
||||
JNIEXPORT jint JNICALL Java_ZeroTier_ztjni_1bind |
||||
(JNIEnv *, jobject, jint, jstring, jint); |
||||
|
||||
/*
|
||||
* Class: ZeroTier |
||||
* Method: ztjni_accept4 |
||||
* Signature: (ILjava/lang/String;I)I |
||||
*/ |
||||
JNIEXPORT jint JNICALL Java_ZeroTier_ztjni_1accept4 |
||||
(JNIEnv *, jobject, jint, jstring, jint); |
||||
|
||||
/*
|
||||
* Class: ZeroTier |
||||
* Method: ztjni_accept |
||||
* Signature: (ILAddress;)I |
||||
*/ |
||||
JNIEXPORT jint JNICALL Java_ZeroTier_ztjni_1accept |
||||
(JNIEnv *, jobject, jint, jobject); |
||||
|
||||
/*
|
||||
* Class: ZeroTier |
||||
* Method: ztjni_listen |
||||
* Signature: (II)I |
||||
*/ |
||||
JNIEXPORT jint JNICALL Java_ZeroTier_ztjni_1listen |
||||
(JNIEnv *, jobject, jint, jint); |
||||
|
||||
/*
|
||||
* Class: ZeroTier |
||||
* Method: ztjni_close |
||||
* Signature: (I)I |
||||
*/ |
||||
JNIEXPORT jint JNICALL Java_ZeroTier_ztjni_1close |
||||
(JNIEnv *, jobject, jint); |
||||
|
||||
/*
|
||||
* Class: ZeroTier |
||||
* Method: ztjni_read |
||||
* Signature: (I[BI)I |
||||
*/ |
||||
JNIEXPORT jint JNICALL Java_ZeroTier_ztjni_1read |
||||
(JNIEnv *, jobject, jint, jbyteArray, jint); |
||||
|
||||
/*
|
||||
* Class: ZeroTier |
||||
* Method: ztjni_write |
||||
* Signature: (I[BI)I |
||||
*/ |
||||
JNIEXPORT jint JNICALL Java_ZeroTier_ztjni_1write |
||||
(JNIEnv *, jobject, jint, jbyteArray, jint); |
||||
|
||||
/*
|
||||
* Class: ZeroTier |
||||
* Method: ztjni_sendto |
||||
* Signature: (I[BIILAddress;)I |
||||
*/ |
||||
JNIEXPORT jint JNICALL Java_ZeroTier_ztjni_1sendto |
||||
(JNIEnv *, jobject, jint, jbyteArray, jint, jint, jobject); |
||||
|
||||
/*
|
||||
* Class: ZeroTier |
||||
* Method: ztjni_send |
||||
* Signature: (I[BII)I |
||||
*/ |
||||
JNIEXPORT jint JNICALL Java_ZeroTier_ztjni_1send |
||||
(JNIEnv *, jobject, jint, jbyteArray, jint, jint); |
||||
|
||||
/*
|
||||
* Class: ZeroTier |
||||
* Method: ztjni_recvfrom |
||||
* Signature: (I[BIILAddress;)I |
||||
*/ |
||||
JNIEXPORT jint JNICALL Java_ZeroTier_ztjni_1recvfrom |
||||
(JNIEnv *, jobject, jint, jbyteArray, jint, jint, jobject); |
||||
|
||||
/*
|
||||
* Class: ZeroTier |
||||
* Method: ztjni_fcntl |
||||
* Signature: (III)I |
||||
*/ |
||||
JNIEXPORT jint JNICALL Java_ZeroTier_ztjni_1fcntl |
||||
(JNIEnv *, jobject, jint, jint, jint); |
||||
|
||||
#ifdef __cplusplus |
||||
} |
||||
#endif |
||||
#endif |
||||
Loading…
Reference in new issue