Put kext back in Mac distro and use on versions older than High Sierra (which lack the feth device)
This commit is contained in:
parent
6073e7972f
commit
aca31c7055
17 changed files with 2094 additions and 915 deletions
|
@ -33,16 +33,15 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
#include <stdexcept>
|
||||
#include <atomic>
|
||||
|
||||
#include "../node/MulticastGroup.hpp"
|
||||
#include "Thread.hpp"
|
||||
#include "EthernetTap.hpp"
|
||||
|
||||
namespace ZeroTier {
|
||||
|
||||
/**
|
||||
* Linux Ethernet tap using kernel tun/tap driver
|
||||
*/
|
||||
class LinuxEthernetTap
|
||||
class LinuxEthernetTap : public EthernetTap
|
||||
{
|
||||
public:
|
||||
LinuxEthernetTap(
|
||||
|
@ -55,21 +54,21 @@ public:
|
|||
void (*handler)(void *,void *,uint64_t,const MAC &,const MAC &,unsigned int,unsigned int,const void *,unsigned int),
|
||||
void *arg);
|
||||
|
||||
~LinuxEthernetTap();
|
||||
virtual ~LinuxEthernetTap();
|
||||
|
||||
void setEnabled(bool en);
|
||||
bool enabled() const;
|
||||
bool addIp(const InetAddress &ip);
|
||||
virtual void setEnabled(bool en);
|
||||
virtual bool enabled() const;
|
||||
virtual bool addIp(const InetAddress &ip);
|
||||
#ifdef __SYNOLOGY__
|
||||
bool addIpSyn(std::vector<InetAddress> ips);
|
||||
#endif
|
||||
bool removeIp(const InetAddress &ip);
|
||||
std::vector<InetAddress> ips() const;
|
||||
void put(const MAC &from,const MAC &to,unsigned int etherType,const void *data,unsigned int len);
|
||||
std::string deviceName() const;
|
||||
void setFriendlyName(const char *friendlyName);
|
||||
void scanMulticastGroups(std::vector<MulticastGroup> &added,std::vector<MulticastGroup> &removed);
|
||||
void setMtu(unsigned int mtu);
|
||||
virtual bool removeIp(const InetAddress &ip);
|
||||
virtual std::vector<InetAddress> ips() const;
|
||||
virtual void put(const MAC &from,const MAC &to,unsigned int etherType,const void *data,unsigned int len);
|
||||
virtual std::string deviceName() const;
|
||||
virtual void setFriendlyName(const char *friendlyName);
|
||||
virtual void scanMulticastGroups(std::vector<MulticastGroup> &added,std::vector<MulticastGroup> &removed);
|
||||
virtual void setMtu(unsigned int mtu);
|
||||
|
||||
void threadMain()
|
||||
throw();
|
||||
|
@ -85,7 +84,7 @@ private:
|
|||
unsigned int _mtu;
|
||||
int _fd;
|
||||
int _shutdownSignalPipe[2];
|
||||
volatile bool _enabled;
|
||||
std::atomic_bool _enabled;
|
||||
};
|
||||
|
||||
} // namespace ZeroTier
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue