mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-05 03:53:44 +02:00
Stub out NetworkConfig for GitHub issue #666
This commit is contained in:
parent
055b99c3cb
commit
34e2ad0dfc
1 changed files with 13 additions and 8 deletions
|
@ -93,15 +93,20 @@
|
||||||
#define ZT_NETWORKCONFIG_FLAG_DISABLE_COMPRESSION 0x0000000000000010ULL
|
#define ZT_NETWORKCONFIG_FLAG_DISABLE_COMPRESSION 0x0000000000000010ULL
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Device is an active bridge
|
* Device can bridge to other Ethernet networks and gets unknown recipient multicasts
|
||||||
*/
|
*/
|
||||||
#define ZT_NETWORKCONFIG_SPECIALIST_TYPE_ACTIVE_BRIDGE 0x0000020000000000ULL
|
#define ZT_NETWORKCONFIG_SPECIALIST_TYPE_ACTIVE_BRIDGE 0x0000020000000000ULL
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Anchors are stable devices on this network that can cache multicast info, etc.
|
* Anchors are stable devices on this network that can act like roots when none are up
|
||||||
*/
|
*/
|
||||||
#define ZT_NETWORKCONFIG_SPECIALIST_TYPE_ANCHOR 0x0000040000000000ULL
|
#define ZT_NETWORKCONFIG_SPECIALIST_TYPE_ANCHOR 0x0000040000000000ULL
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Designated multicast replicators replicate multicast in place of sender-side replication
|
||||||
|
*/
|
||||||
|
#define ZT_NETWORKCONFIG_SPECIALIST_TYPE_MULTICAST_REPLICATOR 0x0000080000000000ULL
|
||||||
|
|
||||||
namespace ZeroTier {
|
namespace ZeroTier {
|
||||||
|
|
||||||
// Dictionary capacity needed for max size network config
|
// Dictionary capacity needed for max size network config
|
||||||
|
@ -312,16 +317,16 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param a Address to check
|
* @return ZeroTier addresses of "anchor" devices on this network
|
||||||
* @return True if address is an anchor
|
|
||||||
*/
|
*/
|
||||||
inline bool isAnchor(const Address &a) const
|
inline std::vector<Address> multicastReplicators() const
|
||||||
{
|
{
|
||||||
|
std::vector<Address> r;
|
||||||
for(unsigned int i=0;i<specialistCount;++i) {
|
for(unsigned int i=0;i<specialistCount;++i) {
|
||||||
if ((a == specialists[i])&&((specialists[i] & ZT_NETWORKCONFIG_SPECIALIST_TYPE_ANCHOR) != 0))
|
if ((specialists[i] & ZT_NETWORKCONFIG_SPECIALIST_TYPE_MULTICAST_REPLICATOR) != 0)
|
||||||
return true;
|
r.push_back(Address(specialists[i]));
|
||||||
}
|
}
|
||||||
return false;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue