diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-01-09 18:25:41 -0500 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-01-09 18:25:41 -0500 |
| commit | c8c5d3b06e241ca0817eeddb7b484bdc5927f828 (patch) | |
| tree | 998516b4f680ee18ddf89fcfb220b123c284ef07 /node/Node.cpp | |
| parent | 0b84c10ccc8db26151b25f38869bb462656495d2 (diff) | |
| download | infinitytier-c8c5d3b06e241ca0817eeddb7b484bdc5927f828.tar.gz infinitytier-c8c5d3b06e241ca0817eeddb7b484bdc5927f828.zip | |
Create netconf master if redis options are in local.conf.
Diffstat (limited to 'node/Node.cpp')
| -rw-r--r-- | node/Node.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/node/Node.cpp b/node/Node.cpp index d65e4e39..b9f027e3 100644 --- a/node/Node.cpp +++ b/node/Node.cpp @@ -310,6 +310,21 @@ Node::ReasonForTermination Node::run() } RR->node = this; +#ifdef ZT_ENABLE_NETCONF_MASTER + { + std::string redisHost(RR->nc->getLocalConfig(ZT_LOCAL_CONFIG_NETCONF_REDIS_HOST)); + if (redisHost.length() > 0) { + unsigned int redisPort = Utils::strToUInt(RR->nc->getLocalConfig(ZT_LOCAL_CONFIG_NETCONF_REDIS_PORT).c_str()); + if ((redisPort == 0)||(redisPort > 0xffff)) + redisPort = ZT_LOCAL_CONFIG_NETCONF_REDIS_PORT_DEFAULT; + std::string redisAuth(RR->nc->getLocalConfig(ZT_LOCAL_CONFIG_NETCONF_REDIS_AUTH)); + std::string redisDatabaseNumberStr(RR->nc->getLocalConfig(ZT_LOCAL_CONFIG_NETCONF_REDIS_DBNUM)); + unsigned int redisDatabaseNumber = (redisDatabaseNumberStr.length() > 0) ? Utils::strToUInt(redisDatabaseNumberStr.c_str()) : (unsigned int)ZT_LOCAL_CONFIG_NETCONF_REDIS_DBNUM_DEFAULT; + RR->netconfMaster = new NetworkConfigMaster(RR,redisHost.c_str(),redisPort,redisAuth.c_str(),redisDatabaseNumber); + } + } +#endif + #ifdef ZT_AUTO_UPDATE if (ZT_DEFAULTS.updateLatestNfoURL.length()) { RR->updater = new SoftwareUpdater(RR); |
