summaryrefslogtreecommitdiff
path: root/node/Node.hpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2013-12-12 13:02:02 -0800
committerAdam Ierymenko <adam.ierymenko@gmail.com>2013-12-12 13:02:02 -0800
commit54d1b11b1981481ba177c8f7c84c179977f5652d (patch)
treeaa8eacfe1d0badfca3f9cb6e9856b9f458e1a785 /node/Node.hpp
parentf038ed9ca2f3e65e063571e77cd48f1072f2d3e3 (diff)
parent68defd998008e83e5348d29cab5535dab3d444e8 (diff)
downloadinfinitytier-54d1b11b1981481ba177c8f7c84c179977f5652d.tar.gz
infinitytier-54d1b11b1981481ba177c8f7c84c179977f5652d.zip
Merge branch 'adamierymenko-dev'
Diffstat (limited to 'node/Node.hpp')
-rw-r--r--node/Node.hpp44
1 files changed, 32 insertions, 12 deletions
diff --git a/node/Node.hpp b/node/Node.hpp
index 238b5fce..2736713f 100644
--- a/node/Node.hpp
+++ b/node/Node.hpp
@@ -25,8 +25,11 @@
* LLC. Start here: http://www.zerotier.com/
*/
-#ifndef _ZT_NODE_HPP
-#define _ZT_NODE_HPP
+#ifndef ZT_NODE_HPP
+#define ZT_NODE_HPP
+
+#include <string>
+#include <vector>
namespace ZeroTier {
@@ -70,6 +73,16 @@ 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
+ *
+ * @param line Line to split
+ * @return Vector of fields
+ */
+ static std::vector<std::string> splitLine(const char *line);
+ static inline std::vector<std::string> splitLine(const std::string &line) { return splitLine(line.c_str()); }
private:
// LocalClient is not copyable
@@ -84,9 +97,24 @@ public:
*/
enum ReasonForTermination
{
+ /**
+ * Node is currently in run()
+ */
NODE_RUNNING = 0,
+
+ /**
+ * Node is shutting down for normal reasons, including a signal
+ */
NODE_NORMAL_TERMINATION = 1,
- NODE_RESTART_FOR_RECONFIGURATION = 2,
+
+ /**
+ * An upgrade is available. Its path is in reasonForTermination().
+ */
+ NODE_RESTART_FOR_UPGRADE = 2,
+
+ /**
+ * A serious unrecoverable error has occurred.
+ */
NODE_UNRECOVERABLE_ERROR = 3
};
@@ -140,7 +168,7 @@ public:
/**
* Get the ZeroTier version in major.minor.revision string format
- *
+ *
* @return Version in string form
*/
static const char *versionString()
@@ -158,14 +186,6 @@ private:
void *const _impl; // private implementation
};
-/**
- * An embedded version code that can be searched for in the binary
- *
- * This shouldn't be used by users, but is exported to make certain that
- * the linker actually includes it in the image.
- */
-extern const unsigned char EMBEDDED_VERSION_STAMP[20];
-
} // namespace ZeroTier
extern "C" {