diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-01-06 17:16:54 -0800 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-01-06 17:16:54 -0800 |
| commit | 60fb28a90a5e7b01e58b2a93351658195651e8eb (patch) | |
| tree | 1ec74eb3ea942c3f0272363c50dffc3a07561bfe /node/NetworkConfigMaster.hpp | |
| parent | a369c690910d014ca79b55d07603af45343b37f5 (diff) | |
| download | infinitytier-60fb28a90a5e7b01e58b2a93351658195651e8eb.tar.gz infinitytier-60fb28a90a5e7b01e58b2a93351658195651e8eb.zip | |
Cleanup, new C++ netconf code is almost ready to test!
Diffstat (limited to 'node/NetworkConfigMaster.hpp')
| -rw-r--r-- | node/NetworkConfigMaster.hpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/node/NetworkConfigMaster.hpp b/node/NetworkConfigMaster.hpp index 636b197e..29aada27 100644 --- a/node/NetworkConfigMaster.hpp +++ b/node/NetworkConfigMaster.hpp @@ -41,6 +41,7 @@ #include "Address.hpp" #include "Dictionary.hpp" #include "Mutex.hpp" +#include "InetAddress.hpp" #include <hiredis/hiredis.h> @@ -82,15 +83,17 @@ public: * This is a blocking call, so rate is limited by Redis. It will fail * and log its failure if the Redis server is not available or times out. * + * @param fromAddr Originating IP address * @param packetId 64-bit packet ID - * @param from Originating peer ZeroTier address + * @param member Originating peer ZeroTier address * @param nwid 64-bit network ID * @param metaData Meta-data bundled with request (empty if none) * @param haveTimestamp Timestamp requesting peer has or 0 if none or not included */ void doNetworkConfigRequest( + const InetAddress &fromAddr, uint64_t packetId, - const Address &from, + const Address &member, uint64_t nwid, const Dictionary &metaData, uint64_t haveTimestamp); @@ -98,11 +101,14 @@ public: private: // These assume _lock is locked bool _reconnect(); - bool _hgetall(const char *key,std::map<std::string,std::string> &hdata); - bool _hmset(const char *key,const std::map<std::string,std::string> &hdata); + bool _hgetall(const char *key,Dictionary &hdata); + bool _hmset(const char *key,const Dictionary &hdata); bool _hget(const char *key,const char *hashKey,std::string &value); bool _hset(const char *key,const char *hashKey,const char *value); + bool _initNewMember(uint64_t nwid,const Address &member,const Dictionary &metaData,Dictionary &memberRecord); + bool _generateNetconf(uint64_t nwid,const Address &member,const Dictionary &metaData,std::string &netconf,uint64_t &ts); + Mutex _lock; std::string _redisHost; |
