diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2018-01-25 07:11:59 -0500 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2018-01-25 07:11:59 -0500 |
| commit | 4419734a7db21cd6a9ee8aba911f220cbecba085 (patch) | |
| tree | 93bda7e55ef906db246434509eb5334513c27b87 /node/NetworkConfig.hpp | |
| parent | f821db29f34d040d59b6118164bf3c7242959a0e (diff) | |
| download | infinitytier-4419734a7db21cd6a9ee8aba911f220cbecba085.tar.gz infinitytier-4419734a7db21cd6a9ee8aba911f220cbecba085.zip | |
Implement continuous contacting of designated anchors and multicast replicators - GitHub issue #666
Diffstat (limited to 'node/NetworkConfig.hpp')
| -rw-r--r-- | node/NetworkConfig.hpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/node/NetworkConfig.hpp b/node/NetworkConfig.hpp index 3a2664a2..ebe0d70e 100644 --- a/node/NetworkConfig.hpp +++ b/node/NetworkConfig.hpp @@ -47,6 +47,7 @@ #include "Capability.hpp" #include "Tag.hpp" #include "Dictionary.hpp" +#include "Hashtable.hpp" #include "Identity.hpp" #include "Utils.hpp" #include "Trace.hpp" @@ -318,6 +319,18 @@ public: } /** + * Add addresses that we should attempt to stay connected to to a set + */ + inline void getAlwaysContactAddresses(Hashtable< Address,std::vector<InetAddress> > &a) const + { + for(unsigned int i=0;i<specialistCount;++i) { + if ((specialists[i] & (ZT_NETWORKCONFIG_SPECIALIST_TYPE_ANCHOR | ZT_NETWORKCONFIG_SPECIALIST_TYPE_MULTICAST_REPLICATOR)) != 0) { + a[Address(specialists[i])]; + } + } + } + + /** * @param fromPeer Peer attempting to bridge other Ethernet peers onto network * @return True if this network allows bridging */ @@ -332,11 +345,7 @@ public: return false; } - /** - * @return True if this network config is non-NULL - */ inline operator bool() const { return (networkId != 0); } - inline bool operator==(const NetworkConfig &nc) const { return (memcmp(this,&nc,sizeof(NetworkConfig)) == 0); } inline bool operator!=(const NetworkConfig &nc) const { return (!(*this == nc)); } |
