From d9abd4d9be7b160b531a995a20c91d430768fc72 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Thu, 18 Sep 2014 18:28:14 -0700 Subject: Work on defining new direct broadcast multicast algorithm. --- node/Network.hpp | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'node/Network.hpp') diff --git a/node/Network.hpp b/node/Network.hpp index a24f161c..33c3226c 100644 --- a/node/Network.hpp +++ b/node/Network.hpp @@ -159,7 +159,7 @@ public: inline std::set multicastGroups() const { Mutex::Lock _l(_lock); - return _multicastGroups; + return _myMulticastGroups; } /** @@ -378,8 +378,8 @@ public: inline Address findBridgeTo(const MAC &mac) const { Mutex::Lock _l(_lock); - std::map::const_iterator br(_bridgeRoutes.find(mac)); - if (br == _bridgeRoutes.end()) + std::map::const_iterator br(_remoteBridgeRoutes.find(mac)); + if (br == _remoteBridgeRoutes.end()) return Address(); return br->second; } @@ -401,7 +401,7 @@ public: inline void learnBridgedMulticastGroup(const MulticastGroup &mg,uint64_t now) { Mutex::Lock _l(_lock); - _bridgedMulticastGroups[mg] = now; + _multicastGroupsBehindMe[mg] = now; } /** @@ -445,16 +445,20 @@ private: EthernetTap *volatile _tap; // tap device or NULL if not initialized yet volatile bool _enabled; - std::set _multicastGroups; - std::map< std::pair,BandwidthAccount > _multicastRateAccounts; + std::set _myMulticastGroups; // multicast groups that we belong to including those behind us (updated periodically) + std::map _multicastGroupsBehindMe; // multicast groups bridged to us and when we last saw activity on each + + std::map _remoteBridgeRoutes; // remote addresses where given MACs are reachable - std::map _membershipCertificates; - std::map _lastPushedMembershipCertificate; + // Deprecated, but will be kept around until P5_MULTICAST_FRAME is gone -- but the + // entry for us is still used by both. Eventually there will only be one BandwidthAccount, + // namely ours. + std::map< std::pair,BandwidthAccount > _multicastRateAccounts; - std::map _bridgeRoutes; // remote addresses where given MACs are reachable - std::map _bridgedMulticastGroups; // multicast groups of interest on our side of the bridge + std::map _membershipCertificates; // Other members' certificates of membership + std::map _lastPushedMembershipCertificate; // When did we last push our certificate to each remote member? - SharedPtr _config; + SharedPtr _config; // Most recent network configuration, which is an immutable value-object volatile uint64_t _lastConfigUpdate; volatile bool _destroyed; -- cgit v1.2.3