diff options
author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-03-21 06:31:15 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2017-03-21 06:31:15 -0700 |
commit | 52689090755c8535b4764d8991e9d9d5b3264c5e (patch) | |
tree | 8c89c482a91a4211206282a462e01c91a4d7aa9c /controller/EmbeddedNetworkController.hpp | |
parent | c62141fd9870eabf6f987da8e2a82ff5a999ddcf (diff) | |
download | infinitytier-52689090755c8535b4764d8991e9d9d5b3264c5e.tar.gz infinitytier-52689090755c8535b4764d8991e9d9d5b3264c5e.zip |
Add a facility for full flow-through uptime test of controller by Central.
Diffstat (limited to 'controller/EmbeddedNetworkController.hpp')
-rw-r--r-- | controller/EmbeddedNetworkController.hpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/controller/EmbeddedNetworkController.hpp b/controller/EmbeddedNetworkController.hpp index 5d2454ed..0ae2f3b5 100644 --- a/controller/EmbeddedNetworkController.hpp +++ b/controller/EmbeddedNetworkController.hpp @@ -98,9 +98,6 @@ public: throw(); private: - static void _circuitTestCallback(ZT_Node *node,ZT_CircuitTest *test,const ZT_CircuitTestReport *report); - void _request(uint64_t nwid,const InetAddress &fromAddr,uint64_t requestPacketId,const Identity &identity,const Dictionary<ZT_NETWORKCONFIG_METADATA_DICT_CAPACITY> &metaData); - struct _RQEntry { uint64_t nwid; @@ -109,11 +106,6 @@ private: Identity identity; Dictionary<ZT_NETWORKCONFIG_METADATA_DICT_CAPACITY> metaData; }; - BlockingQueue<_RQEntry *> _queue; - - Thread _threads[ZT_EMBEDDEDNETWORKCONTROLLER_BACKGROUND_THREAD_COUNT]; - bool _threadsStarted; - Mutex _threads_m; // Gathers a bunch of statistics about members of a network, IP assignments, etc. that we need in various places struct _NetworkMemberInfo @@ -127,12 +119,11 @@ private: uint64_t mostRecentDeauthTime; uint64_t nmiTimestamp; // time this NMI structure was computed }; - std::map<uint64_t,_NetworkMemberInfo> _nmiCache; - Mutex _nmiCache_m; + static void _circuitTestCallback(ZT_Node *node,ZT_CircuitTest *test,const ZT_CircuitTestReport *report); + void _request(uint64_t nwid,const InetAddress &fromAddr,uint64_t requestPacketId,const Identity &identity,const Dictionary<ZT_NETWORKCONFIG_METADATA_DICT_CAPACITY> &metaData); void _getNetworkMemberInfo(uint64_t now,uint64_t nwid,_NetworkMemberInfo &nmi); inline void _clearNetworkMemberInfoCache(const uint64_t nwid) { Mutex::Lock _l(_nmiCache_m); _nmiCache.erase(nwid); } - void _pushMemberUpdate(uint64_t now,uint64_t nwid,const nlohmann::json &member); // These init objects with default and static/informational fields @@ -188,6 +179,16 @@ private: member["clock"] = now; } + const uint64_t _startTime; + + BlockingQueue<_RQEntry *> _queue; + Thread _threads[ZT_EMBEDDEDNETWORKCONTROLLER_BACKGROUND_THREAD_COUNT]; + bool _threadsStarted; + Mutex _threads_m; + + std::map<uint64_t,_NetworkMemberInfo> _nmiCache; + Mutex _nmiCache_m; + JSONDB _db; Mutex _db_m; |