Browse Source

fix ANDROID-51: fieldName is uninitialized

Brenton Bostick 2 years ago
parent
commit
01003617cd
2 changed files with 24 additions and 1 deletions
  1. 3 0
      java/jni/ZT_jniutils.cpp
  2. 21 1
      java/src/com/zerotier/sdk/Event.java

+ 3 - 0
java/jni/ZT_jniutils.cpp

@@ -170,8 +170,11 @@ jobject createEvent(JNIEnv *env, ZT_Event event)
         fieldName = "EVENT_TRACE";
         break;
     case ZT_EVENT_USER_MESSAGE:
+        fieldName = "EVENT_USER_MESSAGE";
         break;
     case ZT_EVENT_REMOTE_TRACE:
+        fieldName = "EVENT_REMOTE_TRACE";
+        break;
     default:
         break;
     }

+ 21 - 1
java/src/com/zerotier/sdk/Event.java

@@ -95,5 +95,25 @@ public enum Event {
      *
      * <p>Meta-data: {@link String}, TRACE message</p>
      */
-	EVENT_TRACE
+    EVENT_TRACE,
+
+    /**
+     * VERB_USER_MESSAGE received
+     *
+     * These are generated when a VERB_USER_MESSAGE packet is received via
+     * ZeroTier VL1.
+     */
+    EVENT_USER_MESSAGE,
+
+    /**
+     * Remote trace received
+     *
+     * These are generated when a VERB_REMOTE_TRACE is received. Note
+     * that any node can fling one of these at us. It is your responsibility
+     * to filter and determine if it's worth paying attention to. If it's
+     * not just drop it. Most nodes that are not active controllers ignore
+     * these, and controllers only save them if they pertain to networks
+     * with remote tracing enabled.
+     */
+    EVENT_REMOTE_TRACE;
 }