This commit is contained in:
Adam Ierymenko 2019-06-13 12:53:05 -07:00
commit 9797540212
8 changed files with 59 additions and 67 deletions

96
Jenkinsfile vendored
View file

@ -24,61 +24,61 @@ parallel 'centos7': {
throw err throw err
} }
} }
}, 'android-ndk': { // }, 'android-ndk': {
node('android-ndk') { // node('android-ndk') {
try { // try {
checkout scm // checkout scm
stage('Build Android NDK') { // stage('Build Android NDK') {
sh "/android/android-ndk-r15b/ndk-build -C $WORKSPACE/java ZT1=${WORKSPACE}" // sh "/android/android-ndk-r15b/ndk-build -C $WORKSPACE/java ZT1=${WORKSPACE}"
} // }
} // }
catch (err) { // catch (err) {
currentBuild.result = "FAILURE" // currentBuild.result = "FAILURE"
mattermostSend color: '#ff0000', message: "${env.JOB_NAME} broken on Android NDK (<${env.BUILD_URL}|Open>)" // mattermostSend color: '#ff0000', message: "${env.JOB_NAME} broken on Android NDK (<${env.BUILD_URL}|Open>)"
throw err // throw err
} // }
} // }
}, 'macOS': { // }, 'macOS': {
node('macOS') { // node('macOS') {
try { // try {
checkout scm // checkout scm
stage('Build macOS') { // stage('Build macOS') {
sh 'make -f make-mac.mk' // sh 'make -f make-mac.mk'
} // }
stage('Build macOS UI') { // stage('Build macOS UI') {
sh 'cd macui && xcodebuild -target "ZeroTier One" -configuration Debug' // sh 'cd macui && xcodebuild -target "ZeroTier One" -configuration Debug'
} // }
} // }
catch (err) { // catch (err) {
currentBuild.result = "FAILURE" // currentBuild.result = "FAILURE"
mattermostSend color: '#ff0000', message: "${env.JOB_NAME} broken on macOS (<${env.BUILD_URL}|Open>)" // mattermostSend color: '#ff0000', message: "${env.JOB_NAME} broken on macOS (<${env.BUILD_URL}|Open>)"
throw err // throw err
} // }
} // }
}, 'windows': { // }, 'windows': {
node('windows') { // node('windows') {
try { // try {
checkout scm // checkout scm
stage('Build Windows') { // stage('Build Windows') {
bat '''CALL "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\vcvarsall.bat" amd64 // bat '''CALL "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\vcvarsall.bat" amd64
git clean -dfx // git clean -dfx
msbuild windows\\ZeroTierOne.sln // msbuild windows\\ZeroTierOne.sln
''' // '''
} // }
} // }
catch (err) { // catch (err) {
currentBuild.result = "FAILURE" // currentBuild.result = "FAILURE"
mattermostSend color: '#ff0000', message: "${env.JOB_NAME} broken on Windows (<${env.BUILD_URL}|Open>)" // mattermostSend color: '#ff0000', message: "${env.JOB_NAME} broken on Windows (<${env.BUILD_URL}|Open>)"
throw err // throw err
} // }
} // }
} }
mattermostSend color: "#00ff00", message: "${env.JOB_NAME} #${env.BUILD_NUMBER} Complete (<${env.BUILD_URL}|Show More...>)" mattermostSend color: "#00ff00", message: "${env.JOB_NAME} #${env.BUILD_NUMBER} Complete (<${env.BUILD_URL}|Show More...>)"

View file

@ -500,7 +500,7 @@ ZT_PeerList *Node::peers() const
p->paths[p->pathCount].trustedPathId = RR->topology->getOutboundPathTrust((*path)->address()); p->paths[p->pathCount].trustedPathId = RR->topology->getOutboundPathTrust((*path)->address());
p->paths[p->pathCount].expired = 0; p->paths[p->pathCount].expired = 0;
p->paths[p->pathCount].preferred = ((*path) == bestp) ? 1 : 0; p->paths[p->pathCount].preferred = ((*path) == bestp) ? 1 : 0;
p->paths[p->pathCount].latency = (*path)->latency(); p->paths[p->pathCount].latency = (float)(*path)->latency();
p->paths[p->pathCount].packetDelayVariance = (*path)->packetDelayVariance(); p->paths[p->pathCount].packetDelayVariance = (*path)->packetDelayVariance();
p->paths[p->pathCount].throughputDisturbCoeff = (*path)->throughputDisturbanceCoefficient(); p->paths[p->pathCount].throughputDisturbCoeff = (*path)->throughputDisturbanceCoefficient();
p->paths[p->pathCount].packetErrorRatio = (*path)->packetErrorRatio(); p->paths[p->pathCount].packetErrorRatio = (*path)->packetErrorRatio();

View file

