diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2013-07-10 17:24:27 -0400 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2013-07-10 17:24:27 -0400 |
| commit | 9e28bbfbb2671f71527e76dd20fe4a659109ad4b (patch) | |
| tree | 8017270bb4dfc7570c40797d73b02df7d37b99d9 /node/Network.hpp | |
| parent | 47f611e7b8d2ff95a3ff795574798b4e24a6719d (diff) | |
| download | infinitytier-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.hpp | 14 |
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 |
