From 1d39be61b267a85adebeee9e979bd1d84f55da3c Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Wed, 1 Mar 2017 14:36:52 -0800 Subject: 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. --- one.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'one.cpp') diff --git a/one.cpp b/one.cpp index 3649c18c..8f116aa0 100644 --- a/one.cpp +++ b/one.cpp @@ -355,7 +355,8 @@ static int cli(int argc,char **argv) char tmp[256]; std::string addr = path["address"]; const uint64_t now = OSUtils::now(); - Utils::snprintf(tmp,sizeof(tmp),"%s;%llu;%llu",addr.c_str(),now - (uint64_t)path["lastSend"],now - (uint64_t)path["lastReceive"]); + const double lq = (path.count("linkQuality")) ? (double)path["linkQuality"] : -1.0; + Utils::snprintf(tmp,sizeof(tmp),"%s;%llu;%llu;%1.2f",addr.c_str(),now - (uint64_t)path["lastSend"],now - (uint64_t)path["lastReceive"],lq); bestPath = tmp; break; } -- cgit v1.2.3