mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-06 12:33:44 +02:00
Netcon mode for Linux (in this branch, will make conditional later)
This commit is contained in:
parent
dfb08ec753
commit
1f4c667646
3 changed files with 22 additions and 7 deletions
|
@ -29,11 +29,11 @@ endif
|
||||||
UNAME_M=$(shell uname -m)
|
UNAME_M=$(shell uname -m)
|
||||||
|
|
||||||
INCLUDES=
|
INCLUDES=
|
||||||
DEFS=
|
DEFS=-DZT_ENABLE_NETCON
|
||||||
LDLIBS?=
|
LDLIBS?=
|
||||||
|
|
||||||
include objects.mk
|
include objects.mk
|
||||||
OBJS+=osdep/LinuxEthernetTap.o
|
OBJS+=osdep/LinuxEthernetTap.o netcon/NetconEthernetTap.o
|
||||||
|
|
||||||
# "make official" is a shortcut for this
|
# "make official" is a shortcut for this
|
||||||
ifeq ($(ZT_OFFICIAL_RELEASE),1)
|
ifeq ($(ZT_OFFICIAL_RELEASE),1)
|
||||||
|
|
|
@ -62,7 +62,7 @@ NetconEthernetTap::NetconEthernetTap(
|
||||||
_dev = sockPath;
|
_dev = sockPath;
|
||||||
|
|
||||||
_unixListenSocket = _phy.unixListen(sockPath,(void *)this);
|
_unixListenSocket = _phy.unixListen(sockPath,(void *)this);
|
||||||
if (!_unixSocket)
|
if (!_unixListenSocket)
|
||||||
throw std::runtime_error(std::string("unable to bind to ")+sockPath);
|
throw std::runtime_error(std::string("unable to bind to ")+sockPath);
|
||||||
|
|
||||||
_thread = Thread::start(this);
|
_thread = Thread::start(this);
|
||||||
|
|
|
@ -90,22 +90,37 @@ class SqliteNetworkController;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Include the right tap device driver for this platform -- add new platforms here
|
// Include the right tap device driver for this platform -- add new platforms here
|
||||||
|
#ifdef ZT_ENABLE_NETCON
|
||||||
|
|
||||||
|
#include "../netcon/NetconEthernetTap.hpp"
|
||||||
|
namespace ZeroTier { typedef NetconEthernetTap EthernetTap; }
|
||||||
|
|
||||||
|
#else
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
|
|
||||||
#include "../osdep/OSXEthernetTap.hpp"
|
#include "../osdep/OSXEthernetTap.hpp"
|
||||||
namespace ZeroTier { typedef OSXEthernetTap EthernetTap; }
|
namespace ZeroTier { typedef OSXEthernetTap EthernetTap; }
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef __LINUX__
|
#ifdef __LINUX__
|
||||||
|
|
||||||
#include "../osdep/LinuxEthernetTap.hpp"
|
#include "../osdep/LinuxEthernetTap.hpp"
|
||||||
namespace ZeroTier { typedef LinuxEthernetTap EthernetTap; }
|
namespace ZeroTier { typedef LinuxEthernetTap EthernetTap; }
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef __WINDOWS__
|
#ifdef __WINDOWS__
|
||||||
|
|
||||||
#include "../osdep/WindowsEthernetTap.hpp"
|
#include "../osdep/WindowsEthernetTap.hpp"
|
||||||
namespace ZeroTier { typedef WindowsEthernetTap EthernetTap; }
|
namespace ZeroTier { typedef WindowsEthernetTap EthernetTap; }
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef __FreeBSD__
|
#ifdef __FreeBSD__
|
||||||
|
|
||||||
#include "../osdep/BSDEthernetTap.hpp"
|
#include "../osdep/BSDEthernetTap.hpp"
|
||||||
namespace ZeroTier { typedef BSDEthernetTap EthernetTap; }
|
namespace ZeroTier { typedef BSDEthernetTap EthernetTap; }
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
#endif // ZT_ENABLE_NETCON
|
||||||
|
|
||||||
// Sanity limits for HTTP
|
// Sanity limits for HTTP
|
||||||
#define ZT_MAX_HTTP_MESSAGE_SIZE (1024 * 1024 * 64)
|
#define ZT_MAX_HTTP_MESSAGE_SIZE (1024 * 1024 * 64)
|
||||||
|
|
Loading…
Add table
Reference in a new issue