summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2017-06-01 17:21:04 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2017-06-01 17:21:04 -0700
commite8d11eb5c548deecf75daa9542da6e27e17acff6 (patch)
treee32e00335ed17445015dd7503071114cc18218ac
parent7f4da08ff7af6f5d2a06001f70dae906a859c66e (diff)
downloadinfinitytier-e8d11eb5c548deecf75daa9542da6e27e17acff6.tar.gz
infinitytier-e8d11eb5c548deecf75daa9542da6e27e17acff6.zip
.
-rw-r--r--attic/tcp-proxy/Makefile (renamed from tcp-proxy/Makefile)0
-rw-r--r--attic/tcp-proxy/README.md (renamed from tcp-proxy/README.md)0
-rw-r--r--attic/tcp-proxy/tcp-proxy.cpp (renamed from tcp-proxy/tcp-proxy.cpp)0
-rw-r--r--service/OneService.cpp32
-rw-r--r--service/OneService.hpp45
5 files changed, 16 insertions, 61 deletions
diff --git a/tcp-proxy/Makefile b/attic/tcp-proxy/Makefile
index af4e71e3..af4e71e3 100644
--- a/tcp-proxy/Makefile
+++ b/attic/tcp-proxy/Makefile
diff --git a/tcp-proxy/README.md b/attic/tcp-proxy/README.md
index 6f347d64..6f347d64 100644
--- a/tcp-proxy/README.md
+++ b/attic/tcp-proxy/README.md
diff --git a/tcp-proxy/tcp-proxy.cpp b/attic/tcp-proxy/tcp-proxy.cpp
index a7906aae..a7906aae 100644
--- a/tcp-proxy/tcp-proxy.cpp
+++ b/attic/tcp-proxy/tcp-proxy.cpp
diff --git a/service/OneService.cpp b/service/OneService.cpp
index 1fabb7d9..7d290df7 100644
--- a/service/OneService.cpp
+++ b/service/OneService.cpp
@@ -85,16 +85,6 @@
using json = nlohmann::json;
-/**
- * Uncomment to enable UDP breakage switch
- *
- * If this is defined, the presence of a file called /tmp/ZT_BREAK_UDP
- * will cause direct UDP TX/RX to stop working. This can be used to
- * test TCP tunneling fallback and other robustness features. Deleting
- * this file will cause it to start working again.
- */
-//#define ZT_BREAK_UDP
-
#include "../controller/EmbeddedNetworkController.hpp"
#ifdef ZT_USE_TEST_TAP
@@ -105,11 +95,13 @@ namespace ZeroTier { typedef TestEthernetTap EthernetTap; }
#else
#ifdef ZT_SDK
- #include "../controller/EmbeddedNetworkController.hpp"
- #include "../node/Node.hpp"
- // Use the virtual netcon endpoint instead of a tun/tap port driver
- #include "../src/SocketTap.hpp"
- namespace ZeroTier { typedef SocketTap EthernetTap; }
+
+#include "../controller/EmbeddedNetworkController.hpp"
+#include "../node/Node.hpp"
+// Use the virtual netcon endpoint instead of a tun/tap port driver
+#include "../src/SocketTap.hpp"
+namespace ZeroTier { typedef SocketTap EthernetTap; }
+
#else
#ifdef __APPLE__
@@ -1783,11 +1775,6 @@ public:
}
#endif
-#ifdef ZT_BREAK_UDP
- if (OSUtils::fileExists("/tmp/ZT_BREAK_UDP"))
- return;
-#endif
-
if ((len >= 16)&&(reinterpret_cast<const InetAddress *>(from)->ipScope() == InetAddress::IP_SCOPE_GLOBAL))
_lastDirectReceiveFromGlobal = OSUtils::now();
@@ -2271,11 +2258,6 @@ public:
return -1;
}
-#ifdef ZT_BREAK_UDP
- if (OSUtils::fileExists("/tmp/ZT_BREAK_UDP"))
- return 0; // silently break UDP
-#endif
-
return (_bindings[fromBindingNo].udpSend(_phy,*(reinterpret_cast<const InetAddress *>(localAddr)),*(reinterpret_cast<const InetAddress *>(addr)),data,len,ttl)) ? 0 : -1;
}
diff --git a/service/OneService.hpp b/service/OneService.hpp
index b770a3c0..eba10ca0 100644
--- a/service/OneService.hpp
+++ b/service/OneService.hpp
@@ -33,10 +33,10 @@
#include "../node/InetAddress.hpp"
#ifdef ZT_SDK
- #include "../node/Node.hpp"
- // Use the virtual netcon endpoint instead of a tun/tap port driver
- #include "../src/SocketTap.hpp"
- namespace ZeroTier { typedef SocketTap EthernetTap; }
+#include "../node/Node.hpp"
+// Use the virtual netcon endpoint instead of a tun/tap port driver
+#include "../src/SocketTap.hpp"
+namespace ZeroTier { typedef SocketTap EthernetTap; }
#endif
namespace ZeroTier {
@@ -147,42 +147,15 @@ public:
virtual std::string portDeviceName(uint64_t nwid) const = 0;
#ifdef ZT_SDK
- /**
- * Leaves a network
- */
- virtual void leave(const char *hp) = 0;
-
- /**
- * Joins a network
- */
+ virtual void leave(const char *hp) = 0;
virtual void join(const char *hp) = 0;
-
- /**
- * Returns the homePath given by the client application
- */
- virtual std::string givenHomePath() = 0;
-
- /*
- * Returns a SocketTap that is associated with the given nwid
- */
- virtual EthernetTap * getTap(uint64_t nwid) = 0;
-
- /*
- * Returns a SocketTap that cant function as a route to the specified host
- */
- virtual EthernetTap * getTap(InetAddress &addr) = 0;
-
- /*
- * Returns a pointer to the Node
- */
+ virtual std::string givenHomePath() = 0;
+ virtual EthernetTap * getTap(uint64_t nwid) = 0;
+ virtual EthernetTap * getTap(InetAddress &addr) = 0;
virtual Node * getNode() = 0;
-
- /*
- * Delete all SocketTap interfaces
- */
virtual void removeNets() = 0;
#endif
-
+
/**
* Terminate background service (can be called from other threads)
*/