mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-06 12:33:44 +02:00
Windows build fixes.
This commit is contained in:
parent
2eeb3dee9e
commit
74f36f5dc0
9 changed files with 163 additions and 83 deletions
|
@ -33,6 +33,14 @@
|
||||||
#include "IpcListener.hpp"
|
#include "IpcListener.hpp"
|
||||||
#include "NodeControlService.hpp"
|
#include "NodeControlService.hpp"
|
||||||
|
|
||||||
|
#ifdef __WINDOWS__
|
||||||
|
#include <WinSock2.h>
|
||||||
|
#include <Windows.h>
|
||||||
|
#include <tchar.h>
|
||||||
|
#include <wchar.h>
|
||||||
|
#include <ShlObj.h>
|
||||||
|
#endif // __WINDOWS__
|
||||||
|
|
||||||
namespace ZeroTier {
|
namespace ZeroTier {
|
||||||
|
|
||||||
struct _NodeControlClientImpl
|
struct _NodeControlClientImpl
|
||||||
|
|
|
@ -154,16 +154,16 @@ void NodeControlService::_doCommand(IpcConnection *ipcc,const char *commandLine)
|
||||||
default:
|
default:
|
||||||
ipcc->printf("unknown;");
|
ipcc->printf("unknown;");
|
||||||
break;
|
break;
|
||||||
case ZT1_Node_PhysicalPath::ZT1_Node_PhysicalPath_TYPE_UDP:
|
case ZT1_Node_PhysicalPathType::ZT1_Node_PhysicalPath_TYPE_UDP:
|
||||||
ipcc->printf("udp;");
|
ipcc->printf("udp;");
|
||||||
break;
|
break;
|
||||||
case ZT1_Node_PhysicalPath::ZT1_Node_PhysicalPath_TYPE_TCP_OUT:
|
case ZT1_Node_PhysicalPathType::ZT1_Node_PhysicalPath_TYPE_TCP_OUT:
|
||||||
ipcc->printf("tcp_out;");
|
ipcc->printf("tcp_out;");
|
||||||
break;
|
break;
|
||||||
case ZT1_Node_PhysicalPath::ZT1_Node_PhysicalPath_TYPE_TCP_IN:
|
case ZT1_Node_PhysicalPathType::ZT1_Node_PhysicalPath_TYPE_TCP_IN:
|
||||||
ipcc->printf("tcp_in;");
|
ipcc->printf("tcp_in;");
|
||||||
break;
|
break;
|
||||||
case ZT1_Node_PhysicalPath::ZT1_Node_PhysicalPath_TYPE_ETHERNET:
|
case ZT1_Node_PhysicalPathType::ZT1_Node_PhysicalPath_TYPE_ETHERNET:
|
||||||
ipcc->printf("eth;");
|
ipcc->printf("eth;");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -178,9 +178,9 @@ void NodeControlService::_doCommand(IpcConnection *ipcc,const char *commandLine)
|
||||||
}
|
}
|
||||||
const char *rolestr;
|
const char *rolestr;
|
||||||
switch(pl->peers[i].role) {
|
switch(pl->peers[i].role) {
|
||||||
case ZT1_Node_Peer::ZT1_Node_Peer_SUPERNODE: rolestr = "SUPERNODE"; break;
|
case ZT1_Node_PeerRole::ZT1_Node_Peer_SUPERNODE: rolestr = "SUPERNODE"; break;
|
||||||
case ZT1_Node_Peer::ZT1_Node_Peer_HUB: rolestr = "HUB"; break;
|
case ZT1_Node_PeerRole::ZT1_Node_Peer_HUB: rolestr = "HUB"; break;
|
||||||
case ZT1_Node_Peer::ZT1_Node_Peer_NODE: rolestr = "NODE"; break;
|
case ZT1_Node_PeerRole::ZT1_Node_Peer_NODE: rolestr = "NODE"; break;
|
||||||
default: rolestr = "?"; break;
|
default: rolestr = "?"; break;
|
||||||
}
|
}
|
||||||
ipcc->printf(" %u %s %s"ZT_EOL_S,
|
ipcc->printf(" %u %s %s"ZT_EOL_S,
|
||||||
|
@ -249,7 +249,7 @@ void NodeControlService::_doCommand(IpcConnection *ipcc,const char *commandLine)
|
||||||
to.fromString(cmd[3].c_str());
|
to.fromString(cmd[3].c_str());
|
||||||
from.copyTo(from2,6);
|
from.copyTo(from2,6);
|
||||||
to.copyTo(to2,6);
|
to.copyTo(to2,6);
|
||||||
if (_node->injectPacketFromHost(Utils::hexStrToU64(cmd[1].c_str()),from2,to2,Utils::hexStrToUInt(cmd[4].c_str()),cmd[5].c_str(),cmd[5].length()+1)) {
|
if (_node->injectPacketFromHost(Utils::hexStrToU64(cmd[1].c_str()),from2,to2,Utils::hexStrToUInt(cmd[4].c_str()),cmd[5].c_str(),(unsigned int)cmd[5].length()+1)) {
|
||||||
ipcc->printf("200 OK"ZT_EOL_S);
|
ipcc->printf("200 OK"ZT_EOL_S);
|
||||||
} else {
|
} else {
|
||||||
ipcc->printf("500 inject failed or not supported by this tap device"ZT_EOL_S);
|
ipcc->printf("500 inject failed or not supported by this tap device"ZT_EOL_S);
|
||||||
|
|
|
@ -95,6 +95,16 @@ struct ZT1_Node_Status
|
||||||
bool running;
|
bool running;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Physical address type
|
||||||
|
*/
|
||||||
|
enum ZT1_Node_PhysicalAddressType {
|
||||||
|
ZT1_Node_PhysicalAddress_TYPE_NULL = 0, /* none/invalid */
|
||||||
|
ZT1_Node_PhysicalAddress_TYPE_IPV4 = 1, /* 32-bit IPv4 address (and port) */
|
||||||
|
ZT1_Node_PhysicalAddress_TYPE_IPV6 = 2, /* 128-bit IPv6 address (and port) */
|
||||||
|
ZT1_Node_PhysicalAddress_TYPE_ETHERNET = 3 /* 48-bit Ethernet MAC address */
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Physical address result buffer
|
* Physical address result buffer
|
||||||
*/
|
*/
|
||||||
|
@ -103,12 +113,7 @@ struct ZT1_Node_PhysicalAddress
|
||||||
/**
|
/**
|
||||||
* Physical address type
|
* Physical address type
|
||||||
*/
|
*/
|
||||||
enum {
|
enum ZT1_Node_PhysicalAddressType type;
|
||||||
ZT1_Node_PhysicalAddress_TYPE_NULL = 0, /* none/invalid */
|
|
||||||
ZT1_Node_PhysicalAddress_TYPE_IPV4 = 1, /* 32-bit IPv4 address (and port) */
|
|
||||||
ZT1_Node_PhysicalAddress_TYPE_IPV6 = 2, /* 128-bit IPv6 address (and port) */
|
|
||||||
ZT1_Node_PhysicalAddress_TYPE_ETHERNET = 3 /* 48-bit Ethernet MAC address */
|
|
||||||
} type;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Address in raw binary form -- length depends on type
|
* Address in raw binary form -- length depends on type
|
||||||
|
@ -131,6 +136,17 @@ struct ZT1_Node_PhysicalAddress
|
||||||
char zoneIndex[16];
|
char zoneIndex[16];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Physical path type
|
||||||
|
*/
|
||||||
|
enum ZT1_Node_PhysicalPathType { /* These must be numerically the same as type in Path.hpp */
|
||||||
|
ZT1_Node_PhysicalPath_TYPE_NULL = 0, /* none/invalid */
|
||||||
|
ZT1_Node_PhysicalPath_TYPE_UDP = 1, /* UDP association */
|
||||||
|
ZT1_Node_PhysicalPath_TYPE_TCP_OUT = 2, /* outgoing TCP tunnel using pseudo-SSL */
|
||||||
|
ZT1_Node_PhysicalPath_TYPE_TCP_IN = 3, /* incoming TCP tunnel using pseudo-SSL */
|
||||||
|
ZT1_Node_PhysicalPath_TYPE_ETHERNET = 4 /* raw ethernet frames over trusted backplane */
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Network path result buffer
|
* Network path result buffer
|
||||||
*/
|
*/
|
||||||
|
@ -139,13 +155,7 @@ struct ZT1_Node_PhysicalPath
|
||||||
/**
|
/**
|
||||||
* Physical path type
|
* Physical path type
|
||||||
*/
|
*/
|
||||||
enum { /* These must be numerically the same as type in Path.hpp */
|
enum ZT1_Node_PhysicalPathType type;
|
||||||
ZT1_Node_PhysicalPath_TYPE_NULL = 0, /* none/invalid */
|
|
||||||
ZT1_Node_PhysicalPath_TYPE_UDP = 1, /* UDP association */
|
|
||||||
ZT1_Node_PhysicalPath_TYPE_TCP_OUT = 2, /* outgoing TCP tunnel using pseudo-SSL */
|
|
||||||
ZT1_Node_PhysicalPath_TYPE_TCP_IN = 3, /* incoming TCP tunnel using pseudo-SSL */
|
|
||||||
ZT1_Node_PhysicalPath_TYPE_ETHERNET = 4 /* raw ethernet frames over trusted backplane */
|
|
||||||
} type;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Physical address of endpoint
|
* Physical address of endpoint
|
||||||
|
@ -178,6 +188,15 @@ struct ZT1_Node_PhysicalPath
|
||||||
bool fixed;
|
bool fixed;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* What trust hierarchy role does this device have?
|
||||||
|
*/
|
||||||
|
enum ZT1_Node_PeerRole {
|
||||||
|
ZT1_Node_Peer_SUPERNODE = 0, // planetary supernode
|
||||||
|
ZT1_Node_Peer_HUB = 1, // locally federated hub (coming soon)
|
||||||
|
ZT1_Node_Peer_NODE = 2 // ordinary node
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Peer status result buffer
|
* Peer status result buffer
|
||||||
*/
|
*/
|
||||||
|
@ -206,11 +225,7 @@ struct ZT1_Node_Peer
|
||||||
/**
|
/**
|
||||||
* What trust hierarchy role does this device have?
|
* What trust hierarchy role does this device have?
|
||||||
*/
|
*/
|
||||||
enum {
|
enum ZT1_Node_PeerRole role;
|
||||||
ZT1_Node_Peer_SUPERNODE = 0, // planetary supernode
|
|
||||||
ZT1_Node_Peer_HUB = 1, // locally federated hub (coming soon)
|
|
||||||
ZT1_Node_Peer_NODE = 2 // ordinary node
|
|
||||||
} role;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Array of network paths to peer
|
* Array of network paths to peer
|
||||||
|
@ -232,6 +247,19 @@ struct ZT1_Node_PeerList
|
||||||
unsigned int numPeers;
|
unsigned int numPeers;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Network status code
|
||||||
|
*/
|
||||||
|
enum ZT1_Node_NetworkStatus {
|
||||||
|
ZT1_Node_Network_INITIALIZING = 0,
|
||||||
|
ZT1_Node_Network_WAITING_FOR_FIRST_AUTOCONF = 1,
|
||||||
|
ZT1_Node_Network_OK = 2,
|
||||||
|
ZT1_Node_Network_ACCESS_DENIED = 3,
|
||||||
|
ZT1_Node_Network_NOT_FOUND = 4,
|
||||||
|
ZT1_Node_Network_INITIALIZATION_FAILED = 5,
|
||||||
|
ZT1_Node_Network_NO_MORE_DEVICES = 6
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Network status result buffer
|
* Network status result buffer
|
||||||
*/
|
*/
|
||||||
|
@ -299,15 +327,7 @@ struct ZT1_Node_Network
|
||||||
/**
|
/**
|
||||||
* Network status code
|
* Network status code
|
||||||
*/
|
*/
|
||||||
enum { /* Must be same as Status in Network.hpp */
|
enum ZT1_Node_NetworkStatus status;
|
||||||
ZT1_Node_Network_INITIALIZING = 0,
|
|
||||||
ZT1_Node_Network_WAITING_FOR_FIRST_AUTOCONF = 1,
|
|
||||||
ZT1_Node_Network_OK = 2,
|
|
||||||
ZT1_Node_Network_ACCESS_DENIED = 3,
|
|
||||||
ZT1_Node_Network_NOT_FOUND = 4,
|
|
||||||
ZT1_Node_Network_INITIALIZATION_FAILED = 5,
|
|
||||||
ZT1_Node_Network_NO_MORE_DEVICES = 6
|
|
||||||
} status;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* True if traffic on network is enabled
|
* True if traffic on network is enabled
|
||||||
|
|
|
@ -81,7 +81,7 @@ unsigned int Multicaster::gather(const Address &queryingPeer,uint64_t nwid,const
|
||||||
|
|
||||||
std::map< std::pair<uint64_t,MulticastGroup>,MulticastGroupStatus >::const_iterator gs(_groups.find(std::pair<uint64_t,MulticastGroup>(nwid,mg)));
|
std::map< std::pair<uint64_t,MulticastGroup>,MulticastGroupStatus >::const_iterator gs(_groups.find(std::pair<uint64_t,MulticastGroup>(nwid,mg)));
|
||||||
if ((gs != _groups.end())&&(!gs->second.members.empty())) {
|
if ((gs != _groups.end())&&(!gs->second.members.empty())) {
|
||||||
totalKnown += gs->second.members.size();
|
totalKnown += (unsigned int)gs->second.members.size();
|
||||||
|
|
||||||
// Members are returned in random order so that repeated gather queries
|
// Members are returned in random order so that repeated gather queries
|
||||||
// will return different subsets of a large multicast group.
|
// will return different subsets of a large multicast group.
|
||||||
|
@ -290,7 +290,7 @@ void Multicaster::send(
|
||||||
C25519::Signature sig(RR->identity.sign(outp.field(ZT_PROTO_VERB_P5_MULTICAST_FRAME_IDX__START_OF_SIGNED_PORTION,signedPortionLen),signedPortionLen));
|
C25519::Signature sig(RR->identity.sign(outp.field(ZT_PROTO_VERB_P5_MULTICAST_FRAME_IDX__START_OF_SIGNED_PORTION,signedPortionLen),signedPortionLen));
|
||||||
|
|
||||||
outp.append((uint16_t)sig.size());
|
outp.append((uint16_t)sig.size());
|
||||||
outp.append(sig.data,sig.size());
|
outp.append(sig.data,(unsigned int)sig.size());
|
||||||
|
|
||||||
if (com) com->serialize(outp);
|
if (com) com->serialize(outp);
|
||||||
|
|
||||||
|
|
|
@ -837,7 +837,7 @@ ZT1_Node_PeerList *Node::listPeers()
|
||||||
|
|
||||||
unsigned int returnBufSize = sizeof(ZT1_Node_PeerList);
|
unsigned int returnBufSize = sizeof(ZT1_Node_PeerList);
|
||||||
for(std::vector< std::pair< SharedPtr<Peer>,std::vector<Path> > >::iterator p(pp.data.begin());p!=pp.data.end();++p)
|
for(std::vector< std::pair< SharedPtr<Peer>,std::vector<Path> > >::iterator p(pp.data.begin());p!=pp.data.end();++p)
|
||||||
returnBufSize += sizeof(ZT1_Node_Peer) + (sizeof(ZT1_Node_PhysicalPath) * p->second.size());
|
returnBufSize += sizeof(ZT1_Node_Peer) + (sizeof(ZT1_Node_PhysicalPath) * (unsigned int)p->second.size());
|
||||||
|
|
||||||
char *buf = (char *)::malloc(returnBufSize);
|
char *buf = (char *)::malloc(returnBufSize);
|
||||||
if (!buf)
|
if (!buf)
|
||||||
|
@ -859,7 +859,7 @@ ZT1_Node_PeerList *Node::listPeers()
|
||||||
p->first->address().toString(prec->address,sizeof(prec->address));
|
p->first->address().toString(prec->address,sizeof(prec->address));
|
||||||
prec->rawAddress = p->first->address().toInt();
|
prec->rawAddress = p->first->address().toInt();
|
||||||
prec->latency = p->first->latency();
|
prec->latency = p->first->latency();
|
||||||
prec->role = RR->topology->isSupernode(p->first->address()) ? ZT1_Node_Peer::ZT1_Node_Peer_SUPERNODE : ZT1_Node_Peer::ZT1_Node_Peer_NODE;
|
prec->role = RR->topology->isSupernode(p->first->address()) ? ZT1_Node_PeerRole::ZT1_Node_Peer_SUPERNODE : ZT1_Node_PeerRole::ZT1_Node_Peer_NODE;
|
||||||
|
|
||||||
prec->paths = (ZT1_Node_PhysicalPath *)buf;
|
prec->paths = (ZT1_Node_PhysicalPath *)buf;
|
||||||
buf += sizeof(ZT1_Node_PhysicalPath) * p->second.size();
|
buf += sizeof(ZT1_Node_PhysicalPath) * p->second.size();
|
||||||
|
@ -867,13 +867,13 @@ ZT1_Node_PeerList *Node::listPeers()
|
||||||
prec->numPaths = 0;
|
prec->numPaths = 0;
|
||||||
for(std::vector<Path>::iterator pi(p->second.begin());pi!=p->second.end();++pi) {
|
for(std::vector<Path>::iterator pi(p->second.begin());pi!=p->second.end();++pi) {
|
||||||
ZT1_Node_PhysicalPath *path = &(prec->paths[prec->numPaths++]);
|
ZT1_Node_PhysicalPath *path = &(prec->paths[prec->numPaths++]);
|
||||||
path->type = static_cast<typeof(path->type)>(pi->type());
|
path->type = (ZT1_Node_PhysicalPathType)pi->type();
|
||||||
if (pi->address().isV6()) {
|
if (pi->address().isV6()) {
|
||||||
path->address.type = ZT1_Node_PhysicalAddress::ZT1_Node_PhysicalAddress_TYPE_IPV6;
|
path->address.type = ZT1_Node_PhysicalAddressType::ZT1_Node_PhysicalAddress_TYPE_IPV6;
|
||||||
memcpy(path->address.bits,pi->address().rawIpData(),16);
|
memcpy(path->address.bits,pi->address().rawIpData(),16);
|
||||||
// TODO: zoneIndex not supported yet, but should be once echo-location works w/V6
|
// TODO: zoneIndex not supported yet, but should be once echo-location works w/V6
|
||||||
} else {
|
} else {
|
||||||
path->address.type = ZT1_Node_PhysicalAddress::ZT1_Node_PhysicalAddress_TYPE_IPV4;
|
path->address.type = ZT1_Node_PhysicalAddressType::ZT1_Node_PhysicalAddress_TYPE_IPV4;
|
||||||
memcpy(path->address.bits,pi->address().rawIpData(),4);
|
memcpy(path->address.bits,pi->address().rawIpData(),4);
|
||||||
}
|
}
|
||||||
path->address.port = pi->address().port();
|
path->address.port = pi->address().port();
|
||||||
|
@ -906,7 +906,7 @@ static void _fillNetworkQueryResultBuffer(const SharedPtr<Network> &network,cons
|
||||||
if (lcu > 0)
|
if (lcu > 0)
|
||||||
nbuf->configAge = (long)(Utils::now() - lcu);
|
nbuf->configAge = (long)(Utils::now() - lcu);
|
||||||
else nbuf->configAge = -1;
|
else nbuf->configAge = -1;
|
||||||
nbuf->status = static_cast<typeof(nbuf->status)>(network->status());
|
nbuf->status = (ZT1_Node_NetworkStatus)network->status();
|
||||||
nbuf->enabled = network->enabled();
|
nbuf->enabled = network->enabled();
|
||||||
nbuf->isPrivate = (nconf) ? nconf->isPrivate() : true;
|
nbuf->isPrivate = (nconf) ? nconf->isPrivate() : true;
|
||||||
}
|
}
|
||||||
|
@ -938,10 +938,10 @@ ZT1_Node_Network *Node::getNetworkStatus(uint64_t nwid)
|
||||||
for(std::set<InetAddress>::iterator ip(ips.begin());ip!=ips.end();++ip) {
|
for(std::set<InetAddress>::iterator ip(ips.begin());ip!=ips.end();++ip) {
|
||||||
ZT1_Node_PhysicalAddress *ipb = &(nbuf->ips[nbuf->numIps++]);
|
ZT1_Node_PhysicalAddress *ipb = &(nbuf->ips[nbuf->numIps++]);
|
||||||
if (ip->isV6()) {
|
if (ip->isV6()) {
|
||||||
ipb->type = ZT1_Node_PhysicalAddress::ZT1_Node_PhysicalAddress_TYPE_IPV6;
|
ipb->type = ZT1_Node_PhysicalAddressType::ZT1_Node_PhysicalAddress_TYPE_IPV6;
|
||||||
memcpy(ipb->bits,ip->rawIpData(),16);
|
memcpy(ipb->bits,ip->rawIpData(),16);
|
||||||
} else {
|
} else {
|
||||||
ipb->type = ZT1_Node_PhysicalAddress::ZT1_Node_PhysicalAddress_TYPE_IPV4;
|
ipb->type = ZT1_Node_PhysicalAddressType::ZT1_Node_PhysicalAddress_TYPE_IPV4;
|
||||||
memcpy(ipb->bits,ip->rawIpData(),4);
|
memcpy(ipb->bits,ip->rawIpData(),4);
|
||||||
}
|
}
|
||||||
ipb->port = ip->port();
|
ipb->port = ip->port();
|
||||||
|
@ -965,7 +965,7 @@ ZT1_Node_NetworkList *Node::listNetworks()
|
||||||
for(unsigned long i=0;i<networks.size();++i) {
|
for(unsigned long i=0;i<networks.size();++i) {
|
||||||
nconfs[i] = networks[i]->config2();
|
nconfs[i] = networks[i]->config2();
|
||||||
ipsv[i] = networks[i]->ips();
|
ipsv[i] = networks[i]->ips();
|
||||||
returnBufSize += sizeof(ZT1_Node_Network) + (sizeof(ZT1_Node_PhysicalAddress) * ipsv[i].size());
|
returnBufSize += sizeof(ZT1_Node_Network) + (sizeof(ZT1_Node_PhysicalAddress) * (unsigned int)ipsv[i].size());
|
||||||
}
|
}
|
||||||
|
|
||||||
char *buf = (char *)::malloc(returnBufSize);
|
char *buf = (char *)::malloc(returnBufSize);
|
||||||
|
@ -991,10 +991,10 @@ ZT1_Node_NetworkList *Node::listNetworks()
|
||||||
for(std::set<InetAddress>::iterator ip(ipsv[i].begin());ip!=ipsv[i].end();++ip) {
|
for(std::set<InetAddress>::iterator ip(ipsv[i].begin());ip!=ipsv[i].end();++ip) {
|
||||||
ZT1_Node_PhysicalAddress *ipb = &(nbuf->ips[nbuf->numIps++]);
|
ZT1_Node_PhysicalAddress *ipb = &(nbuf->ips[nbuf->numIps++]);
|
||||||
if (ip->isV6()) {
|
if (ip->isV6()) {
|
||||||
ipb->type = ZT1_Node_PhysicalAddress::ZT1_Node_PhysicalAddress_TYPE_IPV6;
|
ipb->type = ZT1_Node_PhysicalAddressType::ZT1_Node_PhysicalAddress_TYPE_IPV6;
|
||||||
memcpy(ipb->bits,ip->rawIpData(),16);
|
memcpy(ipb->bits,ip->rawIpData(),16);
|
||||||
} else {
|
} else {
|
||||||
ipb->type = ZT1_Node_PhysicalAddress::ZT1_Node_PhysicalAddress_TYPE_IPV4;
|
ipb->type = ZT1_Node_PhysicalAddressType::ZT1_Node_PhysicalAddress_TYPE_IPV4;
|
||||||
memcpy(ipb->bits,ip->rawIpData(),4);
|
memcpy(ipb->bits,ip->rawIpData(),4);
|
||||||
}
|
}
|
||||||
ipb->port = ip->port();
|
ipb->port = ip->port();
|
||||||
|
|
|
@ -112,7 +112,7 @@ public:
|
||||||
inline unsigned int numSupernodes() const
|
inline unsigned int numSupernodes() const
|
||||||
{
|
{
|
||||||
Mutex::Lock _l(_lock);
|
Mutex::Lock _l(_lock);
|
||||||
return _supernodePeers.size();
|
return (unsigned int)_supernodePeers.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -19,12 +19,16 @@
|
||||||
</ProjectConfiguration>
|
</ProjectConfiguration>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ClCompile Include="..\..\control\IpcConnection.cpp" />
|
||||||
|
<ClCompile Include="..\..\control\IpcListener.cpp" />
|
||||||
|
<ClCompile Include="..\..\control\NodeControlClient.cpp" />
|
||||||
|
<ClCompile Include="..\..\control\NodeControlService.cpp" />
|
||||||
<ClCompile Include="..\..\ext\lz4\lz4.c" />
|
<ClCompile Include="..\..\ext\lz4\lz4.c" />
|
||||||
<ClCompile Include="..\..\main.cpp">
|
<ClCompile Include="..\..\main.cpp">
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</ExcludedFromBuild>
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\..\node\C25519.cpp" />
|
<ClCompile Include="..\..\node\C25519.cpp" />
|
||||||
<ClCompile Include="..\..\node\CertificateOfMembership.cpp" />
|
<ClCompile Include="..\..\node\CertificateOfMembership.cpp" />
|
||||||
|
@ -32,17 +36,16 @@
|
||||||
<ClCompile Include="..\..\node\Dictionary.cpp" />
|
<ClCompile Include="..\..\node\Dictionary.cpp" />
|
||||||
<ClCompile Include="..\..\node\HttpClient.cpp" />
|
<ClCompile Include="..\..\node\HttpClient.cpp" />
|
||||||
<ClCompile Include="..\..\node\Identity.cpp" />
|
<ClCompile Include="..\..\node\Identity.cpp" />
|
||||||
|
<ClCompile Include="..\..\node\IncomingPacket.cpp" />
|
||||||
<ClCompile Include="..\..\node\InetAddress.cpp" />
|
<ClCompile Include="..\..\node\InetAddress.cpp" />
|
||||||
<ClCompile Include="..\..\node\IpcConnection.cpp" />
|
|
||||||
<ClCompile Include="..\..\node\IpcListener.cpp" />
|
|
||||||
<ClCompile Include="..\..\node\Logger.cpp" />
|
<ClCompile Include="..\..\node\Logger.cpp" />
|
||||||
<ClCompile Include="..\..\node\Multicaster.cpp" />
|
<ClCompile Include="..\..\node\Multicaster.cpp" />
|
||||||
<ClCompile Include="..\..\node\Network.cpp" />
|
<ClCompile Include="..\..\node\Network.cpp" />
|
||||||
<ClCompile Include="..\..\node\NetworkConfig.cpp" />
|
<ClCompile Include="..\..\node\NetworkConfig.cpp" />
|
||||||
<ClCompile Include="..\..\node\Node.cpp" />
|
<ClCompile Include="..\..\node\Node.cpp" />
|
||||||
<ClCompile Include="..\..\node\NodeConfig.cpp" />
|
<ClCompile Include="..\..\node\NodeConfig.cpp" />
|
||||||
|
<ClCompile Include="..\..\node\OutboundMulticast.cpp" />
|
||||||
<ClCompile Include="..\..\node\Packet.cpp" />
|
<ClCompile Include="..\..\node\Packet.cpp" />
|
||||||
<ClCompile Include="..\..\node\PacketDecoder.cpp" />
|
|
||||||
<ClCompile Include="..\..\node\Peer.cpp" />
|
<ClCompile Include="..\..\node\Peer.cpp" />
|
||||||
<ClCompile Include="..\..\node\Poly1305.cpp" />
|
<ClCompile Include="..\..\node\Poly1305.cpp" />
|
||||||
<ClCompile Include="..\..\node\RoutingTable.cpp" />
|
<ClCompile Include="..\..\node\RoutingTable.cpp" />
|
||||||
|
@ -60,17 +63,25 @@
|
||||||
<ClCompile Include="..\..\osnet\WindowsEthernetTapFactory.cpp" />
|
<ClCompile Include="..\..\osnet\WindowsEthernetTapFactory.cpp" />
|
||||||
<ClCompile Include="..\..\osnet\WindowsRoutingTable.cpp" />
|
<ClCompile Include="..\..\osnet\WindowsRoutingTable.cpp" />
|
||||||
<ClCompile Include="..\..\selftest.cpp">
|
<ClCompile Include="..\..\selftest.cpp">
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</ExcludedFromBuild>
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\testnet\TestEthernetTap.cpp" />
|
||||||
|
<ClCompile Include="..\..\testnet\TestEthernetTapFactory.cpp" />
|
||||||
|
<ClCompile Include="..\..\testnet\TestRoutingTable.cpp" />
|
||||||
<ClCompile Include="ServiceBase.cpp" />
|
<ClCompile Include="ServiceBase.cpp" />
|
||||||
<ClCompile Include="ServiceInstaller.cpp" />
|
<ClCompile Include="ServiceInstaller.cpp" />
|
||||||
<ClCompile Include="ZeroTierOneService.cpp" />
|
<ClCompile Include="ZeroTierOneService.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ClInclude Include="..\..\control\IpcConnection.hpp" />
|
||||||
|
<ClInclude Include="..\..\control\IpcListener.hpp" />
|
||||||
|
<ClInclude Include="..\..\control\NodeControlClient.hpp" />
|
||||||
|
<ClInclude Include="..\..\control\NodeControlService.hpp" />
|
||||||
<ClInclude Include="..\..\ext\lz4\lz4.h" />
|
<ClInclude Include="..\..\ext\lz4\lz4.h" />
|
||||||
|
<ClInclude Include="..\..\include\ZeroTierOne.h" />
|
||||||
<ClInclude Include="..\..\node\Address.hpp" />
|
<ClInclude Include="..\..\node\Address.hpp" />
|
||||||
<ClInclude Include="..\..\node\AntiRecursion.hpp" />
|
<ClInclude Include="..\..\node\AntiRecursion.hpp" />
|
||||||
<ClInclude Include="..\..\node\Array.hpp" />
|
<ClInclude Include="..\..\node\Array.hpp" />
|
||||||
|
@ -87,9 +98,8 @@
|
||||||
<ClInclude Include="..\..\node\EthernetTap.hpp" />
|
<ClInclude Include="..\..\node\EthernetTap.hpp" />
|
||||||
<ClInclude Include="..\..\node\HttpClient.hpp" />
|
<ClInclude Include="..\..\node\HttpClient.hpp" />
|
||||||
<ClInclude Include="..\..\node\Identity.hpp" />
|
<ClInclude Include="..\..\node\Identity.hpp" />
|
||||||
|
<ClInclude Include="..\..\node\IncomingPacket.hpp" />
|
||||||
<ClInclude Include="..\..\node\InetAddress.hpp" />
|
<ClInclude Include="..\..\node\InetAddress.hpp" />
|
||||||
<ClInclude Include="..\..\node\IpcConnection.hpp" />
|
|
||||||
<ClInclude Include="..\..\node\IpcListener.hpp" />
|
|
||||||
<ClInclude Include="..\..\node\Logger.hpp" />
|
<ClInclude Include="..\..\node\Logger.hpp" />
|
||||||
<ClInclude Include="..\..\node\MAC.hpp" />
|
<ClInclude Include="..\..\node\MAC.hpp" />
|
||||||
<ClInclude Include="..\..\node\Multicaster.hpp" />
|
<ClInclude Include="..\..\node\Multicaster.hpp" />
|
||||||
|
@ -100,8 +110,8 @@
|
||||||
<ClInclude Include="..\..\node\Node.hpp" />
|
<ClInclude Include="..\..\node\Node.hpp" />
|
||||||
<ClInclude Include="..\..\node\NodeConfig.hpp" />
|
<ClInclude Include="..\..\node\NodeConfig.hpp" />
|
||||||
<ClInclude Include="..\..\node\NonCopyable.hpp" />
|
<ClInclude Include="..\..\node\NonCopyable.hpp" />
|
||||||
|
<ClInclude Include="..\..\node\OutboundMulticast.hpp" />
|
||||||
<ClInclude Include="..\..\node\Packet.hpp" />
|
<ClInclude Include="..\..\node\Packet.hpp" />
|
||||||
<ClInclude Include="..\..\node\PacketDecoder.hpp" />
|
|
||||||
<ClInclude Include="..\..\node\Path.hpp" />
|
<ClInclude Include="..\..\node\Path.hpp" />
|
||||||
<ClInclude Include="..\..\node\Peer.hpp" />
|
<ClInclude Include="..\..\node\Peer.hpp" />
|
||||||
<ClInclude Include="..\..\node\Poly1305.hpp" />
|
<ClInclude Include="..\..\node\Poly1305.hpp" />
|
||||||
|
@ -123,6 +133,9 @@
|
||||||
<ClInclude Include="..\..\osnet\WindowsEthernetTap.hpp" />
|
<ClInclude Include="..\..\osnet\WindowsEthernetTap.hpp" />
|
||||||
<ClInclude Include="..\..\osnet\WindowsEthernetTapFactory.hpp" />
|
<ClInclude Include="..\..\osnet\WindowsEthernetTapFactory.hpp" />
|
||||||
<ClInclude Include="..\..\osnet\WindowsRoutingTable.hpp" />
|
<ClInclude Include="..\..\osnet\WindowsRoutingTable.hpp" />
|
||||||
|
<ClInclude Include="..\..\testnet\TestEthernetTap.hpp" />
|
||||||
|
<ClInclude Include="..\..\testnet\TestEthernetTapFactory.hpp" />
|
||||||
|
<ClInclude Include="..\..\testnet\TestRoutingTable.hpp" />
|
||||||
<ClInclude Include="..\..\version.h" />
|
<ClInclude Include="..\..\version.h" />
|
||||||
<ClInclude Include="resource.h" />
|
<ClInclude Include="resource.h" />
|
||||||
<ClInclude Include="ServiceBase.h" />
|
<ClInclude Include="ServiceBase.h" />
|
||||||
|
|
|
@ -57,9 +57,6 @@
|
||||||
<ClCompile Include="..\..\node\Packet.cpp">
|
<ClCompile Include="..\..\node\Packet.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\..\node\PacketDecoder.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\node\Peer.cpp">
|
<ClCompile Include="..\..\node\Peer.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
@ -99,12 +96,6 @@
|
||||||
<ClCompile Include="ZeroTierOneService.cpp">
|
<ClCompile Include="ZeroTierOneService.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\..\node\IpcConnection.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\node\IpcListener.cpp">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\node\SocketManager.cpp">
|
<ClCompile Include="..\..\node\SocketManager.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
@ -132,6 +123,33 @@
|
||||||
<ClCompile Include="..\..\selftest.cpp">
|
<ClCompile Include="..\..\selftest.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\control\IpcConnection.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\control\IpcListener.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\control\NodeControlClient.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\control\NodeControlService.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\testnet\TestEthernetTap.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\testnet\TestEthernetTapFactory.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\testnet\TestRoutingTable.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\node\IncomingPacket.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\node\OutboundMulticast.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="..\..\ext\lz4\lz4.h">
|
<ClInclude Include="..\..\ext\lz4\lz4.h">
|
||||||
|
@ -218,9 +236,6 @@
|
||||||
<ClInclude Include="..\..\node\Packet.hpp">
|
<ClInclude Include="..\..\node\Packet.hpp">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\node\PacketDecoder.hpp">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\node\Peer.hpp">
|
<ClInclude Include="..\..\node\Peer.hpp">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
@ -272,12 +287,6 @@
|
||||||
<ClInclude Include="ZeroTierOneService.h">
|
<ClInclude Include="ZeroTierOneService.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\node\IpcConnection.hpp">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\node\IpcListener.hpp">
|
|
||||||
<Filter>Header Files</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="..\..\node\Path.hpp">
|
<ClInclude Include="..\..\node\Path.hpp">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
@ -308,6 +317,36 @@
|
||||||
<ClInclude Include="..\..\osnet\WindowsRoutingTable.hpp">
|
<ClInclude Include="..\..\osnet\WindowsRoutingTable.hpp">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\..\control\IpcConnection.hpp">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\..\control\IpcListener.hpp">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\..\control\NodeControlClient.hpp">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\..\control\NodeControlService.hpp">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\..\testnet\TestEthernetTap.hpp">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\..\testnet\TestEthernetTapFactory.hpp">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\..\testnet\TestRoutingTable.hpp">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\..\node\IncomingPacket.hpp">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\..\include\ZeroTierOne.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\..\node\OutboundMulticast.hpp">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ResourceCompile Include="ZeroTierOne.rc">
|
<ResourceCompile Include="ZeroTierOne.rc">
|
||||||
|
|
|
@ -106,7 +106,7 @@ restart_node:
|
||||||
// Get upgrade path, which will be its reason for termination
|
// Get upgrade path, which will be its reason for termination
|
||||||
std::string msiPath;
|
std::string msiPath;
|
||||||
if (n) {
|
if (n) {
|
||||||
const char *msiPathTmp = n->reasonForTermination();
|
const char *msiPathTmp = n->terminationMessage();
|
||||||
if (msiPathTmp)
|
if (msiPathTmp)
|
||||||
msiPath = msiPathTmp;
|
msiPath = msiPathTmp;
|
||||||
}
|
}
|
||||||
|
@ -131,7 +131,7 @@ restart_node:
|
||||||
|
|
||||||
case ZeroTier::Node::NODE_UNRECOVERABLE_ERROR: {
|
case ZeroTier::Node::NODE_UNRECOVERABLE_ERROR: {
|
||||||
std::string err("ZeroTier node encountered an unrecoverable error: ");
|
std::string err("ZeroTier node encountered an unrecoverable error: ");
|
||||||
const char *r = _node->reasonForTermination();
|
const char *r = _node->terminationMessage();
|
||||||
if (r)
|
if (r)
|
||||||
err.append(r);
|
err.append(r);
|
||||||
else err.append("(unknown error)");
|
else err.append("(unknown error)");
|
||||||
|
|
Loading…
Add table
Reference in a new issue