mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-07-05 20:41:44 -07:00
Some more bridging work... wiring up in Switch - GitHub issue #68
This commit is contained in:
parent
08b7bb3c7a
commit
5682f0b772
4 changed files with 180 additions and 94 deletions
|
@ -166,6 +166,22 @@ public:
|
|||
return _a;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test whether this address is within a multicast propagation prefix
|
||||
*
|
||||
* Multicast propagation prefixes are (right-to-left a.k.a. LSB to MSB)
|
||||
* bit pattern prefixes of prefixBits bits that restrict which peers are
|
||||
* visited along a given multicast graph traversal path.
|
||||
*
|
||||
* @param prefix Prefix bit pattern (LSB to MSB)
|
||||
* @param prefixBits Number of bits in prefix bit pattern
|
||||
* @return True if address is within prefix
|
||||
*/
|
||||
inline bool withinMulticastPropagationPrefix(uint64_t prefix,unsigned int prefixBits)
|
||||
{
|
||||
return ((_a & (0xffffffffffffffffULL >> (64 - prefixBits))) == prefix);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Hexadecimal string
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue