ZeroTier now has link quality measurement. We are not using this yet but decided to put it in to prep for future QoS support and SD-WAN stuff.

This commit is contained in:
Adam Ierymenko 2017-03-01 14:36:52 -08:00
parent 2bf9145ae6
commit 1d39be61b2
9 changed files with 111 additions and 22 deletions

View file

@ -127,10 +127,11 @@ static void _peerToJson(nlohmann::json &pj,const ZT_Peer *peer)
j["address"] = reinterpret_cast<const InetAddress *>(&(peer->paths[i].address))->toString();
j["lastSend"] = peer->paths[i].lastSend;
j["lastReceive"] = peer->paths[i].lastReceive;
j["trustedPathId"] = peer->paths[i].trustedPathId;
j["linkQuality"] = (double)peer->paths[i].linkQuality / (double)ZT_PATH_LINK_QUALITY_MAX;
j["active"] = (bool)(peer->paths[i].expired == 0);
j["expired"] = (bool)(peer->paths[i].expired != 0);
j["preferred"] = (bool)(peer->paths[i].preferred != 0);
j["trustedPathId"] = peer->paths[i].trustedPathId;
pa.push_back(j);
}
pj["paths"] = pa;