summaryrefslogtreecommitdiff
path: root/node/OutboundMulticast.hpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2014-09-25 15:57:43 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2014-09-25 15:57:43 -0700
commit9e186bbd89966d417dd960eff65a1971a2640020 (patch)
treebc912bbc01d291e3563f17fb311c421d243c1930 /node/OutboundMulticast.hpp
parent050a0ce85dd548550001188a3c4d45d3163dff1d (diff)
downloadinfinitytier-9e186bbd89966d417dd960eff65a1971a2640020.tar.gz
infinitytier-9e186bbd89966d417dd960eff65a1971a2640020.zip
.
Diffstat (limited to 'node/OutboundMulticast.hpp')
-rw-r--r--node/OutboundMulticast.hpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/node/OutboundMulticast.hpp b/node/OutboundMulticast.hpp
index 8e71b6ad..9ce59bbf 100644
--- a/node/OutboundMulticast.hpp
+++ b/node/OutboundMulticast.hpp
@@ -63,6 +63,7 @@ public:
* @param timestamp Creation time
* @param self My ZeroTier address
* @param nwid Network ID
+ * @param gatherLimit Number to lazily/implicitly gather with this frame or 0 for none
* @param src Source MAC address of frame
* @param dest Destination multicast group (MAC + ADI)
* @param etherType 16-bit Ethernet type ID
@@ -70,7 +71,7 @@ public:
* @param len Length of data
* @throws std::out_of_range Data too large to fit in a MULTICAST_FRAME
*/
- inline void init(uint64_t timestamp,const Address &self,uint64_t nwid,const MAC &src,const MulticastGroup &dest,unsigned int etherType,const void *payload,unsigned int len)
+ inline void init(uint64_t timestamp,const Address &self,uint64_t nwid,unsigned int gatherLimit,const MAC &src,const MulticastGroup &dest,unsigned int etherType,const void *payload,unsigned int len)
{
_timestamp = timestamp;
_nwid = nwid;
@@ -79,7 +80,9 @@ public:
_etherType = etherType;
_packet.setSource(self);
_packet.setVerb(Packet::VERB_MULTICAST_FRAME);
- _packet.append((char)0);
+ _packet.append((uint64_t)nwid);
+ _packet.append((char)0); // 0 flags
+ _packet.append((uint32_t)gatherLimit); // gather limit -- set before send, start with 0
_packet.append((uint32_t)dest.adi());
dest.mac().appendTo(_packet);
src.appendTo(_packet);
@@ -124,7 +127,7 @@ public:
inline void sendAndLog(Switch &sw,const Address &toAddr)
{
_alreadySentTo.push_back(toAddr);
- sendOnly(sw,toAddr);
+ sendOnly(sw,toAddr,gatherLimit);
}
/**
@@ -140,7 +143,7 @@ public:
if (*a == toAddr)
return false;
}
- sendAndLog(sw,toAddr);
+ sendAndLog(sw,toAddr,gatherLimit);
return true;
}