Some more multicast algo work...

This commit is contained in:
Adam Ierymenko 2014-09-24 13:45:58 -07:00
parent 557801a09e
commit 431476e2e4
6 changed files with 165 additions and 133 deletions

View file

@ -50,6 +50,13 @@ namespace ZeroTier {
class OutboundMulticast
{
public:
/**
* Create an uninitialized outbound multicast
*
* It must be initialized with init().
*/
OutboundMulticast() {}
/**
* Initialize outbound multicast
*
@ -63,13 +70,13 @@ public:
* @param len Length of data
* @throws std::out_of_range Data too large to fit in a MULTICAST_FRAME
*/
OutboundMulticast(uint64_t timestamp,const Address &self,uint64_t nwid,const MAC &src,const MulticastGroup &dest,unsigned int etherType,const void *payload,unsigned int len) :
_timestamp(timestamp),
_nwid(nwid),
_source(src),
_destination(dest),
_etherType(etherType)
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)
{
_timestamp = timestamp;
_nwid = nwid;
_source = src;
_destination = dest;
_etherType = etherType;
_packet.setSource(self);
_packet.setVerb(Packet::VERB_MULTICAST_FRAME);
_packet.append((char)0);