mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-07-05 20:41:44 -07:00
clang-format
This commit is contained in:
parent
d45f280cb7
commit
ba2a4a605c
140 changed files with 19214 additions and 17403 deletions
|
@ -11,28 +11,29 @@
|
|||
*/
|
||||
/****/
|
||||
|
||||
#include "Constants.hpp"
|
||||
#include "RuntimeEnvironment.hpp"
|
||||
#include "OutboundMulticast.hpp"
|
||||
#include "Switch.hpp"
|
||||
|
||||
#include "Constants.hpp"
|
||||
#include "Network.hpp"
|
||||
#include "Node.hpp"
|
||||
#include "Peer.hpp"
|
||||
#include "RuntimeEnvironment.hpp"
|
||||
#include "Switch.hpp"
|
||||
#include "Topology.hpp"
|
||||
|
||||
namespace ZeroTier {
|
||||
|
||||
void OutboundMulticast::init(
|
||||
const RuntimeEnvironment *RR,
|
||||
const RuntimeEnvironment* RR,
|
||||
uint64_t timestamp,
|
||||
uint64_t nwid,
|
||||
bool disableCompression,
|
||||
unsigned int limit,
|
||||
unsigned int gatherLimit,
|
||||
const MAC &src,
|
||||
const MulticastGroup &dest,
|
||||
const MAC& src,
|
||||
const MulticastGroup& dest,
|
||||
unsigned int etherType,
|
||||
const void *payload,
|
||||
const void* payload,
|
||||
unsigned int len)
|
||||
{
|
||||
uint8_t flags = 0;
|
||||
|
@ -42,8 +43,9 @@ void OutboundMulticast::init(
|
|||
if (src) {
|
||||
_macSrc = src;
|
||||
flags |= 0x04;
|
||||
} else {
|
||||
_macSrc.fromAddress(RR->identity.address(),nwid);
|
||||
}
|
||||
else {
|
||||
_macSrc.fromAddress(RR->identity.address(), nwid);
|
||||
}
|
||||
_macDest = dest.mac();
|
||||
_limit = limit;
|
||||
|
@ -67,26 +69,26 @@ void OutboundMulticast::init(
|
|||
dest.mac().appendTo(_packet);
|
||||
_packet.append((uint32_t)dest.adi());
|
||||
_packet.append((uint16_t)etherType);
|
||||
_packet.append(payload,_frameLen);
|
||||
if (!disableCompression) {
|
||||
_packet.append(payload, _frameLen);
|
||||
if (! disableCompression) {
|
||||
_packet.compress();
|
||||
}
|
||||
|
||||
memcpy(_frameData,payload,_frameLen);
|
||||
memcpy(_frameData, payload, _frameLen);
|
||||
}
|
||||
|
||||
void OutboundMulticast::sendOnly(const RuntimeEnvironment *RR,void *tPtr,const Address &toAddr)
|
||||
void OutboundMulticast::sendOnly(const RuntimeEnvironment* RR, void* tPtr, const Address& toAddr)
|
||||
{
|
||||
const SharedPtr<Network> nw(RR->node->network(_nwid));
|
||||
uint8_t QoSBucket = 255; // Dummy value
|
||||
if ((nw)&&(nw->filterOutgoingPacket(tPtr,true,RR->identity.address(),toAddr,_macSrc,_macDest,_frameData,_frameLen,_etherType,0,QoSBucket))) {
|
||||
nw->pushCredentialsIfNeeded(tPtr,toAddr,RR->node->now());
|
||||
uint8_t QoSBucket = 255; // Dummy value
|
||||
if ((nw) && (nw->filterOutgoingPacket(tPtr, true, RR->identity.address(), toAddr, _macSrc, _macDest, _frameData, _frameLen, _etherType, 0, QoSBucket))) {
|
||||
nw->pushCredentialsIfNeeded(tPtr, toAddr, RR->node->now());
|
||||
_packet.newInitializationVector();
|
||||
_packet.setDestination(toAddr);
|
||||
RR->node->expectReplyTo(_packet.packetId());
|
||||
_tmp = _packet;
|
||||
RR->sw->send(tPtr,_tmp,true);
|
||||
RR->sw->send(tPtr, _tmp, true);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace ZeroTier
|
||||
} // namespace ZeroTier
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue