From 57077e46073529098dd41b9d2b9d9ba060806036 Mon Sep 17 00:00:00 2001 From: Joseph Henry Date: Wed, 10 Jan 2018 14:40:31 -0800 Subject: [PATCH 1/2] Added (get) command blurb in cli help --- one.cpp | 1 + 1 file changed, 1 insertion(+) 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); From 406bcf7d3f743b5a3622445edb49623899dae957 Mon Sep 17 00:00:00 2001 From: Grant Limberg Date: Wed, 10 Jan 2018 15:23:48 -0800 Subject: [PATCH 2/2] Fix compilation on Windows DEBUG macro from miniupnpc interferring with enum Trace::DEBUG; --- node/Trace.cpp | 34 +++++++++++++++++----------------- node/Trace.hpp | 10 +++++----- 2 files changed, 22 insertions(+), 22 deletions(-) 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 }; /**