summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2017-03-01 14:36:52 -0800
committerAdam Ierymenko <adam.ierymenko@gmail.com>2017-03-01 14:36:52 -0800
commit1d39be61b267a85adebeee9e979bd1d84f55da3c (patch)
tree2fa5efbe2406a9a60686c1de422ff2c574802ba5 /service
parent2bf9145ae65385bf968542619ffcf204cf6241d8 (diff)
downloadinfinitytier-1d39be61b267a85adebeee9e979bd1d84f55da3c.tar.gz
infinitytier-1d39be61b267a85adebeee9e979bd1d84f55da3c.zip
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.
Diffstat (limited to 'service')
-rw-r--r--service/ControlPlane.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/service/ControlPlane.cpp b/service/ControlPlane.cpp
index 9ba001ea..e995a4a5 100644
--- a/service/ControlPlane.cpp
+++ b/service/ControlPlane.cpp
@@ -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;