mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-14 02:27:38 -07:00
Tons of code cleanup, refactor Network to use EthernetTapFactory, probably also fix GitHub issue #90
This commit is contained in:
parent
9b93141dd0
commit
b80c229d87
27 changed files with 169 additions and 1547 deletions
|
@ -43,7 +43,7 @@
|
|||
#include <algorithm>
|
||||
#include <utility>
|
||||
|
||||
#include "../Constants.hpp"
|
||||
#include "../node/Constants.hpp"
|
||||
#include "BSDRoutingTable.hpp"
|
||||
|
||||
// All I wanted was the bloody rounting table. I didn't expect the Spanish inquisition.
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#ifndef ZT_BSDROUTINGTABLE_HPP
|
||||
#define ZT_BSDROUTINGTABLE_HPP
|
||||
|
||||
#include "../RoutingTable.hpp"
|
||||
#include "../node/RoutingTable.hpp"
|
||||
|
||||
namespace ZeroTier {
|
||||
|
||||
|
|
|
@ -355,9 +355,8 @@ std::string LinuxEthernetTap::deviceName() const
|
|||
return _dev;
|
||||
}
|
||||
|
||||
std::string LinuxEthernetTap::persistentId() const
|
||||
void LinuxEthernetTap::setFriendlyName(const char *friendlyName)
|
||||
{
|
||||
return std::string();
|
||||
}
|
||||
|
||||
bool LinuxEthernetTap::updateMulticastGroups(std::set<MulticastGroup> &groups)
|
||||
|
|
|
@ -64,7 +64,7 @@ public:
|
|||
virtual std::set<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 std::string persistentId() const;
|
||||
virtual void setFriendlyName(const char *friendlyName);
|
||||
virtual bool updateMulticastGroups(std::set<MulticastGroup> &groups);
|
||||
|
||||
void threadMain()
|
||||
|
|
|
@ -57,7 +57,7 @@ EthernetTap *LinuxEthernetTapFactory::open(
|
|||
return t;
|
||||
}
|
||||
|
||||
void LinuxEthernetTapFactory::close(EthernetTap *tap)
|
||||
void LinuxEthernetTapFactory::close(EthernetTap *tap,bool destroyPersistentDevices)
|
||||
{
|
||||
{
|
||||
Mutex::Lock _l(_devices_m);
|
||||
|
|
|
@ -51,7 +51,7 @@ public:
|
|||
const char *friendlyName,
|
||||
void (*handler)(void *,const MAC &,const MAC &,unsigned int,const Buffer<4096> &),
|
||||
void *arg);
|
||||
virtual void close(EthernetTap *tap);
|
||||
virtual void close(EthernetTap *tap,bool destroyPersistentDevices);
|
||||
virtual std::vector<std::string> allTapDeviceNames() const;
|
||||
|
||||
private:
|
||||
|
|
|
@ -529,9 +529,8 @@ std::string OSXEthernetTap::deviceName() const
|
|||
return _dev;
|
||||
}
|
||||
|
||||
std::string OSXEthernetTap::persistentId() const
|
||||
void OSXEthernetTap::setFriendlyName(const char *friendlyName)
|
||||
{
|
||||
return std::string();
|
||||
}
|
||||
|
||||
bool OSXEthernetTap::updateMulticastGroups(std::set<MulticastGroup> &groups)
|
||||
|
|
|
@ -68,7 +68,7 @@ public:
|
|||
virtual std::set<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 std::string persistentId() const;
|
||||
virtual void setFriendlyName(const char *friendlyName);
|
||||
virtual bool updateMulticastGroups(std::set<MulticastGroup> &groups);
|
||||
|
||||
void threadMain()
|
||||
|
|
|
@ -100,7 +100,7 @@ EthernetTap *OSXEthernetTapFactory::open(
|
|||
return t;
|
||||
}
|
||||
|
||||
void OSXEthernetTapFactory::close(EthernetTap *tap)
|
||||
void OSXEthernetTapFactory::close(EthernetTap *tap,bool destroyPersistentDevices)
|
||||
{
|
||||
{
|
||||
Mutex::Lock _l(_devices_m);
|
||||
|
|
|
@ -62,7 +62,7 @@ public:
|
|||
const char *friendlyName,
|
||||
void (*handler)(void *,const MAC &,const MAC &,unsigned int,const Buffer<4096> &),
|
||||
void *arg);
|
||||
virtual void close(EthernetTap *tap);
|
||||
virtual void close(EthernetTap *tap,bool destroyPersistentDevices);
|
||||
virtual std::vector<std::string> allTapDeviceNames() const;
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue