Adam Ierymenko 8 years ago
parent
commit
e4823381c6
2 changed files with 6 additions and 2 deletions
  1. 5 2
      controller/EmbeddedNetworkController.cpp
  2. 1 0
      include/ZeroTierOne.h

+ 5 - 2
controller/EmbeddedNetworkController.cpp

@@ -1075,7 +1075,7 @@ unsigned int EmbeddedNetworkController::handleControlPlaneHttpDELETE(
 void EmbeddedNetworkController::handleRemoteTrace(const ZT_RemoteTrace &rt)
 void EmbeddedNetworkController::handleRemoteTrace(const ZT_RemoteTrace &rt)
 {
 {
 	static volatile unsigned long idCounter = 0;
 	static volatile unsigned long idCounter = 0;
-	char id[128];
+	char id[128],tmp[128];
 	std::string k,v;
 	std::string k,v;
 
 
 	try {
 	try {
@@ -1116,9 +1116,12 @@ void EmbeddedNetworkController::handleRemoteTrace(const ZT_RemoteTrace &rt)
 			}
 			}
 		}
 		}
 
 
-		OSUtils::ztsnprintf(id,sizeof(id),"%.10llx-%.10llx-%.16llx-%.8lx",_signingId.address().toInt(),rt.origin,OSUtils::now(),++idCounter);
+		const uint64_t now = OSUtils::now();
+		OSUtils::ztsnprintf(id,sizeof(id),"%.10llx-%.10llx-%.16llx-%.8lx",_signingId.address().toInt(),rt.origin,now,++idCounter);
 		d["id"] = id;
 		d["id"] = id;
 		d["objtype"] = "trace";
 		d["objtype"] = "trace";
+		d["ts"] = now;
+		d["nodeId"] = Utils::hex10(rt.origin,tmp);
 
 
 		bool accept = true;
 		bool accept = true;
 		/*
 		/*

+ 1 - 0
include/ZeroTierOne.h

@@ -259,6 +259,7 @@ extern "C" {
 
 
 // Fields in remote trace dictionaries
 // Fields in remote trace dictionaries
 #define ZT_REMOTE_TRACE_FIELD__EVENT "event"
 #define ZT_REMOTE_TRACE_FIELD__EVENT "event"
+#define ZT_REMOTE_TRACE_FIELD__NODE_ID "nodeId"
 #define ZT_REMOTE_TRACE_FIELD__PACKET_ID "packetId"
 #define ZT_REMOTE_TRACE_FIELD__PACKET_ID "packetId"
 #define ZT_REMOTE_TRACE_FIELD__PACKET_VERB "packetVerb"
 #define ZT_REMOTE_TRACE_FIELD__PACKET_VERB "packetVerb"
 #define ZT_REMOTE_TRACE_FIELD__PACKET_TRUSTED_PATH_ID "packetTrustedPathId"
 #define ZT_REMOTE_TRACE_FIELD__PACKET_TRUSTED_PATH_ID "packetTrustedPathId"