summaryrefslogtreecommitdiff
path: root/node/NetworkConfig.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2013-10-18 12:01:48 -0400
committerAdam Ierymenko <adam.ierymenko@gmail.com>2013-10-18 12:01:48 -0400
commit5a8f213c236936c9803485ff7f053b7923bd8722 (patch)
treed8ddd484d42814e01c68137b999f94134b04deab /node/NetworkConfig.cpp
parentb10871cedcdaa6f18779fcebcc889cdd35df546b (diff)
downloadinfinitytier-5a8f213c236936c9803485ff7f053b7923bd8722.tar.gz
infinitytier-5a8f213c236936c9803485ff7f053b7923bd8722.zip
Work in progress...
Diffstat (limited to 'node/NetworkConfig.cpp')
-rw-r--r--node/NetworkConfig.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/node/NetworkConfig.cpp b/node/NetworkConfig.cpp
index 6354bdb7..6a782800 100644
--- a/node/NetworkConfig.cpp
+++ b/node/NetworkConfig.cpp
@@ -70,6 +70,13 @@ void NetworkConfig::_fromDictionary(const Dictionary &d)
{
// NOTE: d.get(name) throws if not found, d.get(name,default) returns default
+ memset(_etWhitelist,0,sizeof(_etWhitelist));
+ std::vector<std::string> ets(Utils::split(d.get(ZT_NETWORKCONFIG_DICT_KEY_ALLOWED_ETHERNET_TYPES).c_str(),",","",""));
+ for(std::vector<std::string>::const_iterator et(ets.begin());et!=ets.end();++et) {
+ unsigned int tmp = Utils::hexStrToUInt(et->c_str()) & 0xffff;
+ _etWhitelist[tmp >> 3] |= (1 << (tmp & 7));
+ }
+
_nwid = Utils::hexStrToU64(d.get(ZT_NETWORKCONFIG_DICT_KEY_NETWORK_ID).c_str());
if (!_nwid)
throw std::invalid_argument("configuration contains zero network ID");