Remote trace: plumbing, replace old TRACE with calls to Trace object.

This commit is contained in:
Adam Ierymenko 2017-07-07 16:58:05 -07:00
parent e14d5d49a1
commit dab0fb9e05
21 changed files with 577 additions and 533 deletions

View file

@ -42,12 +42,6 @@
#include "Utils.hpp"
#include "Buffer.hpp"
//#ifdef ZT_USE_SYSTEM_LZ4
//#include <lz4.h>
//#else
//#include "../ext/lz4/lz4.h"
//#endif
/**
* Protocol version -- incremented only for major changes
*
@ -969,7 +963,27 @@ public:
* ZeroTier, Inc. itself. We recommend making up random ones for your own
* implementations.
*/
VERB_USER_MESSAGE = 0x14
VERB_USER_MESSAGE = 0x14,
/**
* A trace for remote debugging or diagnostics:
* <[8] 64-bit instance ID>
* <[2] 16-bit length of Dictionary>
* <[...] dictionary containing trace information>
*
* This message contains a remote trace event. Remote trace events can
* be sent to observers configured at the network level for those that
* pertain directly to actiity on a network, or to global observers if
* locally configured.
*
* The instance ID is a random 64-bit value generated by each ZeroTier
* node on startup. This is helpful in identifying traces from different
* members of a cluster.
*
* The Dictionary serialization format is the same as used for network
* configurations. The maximum size of a trace is 10000 bytes.
*/
VERB_REMOTE_TRACE = 0x15
};
/**
@ -1005,11 +1019,6 @@ public:
ERROR_UNWANTED_MULTICAST = 0x08
};
#ifdef ZT_TRACE
static const char *verbString(Verb v);
static const char *errorString(ErrorCode e);
#endif
template<unsigned int C2>
Packet(const Buffer<C2> &b) :
Buffer<ZT_PROTO_MAX_PACKET_LENGTH>(b)