@ -351,7 +351,7 @@ public:
_unackedBytes = (ackedBytes > _unackedBytes) ? 0 : _unackedBytes - ackedBytes; _unackedBytes = (ackedBytes > _unackedBytes) ? 0 : _unackedBytes - ackedBytes;
int64_t timeSinceThroughputEstimate = (now - _lastThroughputEstimation); int64_t timeSinceThroughputEstimate = (now - _lastThroughputEstimation);
if (timeSinceThroughputEstimate >= ZT_PATH_THROUGHPUT_MEASUREMENT_INTERVAL) { if (timeSinceThroughputEstimate >= ZT_PATH_THROUGHPUT_MEASUREMENT_INTERVAL) {
uint64_t throughput = (float)(_bytesAckedSinceLastThroughputEstimation * 8) / ((float)timeSinceThroughputEstimate / (float)1000); uint64_t throughput = (uint64_t)((float)(_bytesAckedSinceLastThroughputEstimation * 8) / ((float)timeSinceThroughputEstimate / (float)1000));
_throughputSamples.push(throughput); _throughputSamples.push(throughput);
_maxLifetimeThroughput = throughput > _maxLifetimeThroughput ? throughput : _maxLifetimeThroughput; _maxLifetimeThroughput = throughput > _maxLifetimeThroughput ? throughput : _maxLifetimeThroughput;
_lastThroughputEstimation = now; _lastThroughputEstimation = now;
@ -416,7 +416,7 @@ public:
if (it != _outQoSRecords.end()) { if (it != _outQoSRecords.end()) {
uint16_t rtt = (uint16_t)(now - it->second); uint16_t rtt = (uint16_t)(now - it->second);
uint16_t rtt_compensated = rtt - rx_ts[j]; uint16_t rtt_compensated = rtt - rx_ts[j];
float latency = rtt_compensated / 2.0; uint16_t latency = rtt_compensated / 2;
updateLatency(latency, now); updateLatency(latency, now);
_outQoSRecords.erase(it); _outQoSRecords.erase(it);
} }

View file

@ -157,7 +157,7 @@ void Peer::received(
break; break;
} }
// If the path is the same address and port, simply assume this is a replacement // If the path is the same address and port, simply assume this is a replacement
if ( (_paths[i].p->address().ipsEqual2(path->address()) && (_paths[i].p->address().port() == path->address().port()))) { if ( (_paths[i].p->address().ipsEqual2(path->address()))) {
replacePath = i; replacePath = i;
break; break;
} }
@ -285,7 +285,7 @@ void Peer::computeAggregateProportionalAllocation(int64_t now)
for(unsigned int i=0;i<ZT_MAX_PEER_NETWORK_PATHS;++i) { for(unsigned int i=0;i<ZT_MAX_PEER_NETWORK_PATHS;++i) {
if (_paths[i].p) { if (_paths[i].p) {
relStability[i] = _paths[i].p->lastComputedStability(); relStability[i] = _paths[i].p->lastComputedStability();
relThroughput[i] = _paths[i].p->maxLifetimeThroughput(); relThroughput[i] = (float)_paths[i].p->maxLifetimeThroughput();
maxStability = relStability[i] > maxStability ? relStability[i] : maxStability; maxStability = relStability[i] > maxStability ? relStability[i] : maxStability;
maxThroughput = relThroughput[i] > maxThroughput ? relThroughput[i] : maxThroughput; maxThroughput = relThroughput[i] > maxThroughput ? relThroughput[i] : maxThroughput;
maxScope = _paths[i].p->ipScope() > maxScope ? _paths[i].p->ipScope() : maxScope; maxScope = _paths[i].p->ipScope() > maxScope ? _paths[i].p->ipScope() : maxScope;
@ -296,7 +296,7 @@ void Peer::computeAggregateProportionalAllocation(int64_t now)
if (_paths[i].p) { if (_paths[i].p) {
relStability[i] /= maxStability ? maxStability : 1; relStability[i] /= maxStability ? maxStability : 1;
relThroughput[i] /= maxThroughput ? maxThroughput : 1; relThroughput[i] /= maxThroughput ? maxThroughput : 1;
float normalized_ma = Utils::normalize(_paths[i].p->ackAge(now), 0, ZT_PATH_MAX_AGE, 0, 10); float normalized_ma = Utils::normalize((float)_paths[i].p->ackAge(now), 0, ZT_PATH_MAX_AGE, 0, 10);
float age_contrib = exp((-1)*normalized_ma); float age_contrib = exp((-1)*normalized_ma);
float relScope = ((float)(_paths[i].p->ipScope()+1) / (maxScope + 1)); float relScope = ((float)(_paths[i].p->ipScope()+1) / (maxScope + 1));
float relQuality = float relQuality =
@ -314,7 +314,7 @@ void Peer::computeAggregateProportionalAllocation(int64_t now)
// Convert set of relative performances into an allocation set // Convert set of relative performances into an allocation set
for(uint16_t i=0;i<ZT_MAX_PEER_NETWORK_PATHS;++i) { for(uint16_t i=0;i<ZT_MAX_PEER_NETWORK_PATHS;++i) {
if (_paths[i].p) { if (_paths[i].p) {
_paths[i].p->updateComponentAllocationOfAggregateLink((_paths[i].p->relativeQuality() / totalRelativeQuality) * 255); _paths[i].p->updateComponentAllocationOfAggregateLink((unsigned char)((_paths[i].p->relativeQuality() / totalRelativeQuality) * 255));
} }
} }
} }
@ -327,7 +327,7 @@ int Peer::computeAggregateLinkPacketDelayVariance()
pdv += _paths[i].p->relativeQuality() * _paths[i].p->packetDelayVariance(); pdv += _paths[i].p->relativeQuality() * _paths[i].p->packetDelayVariance();
} }
} }
return pdv; return (int)pdv;
} }
int Peer::computeAggregateLinkMeanLatency() int Peer::computeAggregateLinkMeanLatency()
@ -337,7 +337,7 @@ int Peer::computeAggregateLinkMeanLatency()
for(unsigned int i=0;i<ZT_MAX_PEER_NETWORK_PATHS;++i) { for(unsigned int i=0;i<ZT_MAX_PEER_NETWORK_PATHS;++i) {
if (_paths[i].p) { if (_paths[i].p) {
pathCount++; pathCount++;
ml += _paths[i].p->relativeQuality() * _paths[i].p->meanLatency(); ml += (int)(_paths[i].p->relativeQuality() * _paths[i].p->meanLatency());
} }
} }
return ml / pathCount; return ml / pathCount;

View file

@ -268,7 +268,7 @@ public:
for (size_t i=0; i<curr_cnt; i++) { for (size_t i=0; i<curr_cnt; i++) {
iterator = (iterator + S - 1) % curr_cnt; iterator = (iterator + S - 1) % curr_cnt;
float deviation = (buf[i] - cached_mean); float deviation = (buf[i] - cached_mean);
sum_of_squared_deviations += (deviation*deviation); sum_of_squared_deviations += (T)(deviation*deviation);
} }
float variance = (float)sum_of_squared_deviations / (float)(S - 1); float variance = (float)sum_of_squared_deviations / (float)(S - 1);
return variance; return variance;

View file

@ -601,7 +601,7 @@ void Switch::aqm_enqueue(void *tPtr, const SharedPtr<Network> &network, Packet &
uint64_t Switch::control_law(uint64_t t, int count) uint64_t Switch::control_law(uint64_t t, int count)
{ {
return t + ZT_QOS_INTERVAL / sqrt(count); return (uint64_t)(t + ZT_QOS_INTERVAL / sqrt(count));
} }
Switch::dqr Switch::dodequeue(ManagedQueue *q, uint64_t now) Switch::dqr Switch::dodequeue(ManagedQueue *q, uint64_t now)

View file

@ -30,7 +30,6 @@
<ClCompile Include="..\..\controller\DB.cpp" /> <ClCompile Include="..\..\controller\DB.cpp" />
<ClCompile Include="..\..\controller\EmbeddedNetworkController.cpp" /> <ClCompile Include="..\..\controller\EmbeddedNetworkController.cpp" />
<ClCompile Include="..\..\controller\FileDB.cpp" /> <ClCompile Include="..\..\controller\FileDB.cpp" />
<ClCompile Include="..\..\controller\RethinkDB.cpp" />
<ClCompile Include="..\..\ext\http-parser\http_parser.c" /> <ClCompile Include="..\..\ext\http-parser\http_parser.c" />
<ClCompile Include="..\..\ext\libnatpmp\getgateway.c" /> <ClCompile Include="..\..\ext\libnatpmp\getgateway.c" />
<ClCompile Include="..\..\ext\libnatpmp\natpmp.c" /> <ClCompile Include="..\..\ext\libnatpmp\natpmp.c" />
@ -115,7 +114,6 @@
<ClInclude Include="..\..\controller\DB.hpp" /> <ClInclude Include="..\..\controller\DB.hpp" />
<ClInclude Include="..\..\controller\EmbeddedNetworkController.hpp" /> <ClInclude Include="..\..\controller\EmbeddedNetworkController.hpp" />
<ClInclude Include="..\..\controller\FileDB.hpp" /> <ClInclude Include="..\..\controller\FileDB.hpp" />
<ClInclude Include="..\..\controller\RethinkDB.hpp" />
<ClInclude Include="..\..\ext\http-parser\http_parser.h" /> <ClInclude Include="..\..\ext\http-parser\http_parser.h" />
<ClInclude Include="..\..\ext\json\json.hpp" /> <ClInclude Include="..\..\ext\json\json.hpp" />
<ClInclude Include="..\..\ext\libnatpmp\getgateway.h" /> <ClInclude Include="..\..\ext\libnatpmp\getgateway.h" />

View file

@ -258,9 +258,6 @@
<ClCompile Include="..\..\controller\FileDB.cpp"> <ClCompile Include="..\..\controller\FileDB.cpp">
<Filter>Source Files\controller</Filter> <Filter>Source Files\controller</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\controller\RethinkDB.cpp">
<Filter>Source Files\controller</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="resource.h"> <ClInclude Include="resource.h">
@ -494,9 +491,6 @@
<ClInclude Include="..\..\controller\FileDB.hpp"> <ClInclude Include="..\..\controller\FileDB.hpp">
<Filter>Header Files\controller</Filter> <Filter>Header Files\controller</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\..\controller\RethinkDB.hpp">
<Filter>Header Files\controller</Filter>
</ClInclude>
<ClInclude Include="..\..\node\Membership.hpp"> <ClInclude Include="..\..\node\Membership.hpp">
<Filter>Header Files\node</Filter> <Filter>Header Files\node</Filter>
</ClInclude> </ClInclude>