summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrant Limberg <glimberg@gmail.com>2015-11-02 19:18:55 -0800
committerGrant Limberg <glimberg@gmail.com>2015-11-02 19:18:55 -0800
commitb7df177f33fd7a98da18ed9f756ee7272982a65d (patch)
tree3669c37af43094fe050d81bba6c4ba0e9d8ee535
parent179b064b05460b706526a3249a25cd07232a42f5 (diff)
downloadinfinitytier-b7df177f33fd7a98da18ed9f756ee7272982a65d.tar.gz
infinitytier-b7df177f33fd7a98da18ed9f756ee7272982a65d.zip
updates for origin/edge
-rw-r--r--java/jni/Android.mk2
-rw-r--r--java/jni/Application.mk2
-rw-r--r--java/jni/ZT_jniutils.cpp18
-rw-r--r--java/jni/com_zerotierone_sdk_Node.cpp64
-rw-r--r--java/src/com/zerotier/sdk/Event.java25
-rw-r--r--java/src/com/zerotier/sdk/EventListener.java15
6 files changed, 15 insertions, 111 deletions
diff --git a/java/jni/Android.mk b/java/jni/Android.mk
index 22dfe4f1..3da3b04b 100644
--- a/java/jni/Android.mk
+++ b/java/jni/Android.mk
@@ -15,7 +15,6 @@ LOCAL_SRC_FILES := \
$(ZT1)/ext/http-parser/http_parser.c \
$(ZT1)/node/C25519.cpp \
$(ZT1)/node/CertificateOfMembership.cpp \
- $(ZT1)/node/Defaults.cpp \
$(ZT1)/node/Dictionary.cpp \
$(ZT1)/node/Identity.cpp \
$(ZT1)/node/IncomingPacket.cpp \
@@ -26,6 +25,7 @@ LOCAL_SRC_FILES := \
$(ZT1)/node/Node.cpp \
$(ZT1)/node/OutboundMulticast.cpp \
$(ZT1)/node/Packet.cpp \
+ $(ZT1)/node/Path.cpp \
$(ZT1)/node/Peer.cpp \
$(ZT1)/node/Poly1305.cpp \
$(ZT1)/node/Salsa20.cpp \
diff --git a/java/jni/Application.mk b/java/jni/Application.mk
index 2a789787..608e94c0 100644
--- a/java/jni/Application.mk
+++ b/java/jni/Application.mk
@@ -1,5 +1,5 @@
NDK_TOOLCHAIN_VERSION := clang
APP_STL := c++_static
-APP_CPPFLAGS := -O3 -fPIC -fPIE -fvectorize -Wall -fstack-protector -fexceptions -fno-strict-aliasing -DZT_NO_TYPE_PUNNING=1
+APP_CPPFLAGS := -O3 -fPIC -fPIE -fvectorize -Wall -fstack-protector -fexceptions -fno-strict-aliasing -Wno-deprecated-register -DZT_NO_TYPE_PUNNING=1
APP_PLATFORM := android-14
APP_ABI := all
diff --git a/java/jni/ZT_jniutils.cpp b/java/jni/ZT_jniutils.cpp
index bd8d8708..ae1aa929 100644
--- a/java/jni/ZT_jniutils.cpp
+++ b/java/jni/ZT_jniutils.cpp
@@ -133,15 +133,6 @@ jobject createEvent(JNIEnv *env, ZT_Event event)
case ZT_EVENT_FATAL_ERROR_IDENTITY_COLLISION:
fieldName = "EVENT_FATAL_ERROR_IDENTITY_COLLISION";
break;
- case ZT_EVENT_SAW_MORE_RECENT_VERSION:
- fieldName = "EVENT_SAW_MORE_RECENT_VERSION";
- break;
- case ZT_EVENT_AUTHENTICATION_FAILURE:
- fieldName = "EVENT_AUTHENTICATION_FAILURE";
- break;
- case ZT_EVENT_INVALID_PACKET:
- fieldName = "EVENT_INVALID_PACKET";
- break;
case ZT_EVENT_TRACE:
fieldName = "EVENT_TRACE";
break;
@@ -425,7 +416,6 @@ jobject newPeerPhysicalPath(JNIEnv *env, const ZT_PeerPhysicalPath &ppp)
jfieldID addressField = NULL;
jfieldID lastSendField = NULL;
jfieldID lastReceiveField = NULL;
- jfieldID fixedField = NULL;
jfieldID activeField = NULL;
jfieldID preferredField = NULL;
@@ -459,13 +449,6 @@ jobject newPeerPhysicalPath(JNIEnv *env, const ZT_PeerPhysicalPath &ppp)
return NULL;
}
- fixedField = lookup.findField(pppClass, "fixed", "Z");
- if(env->ExceptionCheck() || fixedField == NULL)
- {
- LOGE("Error finding fixed field");
- return NULL;
- }
-
activeField = lookup.findField(pppClass, "active", "Z");
if(env->ExceptionCheck() || activeField == NULL)
{
@@ -503,7 +486,6 @@ jobject newPeerPhysicalPath(JNIEnv *env, const ZT_PeerPhysicalPath &ppp)
env->SetObjectField(pppObject, addressField, addressObject);
env->SetLongField(pppObject, lastSendField, ppp.lastSend);
env->SetLongField(pppObject, lastReceiveField, ppp.lastReceive);
- env->SetBooleanField(pppObject, fixedField, ppp.fixed);
env->SetBooleanField(pppObject, activeField, ppp.active);
env->SetBooleanField(pppObject, preferredField, ppp.preferred);
diff --git a/java/jni/com_zerotierone_sdk_Node.cpp b/java/jni/com_zerotierone_sdk_Node.cpp
index e6042649..a4c677b7 100644
--- a/java/jni/com_zerotierone_sdk_Node.cpp
+++ b/java/jni/com_zerotierone_sdk_Node.cpp
@@ -134,7 +134,8 @@ namespace {
(jlong)nwid, operationObject, networkConfigObject);
}
- void VirtualNetworkFrameFunctionCallback(ZT_Node *node,void *userData,
+ void VirtualNetworkFrameFunctionCallback(ZT_Node *node,
+ void *userData,
uint64_t nwid,
uint64_t sourceMac,
uint64_t destMac,
@@ -189,7 +190,10 @@ namespace {
}
- void EventCallback(ZT_Node *node,void *userData,enum ZT_Event event, const void *data)
+ void EventCallback(ZT_Node *node,
+ void *userData,
+ enum ZT_Event event,
+ const void *data)
{
LOGV("EventCallback");
JniRef *ref = (JniRef*)userData;
@@ -217,25 +221,6 @@ namespace {
return;
}
-
- jmethodID onOutOfDateMethod = lookup.findMethod(eventListenerClass,
- "onOutOfDate", "(Lcom/zerotier/sdk/Version;)V");
- if(onOutOfDateMethod == NULL)
- {
- LOGE("Couldn't find onOutOfDate method");
- return;
- }
-
-
- jmethodID onNetworkErrorMethod = lookup.findMethod(eventListenerClass,
- "onNetworkError", "(Lcom/zerotier/sdk/Event;Ljava/net/InetSocketAddress;)V");
- if(onNetworkErrorMethod == NULL)
- {
- LOGE("Couldn't find onNetworkError method");
- return;
- }
-
-
jmethodID onTraceMethod = lookup.findMethod(eventListenerClass,
"onTrace", "(Ljava/lang/String;)V");
if(onTraceMethod == NULL)
@@ -263,31 +248,6 @@ namespace {
env->CallVoidMethod(ref->eventListener, onEventMethod, eventObject);
}
break;
- case ZT_EVENT_SAW_MORE_RECENT_VERSION:
- {
- LOGV("Version Event");
- // call onOutOfDate()
- if(data != NULL)
- {
- int *version = (int*)data;
- jobject verisonObj = newVersion(env, version[0], version[1], version[2], 0);
- env->CallVoidMethod(ref->eventListener, onOutOfDateMethod, verisonObj);
- }
- }
- break;
- case ZT_EVENT_AUTHENTICATION_FAILURE:
- case ZT_EVENT_INVALID_PACKET:
- {
- LOGV("Network Error Event");
- // call onNetworkError()
- if(data != NULL)
- {
- sockaddr_storage *addr = (sockaddr_storage*)data;
- jobject addressObj = newInetSocketAddress(env, *addr);
- env->CallVoidMethod(ref->eventListener, onNetworkErrorMethod, addressObj);
- }
- }
- break;
case ZT_EVENT_TRACE:
{
LOGV("Trace Event");
@@ -303,7 +263,8 @@ namespace {
}
}
- long DataStoreGetFunction(ZT_Node *node,void *userData,
+ long DataStoreGetFunction(ZT_Node *node,
+ void *userData,
const char *objectName,
void *buffer,
unsigned long bufferSize,
@@ -375,7 +336,8 @@ namespace {
return retval;
}
- int DataStorePutFunction(ZT_Node *node,void *userData,
+ int DataStorePutFunction(ZT_Node *node,
+ void *userData,
const char *objectName,
const void *buffer,
unsigned long bufferSize,
@@ -440,7 +402,8 @@ namespace {
}
}
- int WirePacketSendFunction(ZT_Node *node,void *userData,\
+ int WirePacketSendFunction(ZT_Node *node,
+ void *userData,
const struct sockaddr_storage *localAddress,
const struct sockaddr_storage *remoteAddress,
const void *buffer,
@@ -625,8 +588,7 @@ JNIEXPORT jobject JNICALL Java_com_zerotier_sdk_Node_node_1init(
&WirePacketSendFunction,
&VirtualNetworkFrameFunctionCallback,
&VirtualNetworkConfigFunctionCallback,
- &EventCallback,
- NULL);
+ &EventCallback);
if(rc != ZT_RESULT_OK)
{
diff --git a/java/src/com/zerotier/sdk/Event.java b/java/src/com/zerotier/sdk/Event.java
index 436b1b22..22d350e1 100644
--- a/java/src/com/zerotier/sdk/Event.java
+++ b/java/src/com/zerotier/sdk/Event.java
@@ -86,31 +86,6 @@ public enum Event {
* umbrellas prevent rain and smoke detectors prevent fires. They do, right?</p>
*/
EVENT_FATAL_ERROR_IDENTITY_COLLISION,
-
- /**
- * A more recent version was observed on the network
- *
- * <p>Right now this is only triggered if a hub or rootserver reports a
- * more recent version, and only once. It can be used to trigger a
- * software update check.</p>
- *
- * <p>Meta-data: {@link Version}, more recent version number</p>
- */
- EVENT_SAW_MORE_RECENT_VERSION,
-
- /**
- * A packet failed authentication
- *
- * <p>Meta-data: {@link InetSocketAddress} containing origin address of packet</p>
- */
- EVENT_AUTHENTICATION_FAILURE,
-
- /**
- * A received packet was not valid
- *
- * <p>Meta-data: {@link InetSocketAddress} containing origin address of packet</p>
- */
- EVENT_INVALID_PACKET,
/**
* Trace (debugging) message
diff --git a/java/src/com/zerotier/sdk/EventListener.java b/java/src/com/zerotier/sdk/EventListener.java
index bb191c1d..91050aaa 100644
--- a/java/src/com/zerotier/sdk/EventListener.java
+++ b/java/src/com/zerotier/sdk/EventListener.java
@@ -42,21 +42,6 @@ public interface EventListener {
public void onEvent(Event event);
/**
- * Callback for network error events: {@link Event.EVENT_AUTHENTICATION_FAILURE}, {link Event.EVENT_INVALID_PACKET}
- *
- * @param event {@link Event} enum
- * @param source {@link InetSocketAddress} containing the origin address of the packet
- */
- public void onNetworkError(Event event, InetSocketAddress source);
-
- /**
- * Callback when the node detects that it's out of date.
- *
- * @param newVersion {@link Version} object with the latest version of ZeroTier One
- */
- public void onOutOfDate(Version newVersion);
-
- /**
* Trace messages
*
* <p>These events are only generated if the underlying ZeroTierOne SDK is a TRACE-enabled build.</p>