summaryrefslogtreecommitdiff
path: root/node/Network.hpp
diff options
context:
space:
mode:
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