summaryrefslogtreecommitdiff
path: root/node/Multicaster.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2015-07-07 11:49:38 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2015-07-07 11:49:38 -0700
commit412389ec755528108e0254e75a9cf43fc53e331a (patch)
treeb709372474eeb9ddb959884d72b551cba34674c3 /node/Multicaster.cpp
parentcf6f30963cdf6de47342e6724ebd7f8e8058ad43 (diff)
downloadinfinitytier-412389ec755528108e0254e75a9cf43fc53e331a.tar.gz
infinitytier-412389ec755528108e0254e75a9cf43fc53e331a.zip
Implement ERROR_UNWATNED_MULTICAST
Diffstat (limited to 'node/Multicaster.cpp')
-rw-r--r--node/Multicaster.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/node/Multicaster.cpp b/node/Multicaster.cpp
index 3c105236..33424e4a 100644
--- a/node/Multicaster.cpp
+++ b/node/Multicaster.cpp
@@ -61,6 +61,20 @@ void Multicaster::addMultiple(uint64_t now,uint64_t nwid,const MulticastGroup &m
}
}
+void Multicaster::remove(uint64_t nwid,const MulticastGroup &mg,const Address &member)
+{
+ Mutex::Lock _l(_groups_m);
+ std::map< std::pair<uint64_t,MulticastGroup>,MulticastGroupStatus >::iterator g(_groups.find(std::pair<uint64_t,MulticastGroup>(nwid,mg)));
+ if (g != _groups.end()) {
+ for(std::vector<MulticastGroupMember>::iterator m(g->second.members.begin());m!=g->second.members.end();++m) {
+ if (m->address == member) {
+ g->second.members.erase(m);
+ break;
+ }
+ }
+ }
+}
+
unsigned int Multicaster::gather(const Address &queryingPeer,uint64_t nwid,const MulticastGroup &mg,Packet &appendTo,unsigned int limit) const
{
unsigned char *p;