From 1cfa67bbdd4242a52484f13f3533babb4d4c07a6 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Tue, 14 Apr 2015 13:56:28 -0700 Subject: Bunch more control plane work, and shelve old UI -- React FTW. --- node/Node.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'node/Node.cpp') diff --git a/node/Node.cpp b/node/Node.cpp index be9eadfa..beb06430 100644 --- a/node/Node.cpp +++ b/node/Node.cpp @@ -357,12 +357,15 @@ ZT1_PeerList *Node::peers() const p->role = RR->topology->isSupernode(pi->second->address()) ? ZT1_PEER_ROLE_SUPERNODE : ZT1_PEER_ROLE_LEAF; std::vector paths(pi->second->paths()); + Path *bestPath = pi->second->getBestPath(_now); p->pathCount = 0; for(std::vector::iterator path(paths.begin());path!=paths.end();++path) { memcpy(&(p->paths[p->pathCount].address),&(path->address()),sizeof(struct sockaddr_storage)); p->paths[p->pathCount].lastSend = path->lastSend(); p->paths[p->pathCount].lastReceive = path->lastReceived(); p->paths[p->pathCount].fixed = path->fixed() ? 1 : 0; + p->paths[p->pathCount].active = path->active(_now) ? 1 : 0; + p->paths[p->pathCount].preferred = ((bestPath)&&(*path == *bestPath)) ? 1 : 0; ++p->pathCount; } } -- cgit v1.2.3