summaryrefslogtreecommitdiff
path: root/node/RuntimeEnvironment.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'node/RuntimeEnvironment.hpp')
-rw-r--r--node/RuntimeEnvironment.hpp32
1 files changed, 24 insertions, 8 deletions
diff --git a/node/RuntimeEnvironment.hpp b/node/RuntimeEnvironment.hpp
index e5d1f446..10cc6ec0 100644
--- a/node/RuntimeEnvironment.hpp
+++ b/node/RuntimeEnvironment.hpp
@@ -32,6 +32,7 @@
#include "Constants.hpp"
#include "Identity.hpp"
+#include "Mutex.hpp"
namespace ZeroTier {
@@ -43,6 +44,8 @@ class Multicaster;
class AntiRecursion;
class NetworkController;
class SelfAwareness;
+class Cluster;
+class DeferredPackets;
/**
* Holds global state for an instance of ZeroTier::Node
@@ -51,14 +54,18 @@ class RuntimeEnvironment
{
public:
RuntimeEnvironment(Node *n) :
- node(n),
- identity(),
- localNetworkController((NetworkController *)0),
- sw((Switch *)0),
- mc((Multicaster *)0),
- antiRec((AntiRecursion *)0),
- topology((Topology *)0),
- sa((SelfAwareness *)0)
+ node(n)
+ ,identity()
+ ,localNetworkController((NetworkController *)0)
+ ,sw((Switch *)0)
+ ,mc((Multicaster *)0)
+ ,antiRec((AntiRecursion *)0)
+ ,topology((Topology *)0)
+ ,sa((SelfAwareness *)0)
+ ,dp((DeferredPackets *)0)
+#ifdef ZT_ENABLE_CLUSTER
+ ,cluster((Cluster *)0)
+#endif
{
}
@@ -86,6 +93,15 @@ public:
AntiRecursion *antiRec;
Topology *topology;
SelfAwareness *sa;
+ DeferredPackets *dp;
+
+#ifdef ZT_ENABLE_CLUSTER
+ Cluster *cluster;
+#endif
+
+ // This is set to >0 if background threads are waiting on deferred
+ // packets, otherwise 'dp' should not be used.
+ volatile int dpEnabled;
};
} // namespace ZeroTier