summaryrefslogtreecommitdiff
path: root/service/OneService.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'service/OneService.hpp')
-rw-r--r--service/OneService.hpp59
1 files changed, 34 insertions, 25 deletions
diff --git a/service/OneService.hpp b/service/OneService.hpp
index cead381d..3b670e4a 100644
--- a/service/OneService.hpp
+++ b/service/OneService.hpp
@@ -1,6 +1,6 @@
/*
* ZeroTier One - Network Virtualization Everywhere
- * Copyright (C) 2011-2016 ZeroTier, Inc. https://www.zerotier.com/
+ * Copyright (C) 2011-2018 ZeroTier, Inc. https://www.zerotier.com/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -14,29 +14,35 @@
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * --
+ *
+ * You can be released from the requirements of the license by purchasing
+ * a commercial license. Buying such a license is mandatory as soon as you
+ * develop commercial closed-source software that incorporates or links
+ * directly against ZeroTier software without disclosing the source code
+ * of your own application.
*/
#ifndef ZT_ONESERVICE_HPP
#define ZT_ONESERVICE_HPP
#include <string>
+#include <vector>
+
+#include "../node/InetAddress.hpp"
+
+#ifdef ZT_SDK
+#include "../node/Node.hpp"
+// Use the virtual netcon endpoint instead of a tun/tap port driver
+#include "../include/VirtualTap.h"
+namespace ZeroTier { typedef VirtualTap EthernetTap; }
+#endif
namespace ZeroTier {
/**
* Local service for ZeroTier One as system VPN/NFV provider
- *
- * If built with ZT_ENABLE_NETWORK_CONTROLLER defined, this includes and
- * runs controller/SqliteNetworkController with a database called
- * controller.db in the specified home directory.
- *
- * If built with ZT_AUTO_UPDATE, an official ZeroTier update URL is
- * periodically checked and updates are automatically downloaded, verified
- * against a built-in list of update signing keys, and installed. This is
- * only supported for certain platforms.
- *
- * If built with ZT_ENABLE_CLUSTER, a 'cluster' file is checked and if
- * present is read to determine the identity of other cluster members.
*/
class OneService
{
@@ -78,6 +84,12 @@ public:
bool allowManaged;
/**
+ * Whitelist of addresses that can be configured by this network.
+ * If empty and allowManaged is true, allow all private/pseudoprivate addresses.
+ */
+ std::vector<InetAddress> allowManagedWhitelist;
+
+ /**
* Allow configuration of IPs and routes within global (Internet) IP space?
*/
bool allowGlobal;
@@ -94,11 +106,6 @@ public:
static std::string platformDefaultHomePath();
/**
- * @return Auto-update URL or empty string if auto-updates unsupported or not enabled
- */
- static std::string autoUpdateUrl();
-
- /**
* Create a new instance of the service
*
* Once created, you must call the run() method to actually start
@@ -111,9 +118,7 @@ public:
* @param hp Home path
* @param port TCP and UDP port for packets and HTTP control (if 0, pick random port)
*/
- static OneService *newInstance(
- const char *hp,
- unsigned int port);
+ static OneService *newInstance(const char *hp,unsigned int port);
virtual ~OneService();
@@ -141,10 +146,14 @@ public:
*/
virtual std::string portDeviceName(uint64_t nwid) const = 0;
- /**
- * @return True if TCP fallback is currently active
- */
- virtual bool tcpFallbackActive() const = 0;
+#ifdef ZT_SDK
+ virtual void leave(const uint64_t hp) = 0;
+ virtual void join(const uint64_t hp) = 0;
+ virtual std::string givenHomePath() = 0;
+ virtual Node * getNode() = 0;
+ virtual void removeNets() = 0;
+ virtual std::vector<ZT_VirtualNetworkRoute> *getRoutes(uint64_t nwid) = 0;
+#endif
/**
* Terminate background service (can be called from other threads)