added camouflaging functionality and instrumentation
This commit is contained in:
parent
cdaf5e5468
commit
083b833bf8
16 changed files with 904 additions and 43 deletions
|
@ -23,6 +23,7 @@
|
|||
#include "RingBuffer.hpp"
|
||||
#include "Utils.hpp"
|
||||
#include "Metrics.hpp"
|
||||
#include "Buffer.hpp"
|
||||
|
||||
namespace ZeroTier {
|
||||
|
||||
|
@ -247,6 +248,7 @@ void Peer::received(
|
|||
outp->compress();
|
||||
outp->armor(_key,true,aesKeysIfSupported());
|
||||
Metrics::pkt_push_direct_paths_out++;
|
||||
CT("UNPROCESSED, packetId: %lx", outp->packetId());
|
||||
path->send(RR,tPtr,outp->data(),outp->size(),now);
|
||||
}
|
||||
delete outp;
|
||||
|
@ -393,6 +395,7 @@ void Peer::introduce(void *const tPtr,const int64_t now,const SharedPtr<Peer> &o
|
|||
}
|
||||
outp.armor(_key,true,aesKeysIfSupported());
|
||||
Metrics::pkt_rendezvous_out++;
|
||||
CT("UNPROCESSED");
|
||||
_paths[mine].p->send(RR,tPtr,outp.data(),outp.size(),now);
|
||||
} else {
|
||||
Packet outp(other->_id.address(),RR->identity.address(),Packet::VERB_RENDEZVOUS);
|
||||
|
@ -408,6 +411,7 @@ void Peer::introduce(void *const tPtr,const int64_t now,const SharedPtr<Peer> &o
|
|||
}
|
||||
outp.armor(other->_key,true,other->aesKeysIfSupported());
|
||||
Metrics::pkt_rendezvous_out++;
|
||||
CT("UNPROCESSED");
|
||||
other->_paths[theirs].p->send(RR,tPtr,outp.data(),outp.size(),now);
|
||||
}
|
||||
++alt;
|
||||
|
@ -456,6 +460,7 @@ void Peer::sendHELLO(void *tPtr,const int64_t localSocket,const InetAddress &atA
|
|||
RR->node->putPacket(tPtr,RR->node->lowBandwidthModeEnabled() ? localSocket : -1,atAddress,outp.data(),outp.size());
|
||||
} else {
|
||||
RR->node->expectReplyTo(outp.packetId());
|
||||
CT("UNPROCESSED");
|
||||
RR->sw->send(tPtr,outp,false); // false == don't encrypt full payload, but add MAC
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue