From bf5c07f79a0f78e714fe47a5d1e09330022261ea Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Sat, 3 Aug 2013 12:53:46 -0400 Subject: Scratch that... more work wiring up netconf. Got to handle OK. --- node/Network.hpp | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'node/Network.hpp') diff --git a/node/Network.hpp b/node/Network.hpp index 637c6664..4155d5d8 100644 --- a/node/Network.hpp +++ b/node/Network.hpp @@ -80,7 +80,7 @@ class Network : NonCopyable public: /** - * A certificate of network membership + * A certificate of network membership for private network participation */ class Certificate : private Dictionary { @@ -237,7 +237,10 @@ public: */ inline Certificate certificateOfMembership() const { - return Certificate(get("com","")); + const_iterator cm(find("com")); + if (cm == end()) + return Certificate(); + else return Certificate(cm->second); } /** @@ -322,6 +325,16 @@ public: */ inline Address controller() throw() { return Address(_id >> 24); } + /** + * @return Network ID in hexadecimal form + */ + inline std::string toString() + { + char buf[64]; + sprintf(buf,"%.16llx",(unsigned long long)_id); + return std::string(buf); + } + /** * @return True if network is open (no membership required) */ @@ -407,12 +420,16 @@ private: const RuntimeEnvironment *_r; EthernetTap _tap; + std::set _multicastGroups; std::map _membershipCertificates; + Config _configuration; Certificate _myCertificate; - uint64_t _lastConfigUpdate; + uint64_t _id; + volatile uint64_t _lastConfigUpdate; + Mutex _lock; AtomicCounter __refCount; -- cgit v1.2.3