diff --git a/node/Trace.cpp b/node/Trace.cpp index a60a01943..f462136a9 100644 --- a/node/Trace.cpp +++ b/node/Trace.cpp @@ -72,7 +72,7 @@ void Trace::resettingPathsInScope(void *const tPtr,const Address &reporter,const if (_globalTarget) _send(tPtr,d,_globalTarget); - _spamToAllNetworks(tPtr,d,Trace::NORMAL); + _spamToAllNetworks(tPtr,d,Trace::LEVEL_NORMAL); } void Trace::peerConfirmingUnknownPath(void *const tPtr,const uint64_t networkId,Peer &peer,const SharedPtr &path,const uint64_t packetId,const Packet::Verb verb) @@ -170,7 +170,7 @@ void Trace::outgoingNetworkFrameDropped(void *const tPtr,const SharedPtr byn; { Mutex::Lock l(_byNet_m); _byNet.get(network->id(),byn); } - if ( ((_globalTarget)&&((int)_globalLevel >= (int)Trace::VERBOSE)) || ((byn.first)&&((int)byn.second >= (int)Trace::VERBOSE)) ) { + if ( ((_globalTarget)&&((int)_globalLevel >= (int)Trace::LEVEL_VERBOSE)) || ((byn.first)&&((int)byn.second >= (int)Trace::LEVEL_VERBOSE)) ) { Dictionary d; d.add(ZT_REMOTE_TRACE_FIELD__EVENT,ZT_REMOTE_TRACE_EVENT__OUTGOING_NETWORK_FRAME_DROPPED_S); d.add(ZT_REMOTE_TRACE_FIELD__NETWORK_ID,network->id()); @@ -182,9 +182,9 @@ void Trace::outgoingNetworkFrameDropped(void *const tPtr,const SharedPtr= (int)Trace::VERBOSE)) + if ((_globalTarget)&&((int)_globalLevel >= (int)Trace::LEVEL_VERBOSE)) _send(tPtr,d,_globalTarget); - if ((byn.first)&&((int)byn.second >= (int)Trace::VERBOSE)) + if ((byn.first)&&((int)byn.second >= (int)Trace::LEVEL_VERBOSE)) _send(tPtr,d,byn.first); } } @@ -199,7 +199,7 @@ void Trace::incomingNetworkAccessDenied(void *const tPtr,const SharedPtr byn; { Mutex::Lock l(_byNet_m); _byNet.get(network->id(),byn); } - if ( ((_globalTarget)&&((int)_globalLevel >= (int)Trace::VERBOSE)) || ((byn.first)&&((int)byn.second >= (int)Trace::VERBOSE)) ) { + if ( ((_globalTarget)&&((int)_globalLevel >= (int)Trace::LEVEL_VERBOSE)) || ((byn.first)&&((int)byn.second >= (int)Trace::LEVEL_VERBOSE)) ) { Dictionary d; d.add(ZT_REMOTE_TRACE_FIELD__EVENT,ZT_REMOTE_TRACE_EVENT__INCOMING_NETWORK_ACCESS_DENIED_S); d.add(ZT_REMOTE_TRACE_FIELD__PACKET_ID,packetId); @@ -211,9 +211,9 @@ void Trace::incomingNetworkAccessDenied(void *const tPtr,const SharedPtrid()); - if ((_globalTarget)&&((int)_globalLevel >= (int)Trace::VERBOSE)) + if ((_globalTarget)&&((int)_globalLevel >= (int)Trace::LEVEL_VERBOSE)) _send(tPtr,d,_globalTarget); - if ((byn.first)&&((int)byn.second >= (int)Trace::VERBOSE)) + if ((byn.first)&&((int)byn.second >= (int)Trace::LEVEL_VERBOSE)) _send(tPtr,d,byn.first); } } @@ -228,7 +228,7 @@ void Trace::incomingNetworkFrameDropped(void *const tPtr,const SharedPtr byn; { Mutex::Lock l(_byNet_m); _byNet.get(network->id(),byn); } - if ( ((_globalTarget)&&((int)_globalLevel >= (int)Trace::VERBOSE)) || ((byn.first)&&((int)byn.second >= (int)Trace::VERBOSE)) ) { + if ( ((_globalTarget)&&((int)_globalLevel >= (int)Trace::LEVEL_VERBOSE)) || ((byn.first)&&((int)byn.second >= (int)Trace::LEVEL_VERBOSE)) ) { Dictionary d; d.add(ZT_REMOTE_TRACE_FIELD__EVENT,ZT_REMOTE_TRACE_EVENT__INCOMING_NETWORK_FRAME_DROPPED_S); d.add(ZT_REMOTE_TRACE_FIELD__PACKET_ID,packetId); @@ -244,9 +244,9 @@ void Trace::incomingNetworkFrameDropped(void *const tPtr,const SharedPtr= (int)Trace::VERBOSE)) + if ((_globalTarget)&&((int)_globalLevel >= (int)Trace::LEVEL_VERBOSE)) _send(tPtr,d,_globalTarget); - if ((byn.first)&&((int)byn.second >= (int)Trace::VERBOSE)) + if ((byn.first)&&((int)byn.second >= (int)Trace::LEVEL_VERBOSE)) _send(tPtr,d,byn.first); } } @@ -257,7 +257,7 @@ void Trace::incomingPacketMessageAuthenticationFailure(void *const tPtr,const Sh ZT_LOCAL_TRACE(tPtr,RR,"MAC failed for packet %.16llx from %.10llx(%s)",packetId,source.toInt(),(path) ? path->address().toString(tmp) : "???"); - if ((_globalTarget)&&((int)_globalLevel >= Trace::DEBUG)) { + if ((_globalTarget)&&((int)_globalLevel >= Trace::LEVEL_DEBUG)) { Dictionary d; d.add(ZT_REMOTE_TRACE_FIELD__EVENT,ZT_REMOTE_TRACE_EVENT__PACKET_MAC_FAILURE_S); d.add(ZT_REMOTE_TRACE_FIELD__PACKET_ID,packetId); @@ -280,7 +280,7 @@ void Trace::incomingPacketInvalid(void *const tPtr,const SharedPtr &path,c ZT_LOCAL_TRACE(tPtr,RR,"INVALID packet %.16llx from %.10llx(%s) (%s)",packetId,source.toInt(),(path) ? path->address().toString(tmp) : "???",(reason) ? reason : "unknown reason"); - if ((_globalTarget)&&((int)_globalLevel >= Trace::DEBUG)) { + if ((_globalTarget)&&((int)_globalLevel >= Trace::LEVEL_DEBUG)) { Dictionary d; d.add(ZT_REMOTE_TRACE_FIELD__EVENT,ZT_REMOTE_TRACE_EVENT__PACKET_INVALID_S); d.add(ZT_REMOTE_TRACE_FIELD__PACKET_ID,packetId); @@ -304,7 +304,7 @@ void Trace::incomingPacketDroppedHELLO(void *const tPtr,const SharedPtr &p ZT_LOCAL_TRACE(tPtr,RR,"DROPPED HELLO from %.10llx(%s) (%s)",source.toInt(),(path) ? path->address().toString(tmp) : "???",(reason) ? reason : "???"); - if ((_globalTarget)&&((int)_globalLevel >= Trace::DEBUG)) { + if ((_globalTarget)&&((int)_globalLevel >= Trace::LEVEL_DEBUG)) { Dictionary d; d.add(ZT_REMOTE_TRACE_FIELD__EVENT,ZT_REMOTE_TRACE_EVENT__PACKET_INVALID_S); d.add(ZT_REMOTE_TRACE_FIELD__PACKET_ID,packetId); @@ -323,7 +323,7 @@ void Trace::incomingPacketDroppedHELLO(void *const tPtr,const SharedPtr &p void Trace::networkConfigRequestSent(void *const tPtr,const Network &network,const Address &controller) { ZT_LOCAL_TRACE(tPtr,RR,"requesting configuration for network %.16llx",network.id()); - if ((_globalTarget)&&((int)_globalLevel >= Trace::DEBUG)) { + if ((_globalTarget)&&((int)_globalLevel >= Trace::LEVEL_DEBUG)) { Dictionary d; d.add(ZT_REMOTE_TRACE_FIELD__EVENT,ZT_REMOTE_TRACE_EVENT__NETWORK_CONFIG_REQUEST_SENT_S); d.add(ZT_REMOTE_TRACE_FIELD__NETWORK_ID,network.id()); @@ -353,7 +353,7 @@ void Trace::networkFilter( std::pair byn; { Mutex::Lock l(_byNet_m); _byNet.get(network.id(),byn); } - if ( ((_globalTarget)&&((int)_globalLevel >= (int)Trace::RULES)) || ((byn.first)&&((int)byn.second >= (int)Trace::RULES)) ) { + if ( ((_globalTarget)&&((int)_globalLevel >= (int)Trace::LEVEL_RULES)) || ((byn.first)&&((int)byn.second >= (int)Trace::LEVEL_RULES)) ) { Dictionary d; d.add(ZT_REMOTE_TRACE_FIELD__EVENT,ZT_REMOTE_TRACE_EVENT__NETWORK_FILTER_TRACE_S); d.add(ZT_REMOTE_TRACE_FIELD__NETWORK_ID,network.id()); @@ -375,9 +375,9 @@ void Trace::networkFilter( if (frameLen > 0) d.add(ZT_REMOTE_TRACE_FIELD__FRAME_DATA,(const char *)frameData,(frameLen > 256) ? (int)256 : (int)frameLen); - if ((_globalTarget)&&((int)_globalLevel >= (int)Trace::RULES)) + if ((_globalTarget)&&((int)_globalLevel >= (int)Trace::LEVEL_RULES)) _send(tPtr,d,_globalTarget); - if ((byn.first)&&((int)byn.second >= (int)Trace::RULES)) + if ((byn.first)&&((int)byn.second >= (int)Trace::LEVEL_RULES)) _send(tPtr,d,byn.first); } } diff --git a/node/Trace.hpp b/node/Trace.hpp index 05d5b66a8..2a2fca6cb 100644 --- a/node/Trace.hpp +++ b/node/Trace.hpp @@ -70,11 +70,11 @@ public: */ enum Level { - NORMAL = 0, - VERBOSE = 10, - RULES = 15, - DEBUG = 20, - INSANE = 30 + LEVEL_NORMAL = 0, + LEVEL_VERBOSE = 10, + LEVEL_RULES = 15, + LEVEL_DEBUG = 20, + LEVEL_INSANE = 30 }; /** diff --git a/one.cpp b/one.cpp index 0a945b337..a8f51b45b 100644 --- a/one.cpp +++ b/one.cpp @@ -131,6 +131,7 @@ static void cliPrintHelp(const char *pn,FILE *out) fprintf(out," join - Join a network" ZT_EOL_S); fprintf(out," leave - Leave a network" ZT_EOL_S); fprintf(out," set - Set a network setting" ZT_EOL_S); + fprintf(out," get - Get a network setting" ZT_EOL_S); fprintf(out," listmoons - List moons (federated root sets)" ZT_EOL_S); fprintf(out," orbit - Join a moon via any member root" ZT_EOL_S); fprintf(out," deorbit - Leave a moon" ZT_EOL_S);