Clean up some multicast code.

This commit is contained in:
Adam Ierymenko 2018-01-26 20:38:44 -05:00
parent e74cd4b4ef
commit f03fd57997
5 changed files with 79 additions and 44 deletions

View file

@ -292,6 +292,16 @@ public:
return r;
}
inline unsigned int activeBridges(Address ab[ZT_MAX_NETWORK_SPECIALISTS]) const
{
unsigned int c = 0;
for(unsigned int i=0;i<specialistCount;++i) {
if ((specialists[i] & ZT_NETWORKCONFIG_SPECIALIST_TYPE_ACTIVE_BRIDGE) != 0)
ab[c++] = specialists[i];
}
return c;
}
inline std::vector<Address> anchors() const
{
std::vector<Address> r;
@ -322,6 +332,16 @@ public:
return r;
}
inline unsigned int alwaysContactAddresses(Address ac[ZT_MAX_NETWORK_SPECIALISTS]) const
{
unsigned int c = 0;
for(unsigned int i=0;i<specialistCount;++i) {
if ((specialists[i] & (ZT_NETWORKCONFIG_SPECIALIST_TYPE_ANCHOR | ZT_NETWORKCONFIG_SPECIALIST_TYPE_MULTICAST_REPLICATOR)) != 0)
ac[c++] = specialists[i];
}
return c;
}
inline void alwaysContactAddresses(Hashtable< Address,std::vector<InetAddress> > &a) const
{
for(unsigned int i=0;i<specialistCount;++i) {