summaryrefslogtreecommitdiff
path: root/node/Network.hpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2013-07-10 17:24:27 -0400
committerAdam Ierymenko <adam.ierymenko@gmail.com>2013-07-10 17:24:27 -0400
commit9e28bbfbb2671f71527e76dd20fe4a659109ad4b (patch)
tree8017270bb4dfc7570c40797d73b02df7d37b99d9 /node/Network.hpp
parent47f611e7b8d2ff95a3ff795574798b4e24a6719d (diff)
downloadinfinitytier-9e28bbfbb2671f71527e76dd20fe4a659109ad4b.tar.gz
infinitytier-9e28bbfbb2671f71527e76dd20fe4a659109ad4b.zip
Factored out multicast propagation algorithm from Switch and Topology, also cleaned up and clarified it a bit.
Diffstat (limited to 'node/Network.hpp')
-rw-r--r--node/Network.hpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/node/Network.hpp b/node/Network.hpp
index 0ed3bef5..ddb8930f 100644
--- a/node/Network.hpp
+++ b/node/Network.hpp
@@ -42,6 +42,7 @@
#include "RuntimeEnvironment.hpp"
#include "MulticastGroup.hpp"
#include "NonCopyable.hpp"
+#include "MAC.hpp"
namespace ZeroTier {
@@ -112,6 +113,19 @@ public:
}
/**
+ * Shortcut to check open(), whether MAC is ZeroTier, then isMember()
+ *
+ * @param mac MAC address to check
+ * @return True if MAC is allowed
+ */
+ inline bool isAllowed(const MAC &mac) const
+ throw()
+ {
+ Mutex::Lock _l(_lock);
+ return ((_open)||((mac.isZeroTier())&&(_members.count(Address(mac)) > 0)));
+ }
+
+ /**
* @return True if network is open (no membership required)
*/
inline bool open() const