From 60fb28a90a5e7b01e58b2a93351658195651e8eb Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Tue, 6 Jan 2015 17:16:54 -0800 Subject: Cleanup, new C++ netconf code is almost ready to test! --- node/NetworkConfigMaster.hpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'node/NetworkConfigMaster.hpp') 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 @@ -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 &hdata); - bool _hmset(const char *key,const std::map &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; -- cgit v1.2.3