From d24b706c7f268b5f2fc848d1f4cdb9ab90441593 Mon Sep 17 00:00:00 2001 From: Brenton Bostick Date: Tue, 31 Jan 2023 11:33:34 -0500 Subject: [PATCH] fix ANDROID-51: fieldName is uninitialized --- java/jni/ZT_jniutils.cpp | 3 +++ java/src/com/zerotier/sdk/Event.java | 22 +++++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/java/jni/ZT_jniutils.cpp b/java/jni/ZT_jniutils.cpp index 34df2781f..8c1fed768 100644 --- a/java/jni/ZT_jniutils.cpp +++ b/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; } diff --git a/java/src/com/zerotier/sdk/Event.java b/java/src/com/zerotier/sdk/Event.java index d0f314e9a..1f33cea5c 100644 --- a/java/src/com/zerotier/sdk/Event.java +++ b/java/src/com/zerotier/sdk/Event.java @@ -95,5 +95,25 @@ public enum Event { * *

Meta-data: {@link String}, TRACE message

*/ - 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; } \ No newline at end of file