diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2014-06-10 15:47:20 -0700 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2014-06-10 15:47:20 -0700 |
| commit | 4e1f49258bd5ff2b87c313f7452775ad78ce53db (patch) | |
| tree | 1a8ffea4590bfa2efc728ef5a4dce186ba82bdf2 /node/NetworkConfig.cpp | |
| parent | fb31f93c5295752b5a07d742dae397654c6c8f67 (diff) | |
| download | infinitytier-4e1f49258bd5ff2b87c313f7452775ad78ce53db.tar.gz infinitytier-4e1f49258bd5ff2b87c313f7452775ad78ce53db.zip | |
Bridging in NetworkConfig - GitHub Issue #68
Diffstat (limited to 'node/NetworkConfig.cpp')
| -rw-r--r-- | node/NetworkConfig.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/node/NetworkConfig.cpp b/node/NetworkConfig.cpp index d4721a32..98a44557 100644 --- a/node/NetworkConfig.cpp +++ b/node/NetworkConfig.cpp @@ -86,6 +86,7 @@ void NetworkConfig::_fromDictionary(const Dictionary &d) _issuedTo = Address(d.get(ZT_NETWORKCONFIG_DICT_KEY_ISSUED_TO)); _multicastPrefixBits = Utils::hexStrToUInt(d.get(ZT_NETWORKCONFIG_DICT_KEY_MULTICAST_PREFIX_BITS,zero).c_str()); _multicastDepth = Utils::hexStrToUInt(d.get(ZT_NETWORKCONFIG_DICT_KEY_MULTICAST_DEPTH,zero).c_str()); + _bridgingMode = (BridgingMode)Utils::hexStrToUInt(d.get(ZT_NETWORKCONFIG_DICT_KEY_BRIDGING_MODE,zero).c_str()); _private = (Utils::hexStrToUInt(d.get(ZT_NETWORKCONFIG_DICT_KEY_PRIVATE,one).c_str()) != 0); _enableBroadcast = (Utils::hexStrToUInt(d.get(ZT_NETWORKCONFIG_DICT_KEY_ENABLE_BROADCAST,one).c_str()) != 0); _name = d.get(ZT_NETWORKCONFIG_DICT_KEY_NAME); @@ -121,6 +122,15 @@ void NetworkConfig::_fromDictionary(const Dictionary &d) _staticIps.insert(addr); } + std::vector<std::string> ab(Utils::split(d.get(ZT_NETWORKCONFIG_DICT_KEY_ACTIVE_BRIDGES,"").c_str(),",","","")); + for(std::vector<std::string>::const_iterator a(ab.begin());a!=ab.end();++a) { + if (a->length() == ZT_ADDRESS_LENGTH_HEX) { + Address tmp(*a); + if (!tmp.isReserved()) + _activeBridges.insert(tmp); + } + } + Dictionary mr(d.get(ZT_NETWORKCONFIG_DICT_KEY_MULTICAST_RATES,std::string())); for(Dictionary::const_iterator i(mr.begin());i!=mr.end();++i) { std::vector<std::string> params(Utils::split(i->second.c_str(),",","","")); |
