summaryrefslogtreecommitdiff
path: root/node
diff options
context:
space:
mode:
authorGrant Limberg <grant.limberg@zerotier.com>2018-01-10 15:23:48 -0800
committerGrant Limberg <grant.limberg@zerotier.com>2018-01-10 15:24:54 -0800
commit406bcf7d3f743b5a3622445edb49623899dae957 (patch)
tree10af9317b35e1855aa4a522d768fc1b59356d4ea /node
parent57077e46073529098dd41b9d2b9d9ba060806036 (diff)
downloadinfinitytier-406bcf7d3f743b5a3622445edb49623899dae957.tar.gz
infinitytier-406bcf7d3f743b5a3622445edb49623899dae957.zip
Fix compilation on Windows
DEBUG macro from miniupnpc interferring with enum Trace::DEBUG;
Diffstat (limited to 'node')
-rw-r--r--node/Trace.cpp34
-rw-r--r--node/Trace.hpp10
2 files changed, 22 insertions, 22 deletions
diff --git a/node/Trace.cpp b/node/Trace.cpp
index a60a0194..f462136a 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> &path,const uint64_t packetId,const Packet::Verb verb)
@@ -170,7 +170,7 @@ void Trace::outgoingNetworkFrameDropped(void *const tPtr,const SharedPtr<Network
std::pair<Address,Trace::Level> 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<ZT_MAX_REMOTE_TRACE_SIZE> 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<Network
if (reason)
d.add(ZT_REMOTE_TRACE_FIELD__REASON,reason);
- 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);
}
}
@@ -199,7 +199,7 @@ void Trace::incomingNetworkAccessDenied(void *const tPtr,const SharedPtr<Network
std::pair<Address,Trace::Level> 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<ZT_MAX_REMOTE_TRACE_SIZE> 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 SharedPtr<Network
}
d.add(ZT_REMOTE_TRACE_FIELD__NETWORK_ID,network->id());
- 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<Network
std::pair<Address,Trace::Level> 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<ZT_MAX_REMOTE_TRACE_SIZE> 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<Network
if (reason)
d.add(ZT_REMOTE_TRACE_FIELD__REASON,reason);
- 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);
}
}
@@ -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<ZT_MAX_REMOTE_TRACE_SIZE> 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> &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<ZT_MAX_REMOTE_TRACE_SIZE> 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<Path> &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<ZT_MAX_REMOTE_TRACE_SIZE> 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<Path> &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<ZT_MAX_REMOTE_TRACE_SIZE> 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<Address,Trace::Level> 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<ZT_MAX_REMOTE_TRACE_SIZE> 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 05d5b66a..2a2fca6c 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
};
/**