summaryrefslogtreecommitdiff
path: root/node
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2013-11-20 16:16:30 -0500
committerAdam Ierymenko <adam.ierymenko@gmail.com>2013-11-20 16:16:30 -0500
commitc979a695c5c58a62c7e3e08128860634b2fc421f (patch)
tree5df9e8b591c5dc1ace745a85bdbd7346a8c01616 /node
parent902c8c38d261b1e73329ab4b9fefcfe11995c8b7 (diff)
downloadinfinitytier-c979a695c5c58a62c7e3e08128860634b2fc421f.tar.gz
infinitytier-c979a695c5c58a62c7e3e08128860634b2fc421f.zip
UI work, add name to listnetworks output in control bus interface.
Diffstat (limited to 'node')
-rw-r--r--node/Node.hpp4
-rw-r--r--node/NodeConfig.cpp5
2 files changed, 7 insertions, 2 deletions
diff --git a/node/Node.hpp b/node/Node.hpp
index 2f7d43ed..476ec7cd 100644
--- a/node/Node.hpp
+++ b/node/Node.hpp
@@ -28,6 +28,9 @@
#ifndef _ZT_NODE_HPP
#define _ZT_NODE_HPP
+#include <string>
+#include <vector>
+
namespace ZeroTier {
/**
@@ -70,6 +73,7 @@ public:
*/
unsigned long send(const char *command)
throw();
+ inline unsigned long send(const std::string &command) throw() { return send(command.c_str()); }
/**
* Split a line of results by space
diff --git a/node/NodeConfig.cpp b/node/NodeConfig.cpp
index 027f65ce..d56c73ae 100644
--- a/node/NodeConfig.cpp
+++ b/node/NodeConfig.cpp
@@ -200,7 +200,7 @@ std::vector<std::string> NodeConfig::execute(const char *command)
_r->topology->eachPeer(_DumpPeerStatistics(r));
} else if (cmd[0] == "listnetworks") {
Mutex::Lock _l(_networks_m);
- _P("200 listnetworks <nwid> <status> <type> <dev> <ips>");
+ _P("200 listnetworks <nwid> <name> <status> <type> <dev> <ips>");
for(std::map< uint64_t,SharedPtr<Network> >::const_iterator nw(_networks.begin());nw!=_networks.end();++nw) {
std::string tmp;
std::set<InetAddress> ips(nw->second->tap().ips());
@@ -211,8 +211,9 @@ std::vector<std::string> NodeConfig::execute(const char *command)
}
SharedPtr<NetworkConfig> nconf(nw->second->config2());
- _P("200 listnetworks %.16llx %s %s %s %s",
+ _P("200 listnetworks %.16llx %s %s %s %s %s",
(unsigned long long)nw->first,
+ ((nconf) ? nconf->name().c_str() : "?"),
Network::statusString(nw->second->status()),
((nconf) ? (nconf->isOpen() ? "public" : "private") : "?"),
nw->second->tap().deviceName().c_str(),