Some more bridging work... wiring up in Switch - GitHub issue #68

This commit is contained in:
Adam Ierymenko 2014-06-13 17:49:33 -07:00
parent 08b7bb3c7a
commit 5682f0b772
4 changed files with 180 additions and 94 deletions

View file

@ -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
*/