Factored out multicast propagation algorithm from Switch and Topology, also cleaned up and clarified it a bit.
This commit is contained in:
@@ -42,6 +42,7 @@
|
||||
#include "RuntimeEnvironment.hpp"
|
||||
#include "MulticastGroup.hpp"
|
||||
#include "NonCopyable.hpp"
|
||||
#include "MAC.hpp"
|
||||
|
||||
namespace ZeroTier {
|
||||
|
||||
@@ -111,6 +112,19 @@ public:
|
||||
return ((_open)||(_members.count(addr) > 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* 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)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user