summaryrefslogtreecommitdiff
path: root/node/NodeConfig.cpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2013-08-30 15:02:12 -0400
committerAdam Ierymenko <adam.ierymenko@gmail.com>2013-08-30 15:02:12 -0400
commit4875eb49f851d7919587cbc2059ff552a24bcfc1 (patch)
tree5e3080f1f264fa678d0223184db74db8d805c11d /node/NodeConfig.cpp
parent11774f7d5fe14226e99118f95346deda51baa254 (diff)
downloadinfinitytier-4875eb49f851d7919587cbc2059ff552a24bcfc1.tar.gz
infinitytier-4875eb49f851d7919587cbc2059ff552a24bcfc1.zip
Remove old launcher code, fix build error in idtool, add terminate command to control bus.
Diffstat (limited to 'node/NodeConfig.cpp')
-rw-r--r--node/NodeConfig.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/node/NodeConfig.cpp b/node/NodeConfig.cpp
index 2cfd0cae..bc7c35f4 100644
--- a/node/NodeConfig.cpp
+++ b/node/NodeConfig.cpp
@@ -55,6 +55,7 @@
#include "Peer.hpp"
#include "Salsa20.hpp"
#include "HMAC.hpp"
+#include "Node.hpp"
#ifdef __WINDOWS__
#define strtoull _strtoui64
@@ -170,6 +171,7 @@ std::vector<std::string> NodeConfig::execute(const char *command)
_P("200 help listnetworks");
_P("200 help join <network ID>");
_P("200 help leave <network ID>");
+ _P("200 help terminate [<reason>]");
} else if (cmd[0] == "listpeers") {
_P("200 listpeers <ztaddr> <ipv4> <ipv6> <latency> <version>");
_r->topology->eachPeer(_DumpPeerStatistics(r));
@@ -231,6 +233,10 @@ std::vector<std::string> NodeConfig::execute(const char *command)
} else {
_P("400 leave requires a network ID (>0) in hexadecimal format");
}
+ } else if (cmd[0] == "terminate") {
+ if (cmd.size() > 1)
+ _r->node->terminate(Node::NODE_NORMAL_TERMINATION,cmd[1].c_str());
+ else _r->node->terminate(Node::NODE_NORMAL_TERMINATION,(const char *)0);
} else {
_P("404 %s No such command. Use 'help' for help.",cmd[0].c_str());
}