Cleanup and make moons (federated roots) a little easier to deal with.

This commit is contained in:
Adam Ierymenko 2017-02-13 09:03:48 -08:00
commit 42f28bce52
10 changed files with 107 additions and 98 deletions

View file

@ -226,8 +226,8 @@ static void _jsonAppend(unsigned int depth,std::string &buf,const ZT_Peer *peer)
const char *prole = "";
switch(peer->role) {
case ZT_PEER_ROLE_LEAF: prole = "LEAF"; break;
case ZT_PEER_ROLE_UPSTREAM: prole = "UPSTREAM"; break;
case ZT_PEER_ROLE_ROOT: prole = "ROOT"; break;
case ZT_PEER_ROLE_MOON: prole = "MOON"; break;
case ZT_PEER_ROLE_PLANET: prole = "PLANET"; break;
}
Utils::snprintf(json,sizeof(json),

View file

@ -707,7 +707,7 @@ public:
for(std::vector<std::string>::iterator f(moonsDotD.begin());f!=moonsDotD.end();++f) {
std::size_t dot = f->find_last_of('.');
if ((dot == 16)&&(f->substr(16) == ".moon"))
_node->orbit(Utils::hexStrToU64(f->substr(0,dot).c_str()));
_node->orbit(Utils::hexStrToU64(f->substr(0,dot).c_str()),0);
}
}