diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-08-09 13:14:38 -0700 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2016-08-09 13:14:38 -0700 |
| commit | 4d498b3765695f1b82a2448f0e8efe698b33667d (patch) | |
| tree | 191eb30f716498587808d1789e73d744137b1577 /node/Network.hpp | |
| parent | bcd05fbdfa7e340ef4df962773bb7c32cf5013c2 (diff) | |
| download | infinitytier-4d498b3765695f1b82a2448f0e8efe698b33667d.tar.gz infinitytier-4d498b3765695f1b82a2448f0e8efe698b33667d.zip | |
Handling of multi-part chunked network configs on the inbound side.
Diffstat (limited to 'node/Network.hpp')
| -rw-r--r-- | node/Network.hpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/node/Network.hpp b/node/Network.hpp index 16f07163..d13918cf 100644 --- a/node/Network.hpp +++ b/node/Network.hpp @@ -215,6 +215,21 @@ public: int setConfiguration(const NetworkConfig &nconf,bool saveToDisk); /** + * Handle an inbound network config chunk + * + * Only chunks whose inRePacketId matches the packet ID of the last request + * are handled. If this chunk completes the config, it is decoded and + * setConfiguration() is called. + * + * @param inRePacketId In-re packet ID from OK(NETWORK_CONFIG_REQUEST) + * @param data Chunk data + * @param chunkSize Size of data[] + * @param chunkIndex Index of chunk in full config + * @param totalSize Total size of network config + */ + void handleInboundConfigChunk(const uint64_t inRePacketId,const void *data,unsigned int chunkSize,unsigned int chunkIndex,unsigned int totalSize); + + /** * Set netconf failure to 'access denied' -- called in IncomingPacket when controller reports this */ inline void setAccessDenied() @@ -411,6 +426,9 @@ private: Hashtable< MulticastGroup,uint64_t > _multicastGroupsBehindMe; // multicast groups that seem to be behind us and when we last saw them (if we are a bridge) Hashtable< MAC,Address > _remoteBridgeRoutes; // remote addresses where given MACs are reachable (for tracking devices behind remote bridges) + uint64_t _inboundConfigPacketId; + std::map<unsigned int,std::string> _inboundConfigChunks; + NetworkConfig _config; volatile uint64_t _lastConfigUpdate; |
