From 72def658d0ad8dda1e1735f6b28a7a0ec0235c22 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Wed, 26 Apr 2017 08:42:49 -0700 Subject: Add a dummy Ethernet tap and a build option to enable it. --- service/OneService.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'service/OneService.cpp') diff --git a/service/OneService.cpp b/service/OneService.cpp index b151d25d..988e723d 100644 --- a/service/OneService.cpp +++ b/service/OneService.cpp @@ -89,14 +89,19 @@ using json = nlohmann::json; #include "../controller/EmbeddedNetworkController.hpp" -// Include the right tap device driver for this platform -- add new platforms here +#ifdef ZT_USE_TEST_TAP + +#include "../osdep/TestEthernetTap.hpp" +namespace ZeroTier { typedef TestEthernetTap EthernetTap; } + +#else + #ifdef ZT_SERVICE_NETCON -// In network containers builds, use the virtual netcon endpoint instead of a tun/tap port driver #include "../netcon/NetconEthernetTap.hpp" namespace ZeroTier { typedef NetconEthernetTap EthernetTap; } -#else // not ZT_SERVICE_NETCON so pick a tap driver +#else #ifdef __APPLE__ #include "../osdep/OSXEthernetTap.hpp" @@ -121,9 +126,11 @@ namespace ZeroTier { typedef BSDEthernetTap EthernetTap; } #endif // ZT_SERVICE_NETCON +#endif // ZT_USE_TEST_TAP + // Sanity limits for HTTP #define ZT_MAX_HTTP_MESSAGE_SIZE (1024 * 1024 * 64) -#define ZT_MAX_HTTP_CONNECTIONS 64 +#define ZT_MAX_HTTP_CONNECTIONS 65536 // Interface metric for ZeroTier taps -- this ensures that if we are on WiFi and also // bridged via ZeroTier to the same LAN traffic will (if the OS is sane) prefer WiFi. -- cgit v1.2.3