From 9e186bbd89966d417dd960eff65a1971a2640020 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Thu, 25 Sep 2014 15:57:43 -0700 Subject: . --- node/OutboundMulticast.hpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'node/OutboundMulticast.hpp') 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; } -- cgit v1.2.3