Work on defining new direct broadcast multicast algorithm.

This commit is contained in:
Adam Ierymenko 2014-09-18 18:28:14 -07:00
parent d37c3ad30f
commit d9abd4d9be
13 changed files with 353 additions and 442 deletions

View file

@ -159,7 +159,7 @@ public:
inline std::set<MulticastGroup> 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<MAC,Address>::const_iterator br(_bridgeRoutes.find(mac));
if (br == _bridgeRoutes.end())
std::map<MAC,Address>::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<MulticastGroup> _multicastGroups;
std::set<MulticastGroup> _myMulticastGroups; // multicast groups that we belong to including those behind us (updated periodically)
std::map<MulticastGroup,uint64_t> _multicastGroupsBehindMe; // multicast groups bridged to us and when we last saw activity on each
std::map<MAC,Address> _remoteBridgeRoutes; // remote addresses where given MACs are reachable
// 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<Address,MulticastGroup>,BandwidthAccount > _multicastRateAccounts;
std::map<Address,CertificateOfMembership> _membershipCertificates;
std::map<Address,uint64_t> _lastPushedMembershipCertificate;
std::map<Address,CertificateOfMembership> _membershipCertificates; // Other members' certificates of membership
std::map<Address,uint64_t> _lastPushedMembershipCertificate; // When did we last push our certificate to each remote member?
std::map<MAC,Address> _bridgeRoutes; // remote addresses where given MACs are reachable
std::map<MulticastGroup,uint64_t> _bridgedMulticastGroups; // multicast groups of interest on our side of the bridge
SharedPtr<NetworkConfig> _config;
SharedPtr<NetworkConfig> _config; // Most recent network configuration, which is an immutable value-object
volatile uint64_t _lastConfigUpdate;
volatile bool _destroyed;