Tons of code cleanup, refactor Network to use EthernetTapFactory, probably also fix GitHub issue #90

This commit is contained in:
Adam Ierymenko 2014-07-31 14:09:32 -07:00
commit b80c229d87
27 changed files with 169 additions and 1547 deletions

View file

@ -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.

View file

@ -28,7 +28,7 @@
#ifndef ZT_BSDROUTINGTABLE_HPP
#define ZT_BSDROUTINGTABLE_HPP
#include "../RoutingTable.hpp"
#include "../node/RoutingTable.hpp"
namespace ZeroTier {

View file

@ -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)

View file

@ -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()

View file

@ -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);

View file

@ -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:

View file

@ -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)

View file

@ -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()

View file

@ -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);

View file

@ -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: