diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-07-19 15:16:15 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-07-19 15:16:15 -0700 |
commit | e4823381c66917746abb0f8d13281d61daa2f112 (patch) | |
tree | 092703ecb1d825800deb00d19a7ae4317f8e2710 | |
parent | 66feaeb51907514c3ccab3305d44ca5c69e7000a (diff) | |
download | infinitytier-e4823381c66917746abb0f8d13281d61daa2f112.tar.gz infinitytier-e4823381c66917746abb0f8d13281d61daa2f112.zip |
.
-rw-r--r-- | controller/EmbeddedNetworkController.cpp | 7 | ||||
-rw-r--r-- | include/ZeroTierOne.h | 1 |
2 files changed, 6 insertions, 2 deletions
diff --git a/controller/EmbeddedNetworkController.cpp b/controller/EmbeddedNetworkController.cpp index 1d03f67c..72d47622 100644 --- a/controller/EmbeddedNetworkController.cpp +++ b/controller/EmbeddedNetworkController.cpp @@ -1075,7 +1075,7 @@ unsigned int EmbeddedNetworkController::handleControlPlaneHttpDELETE( void EmbeddedNetworkController::handleRemoteTrace(const ZT_RemoteTrace &rt) { static volatile unsigned long idCounter = 0; - char id[128]; + char id[128],tmp[128]; std::string k,v; 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["objtype"] = "trace"; + d["ts"] = now; + d["nodeId"] = Utils::hex10(rt.origin,tmp); bool accept = true; /* diff --git a/include/ZeroTierOne.h b/include/ZeroTierOne.h index e325b369..e6ec8090 100644 --- a/include/ZeroTierOne.h +++ b/include/ZeroTierOne.h @@ -259,6 +259,7 @@ extern "C" { // Fields in remote trace dictionaries #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_VERB "packetVerb" #define ZT_REMOTE_TRACE_FIELD__PACKET_TRUSTED_PATH_ID "packetTrustedPathId" |