Bridging in NetworkConfig - GitHub Issue #68

This commit is contained in:
Adam Ierymenko 2014-06-10 15:47:20 -07:00
parent fb31f93c52
commit 4e1f49258b
4 changed files with 43 additions and 5 deletions

View file

@ -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(),",","",""));