summaryrefslogtreecommitdiff
path: root/node
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@zerotier.com>2014-10-19 12:56:39 -0700
committerAdam Ierymenko <adam.ierymenko@zerotier.com>2014-10-19 12:56:39 -0700
commit74f36f5dc0a8e81a53cfeb86c64db4bb9c23fe30 (patch)
tree84bd7a508a5046eaa1e1cf37dfba6941908ff0b0 /node
parent2eeb3dee9e525ef5fd1f3ad2049e4b4cb9cdef0d (diff)
downloadinfinitytier-74f36f5dc0a8e81a53cfeb86c64db4bb9c23fe30.tar.gz
infinitytier-74f36f5dc0a8e81a53cfeb86c64db4bb9c23fe30.zip
Windows build fixes.
Diffstat (limited to 'node')
-rw-r--r--node/Multicaster.cpp4
-rw-r--r--node/Node.cpp22
-rw-r--r--node/Topology.hpp2
3 files changed, 14 insertions, 14 deletions
diff --git a/node/Multicaster.cpp b/node/Multicaster.cpp
index ba8258b2..38bcc237 100644
--- a/node/Multicaster.cpp
+++ b/node/Multicaster.cpp
@@ -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)));
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
// 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));
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);
diff --git a/node/Node.cpp b/node/Node.cpp
index 4673312a..c6322c31 100644
--- a/node/Node.cpp
+++ b/node/Node.cpp
@@ -837,7 +837,7 @@ ZT1_Node_PeerList *Node::listPeers()
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)
- 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);
if (!buf)
@@ -859,7 +859,7 @@ ZT1_Node_PeerList *Node::listPeers()
p->first->address().toString(prec->address,sizeof(prec->address));
prec->rawAddress = p->first->address().toInt();
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;
buf += sizeof(ZT1_Node_PhysicalPath) * p->second.size();
@@ -867,13 +867,13 @@ ZT1_Node_PeerList *Node::listPeers()
prec->numPaths = 0;
for(std::vector<Path>::iterator pi(p->second.begin());pi!=p->second.end();++pi) {
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()) {
- 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);
// TODO: zoneIndex not supported yet, but should be once echo-location works w/V6
} 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);
}
path->address.port = pi->address().port();
@@ -906,7 +906,7 @@ static void _fillNetworkQueryResultBuffer(const SharedPtr<Network> &network,cons
if (lcu > 0)
nbuf->configAge = (long)(Utils::now() - lcu);
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->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) {
ZT1_Node_PhysicalAddress *ipb = &(nbuf->ips[nbuf->numIps++]);
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);
} 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);
}
ipb->port = ip->port();
@@ -965,7 +965,7 @@ ZT1_Node_NetworkList *Node::listNetworks()
for(unsigned long i=0;i<networks.size();++i) {
nconfs[i] = networks[i]->config2();
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);
@@ -991,10 +991,10 @@ ZT1_Node_NetworkList *Node::listNetworks()
for(std::set<InetAddress>::iterator ip(ipsv[i].begin());ip!=ipsv[i].end();++ip) {
ZT1_Node_PhysicalAddress *ipb = &(nbuf->ips[nbuf->numIps++]);
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);
} 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);
}
ipb->port = ip->port();
diff --git a/node/Topology.hpp b/node/Topology.hpp
index e3e573ed..15e8db3b 100644
--- a/node/Topology.hpp
+++ b/node/Topology.hpp
@@ -112,7 +112,7 @@ public:
inline unsigned int numSupernodes() const
{
Mutex::Lock _l(_lock);
- return _supernodePeers.size();
+ return (unsigned int)_supernodePeers.size();
}
/**