mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-14 02:27:38 -07:00
Prep for real tests like alltoall.
This commit is contained in:
parent
a75a7547b4
commit
8672ca9cf8
4 changed files with 40 additions and 14 deletions
|
@ -42,8 +42,6 @@
|
|||
|
||||
namespace ZeroTier {
|
||||
|
||||
static Mutex printLock;
|
||||
|
||||
TestEthernetTap::TestEthernetTap(
|
||||
TestEthernetTapFactory *parent,
|
||||
const MAC &mac,
|
||||
|
@ -55,6 +53,7 @@ TestEthernetTap::TestEthernetTap(
|
|||
void (*handler)(void *,const MAC &,const MAC &,unsigned int,const Buffer<4096> &),
|
||||
void *arg) :
|
||||
EthernetTap("TestEthernetTap",mac,mtu,metric),
|
||||
_nwid(nwid),
|
||||
_parent(parent),
|
||||
_handler(handler),
|
||||
_arg(arg),
|
||||
|
@ -114,9 +113,8 @@ std::set<InetAddress> TestEthernetTap::ips() const
|
|||
|
||||
void TestEthernetTap::put(const MAC &from,const MAC &to,unsigned int etherType,const void *data,unsigned int len)
|
||||
{
|
||||
Mutex::Lock _l(printLock);
|
||||
fprintf(stdout,"[%s] %s << %s %.4x %s"ZT_EOL_S,_dev.c_str(),to.toString().c_str(),from.toString().c_str(),etherType,std::string((const char *)data,len).c_str());
|
||||
fflush(stdout);
|
||||
Mutex::Lock _l(_gq_m);
|
||||
_gq.push_back(TestFrame(from,to,data,etherType,len));
|
||||
}
|
||||
|
||||
std::string TestEthernetTap::deviceName() const
|
||||
|
@ -144,12 +142,6 @@ bool TestEthernetTap::injectPacketFromHost(const MAC &from,const MAC &to,unsigne
|
|||
}
|
||||
_pq_c.signal();
|
||||
|
||||
{
|
||||
Mutex::Lock _l(printLock);
|
||||
fprintf(stdout,"[%s] %s >> %s %.4x %s"ZT_EOL_S,_dev.c_str(),from.toString().c_str(),to.toString().c_str(),etherType,std::string((const char *)data,len).c_str());
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue