Some cleanup, Multicaster now sends multicasts as it gets additional members.

This commit is contained in:
Adam Ierymenko 2014-10-01 14:05:25 -07:00
parent ae082c3cb8
commit e1882b614b
8 changed files with 76 additions and 27 deletions

View file

@ -32,12 +32,24 @@
namespace ZeroTier {
void OutboundMulticast::init(uint64_t timestamp,const Address &self,uint64_t nwid,const CertificateOfMembership *com,unsigned int gatherLimit,const MAC &src,const MulticastGroup &dest,unsigned int etherType,const void *payload,unsigned int len)
void OutboundMulticast::init(
uint64_t timestamp,
const Address &self,
uint64_t nwid,
const CertificateOfMembership *com,
unsigned int limit,
unsigned int gatherLimit,
const MAC &src,
const MulticastGroup &dest,
unsigned int etherType,
const void *payload,
unsigned int len)
{
_timestamp = timestamp;
_nwid = nwid;
_source = src;
_destination = dest;
_limit = limit;
_etherType = etherType;
_packet.setSource(self);
@ -46,7 +58,7 @@ void OutboundMulticast::init(uint64_t timestamp,const Address &self,uint64_t nwi
self.appendTo(_packet);
_packet.append((uint64_t)nwid);
_packet.append((uint8_t)((com) ? 0x01 : 0x00));
_packet.append((uint32_t)gatherLimit); // gather limit -- set before send, start with 0
_packet.append((uint32_t)gatherLimit);
if (com) com->serialize(_packet);
_packet.append((uint32_t)dest.adi());
dest.mac().appendTo(_packet);