summaryrefslogtreecommitdiff
path: root/node/Network.hpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2013-08-03 12:53:46 -0400
committerAdam Ierymenko <adam.ierymenko@gmail.com>2013-08-03 12:53:46 -0400
commitbf5c07f79a0f78e714fe47a5d1e09330022261ea (patch)
tree99b41a9e4f006a2ae742fb1d6eb66e0be2a19742 /node/Network.hpp
parent63fa4a684d15409e185422e7641e7c4680d19ec3 (diff)
downloadinfinitytier-bf5c07f79a0f78e714fe47a5d1e09330022261ea.tar.gz
infinitytier-bf5c07f79a0f78e714fe47a5d1e09330022261ea.zip
Scratch that... more work wiring up netconf. Got to handle OK.
Diffstat (limited to 'node/Network.hpp')
-rw-r--r--node/Network.hpp23
1 files changed, 20 insertions, 3 deletions
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);
}
/**
@@ -323,6 +326,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)
*/
inline bool isOpen() const
@@ -407,12 +420,16 @@ private:
const RuntimeEnvironment *_r;
EthernetTap _tap;
+
std::set<MulticastGroup> _multicastGroups;
std::map<Address,Certificate> _membershipCertificates;
+
Config _configuration;
Certificate _myCertificate;
- uint64_t _lastConfigUpdate;
+
uint64_t _id;
+ volatile uint64_t _lastConfigUpdate;
+
Mutex _lock;
AtomicCounter __refCount;