diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2014-09-24 13:45:58 -0700 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2014-09-24 13:45:58 -0700 |
| commit | 431476e2e4474c83013c2a1a6d80f1e815a2d37c (patch) | |
| tree | 2c1a6e2aabee108695d1f993e3085b0ed923f7e3 /node/MulticastTopology.cpp | |
| parent | 557801a09ef31c243add5f6d6de7a5f67af53ed2 (diff) | |
| download | infinitytier-431476e2e4474c83013c2a1a6d80f1e815a2d37c.tar.gz infinitytier-431476e2e4474c83013c2a1a6d80f1e815a2d37c.zip | |
Some more multicast algo work...
Diffstat (limited to 'node/MulticastTopology.cpp')
| -rw-r--r-- | node/MulticastTopology.cpp | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/node/MulticastTopology.cpp b/node/MulticastTopology.cpp index e4b1066d..1db1aa7a 100644 --- a/node/MulticastTopology.cpp +++ b/node/MulticastTopology.cpp @@ -41,19 +41,8 @@ MulticastTopology::~MulticastTopology() { } -void MulticastTopology::add(const MulticastGroup &mg,const Address &member,const Address &learnedFrom) +void MulticastTopology::add(const MulticastGroup &mg,const Address &learnedFrom,const Address &member) { - Mutex::Lock _l(_groups_m); - std::vector<MulticastGroupMember> &mv = _groups[mg].members; - for(std::vector<MulticastGroupMember>::iterator m(mv.begin());m!=mv.end();++m) { - if (m->address == member) { - if (m->learnedFrom) // once a member has been seen directly, we keep its status as direct - m->learnedFrom = learnedFrom; - m->timestamp = Utils::now(); - return; - } - } - mv.push_back(MulticastGroupMember(member,learnedFrom,Utils::now())); } void MulticastTopology::erase(const MulticastGroup &mg,const Address &member) @@ -72,6 +61,12 @@ void MulticastTopology::erase(const MulticastGroup &mg,const Address &member) } } +void send(uint64_t nwid,uint64_t now,const Address &self,const MulticastGroup &mg,const MAC &from,unsigned int etherType,const void *data,unsigned int len) +{ + Mutex::Lock _l(_groups_m); + std::map< MulticastGroup,MulticastGroupStatus >::iterator r(_groups.find(mg)); +} + unsigned int MulticastTopology::shouldGather(const MulticastGroup &mg,uint64_t now,unsigned int limit,bool updateLastGatheredTimeOnNonzeroReturn) { Mutex::Lock _l(_groups_m); |
