mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-03-21 03:25:16 +00:00
Path fixes in osnet/ stuff
This commit is contained in:
parent
b80c229d87
commit
98d426e1d5
@ -43,6 +43,7 @@ CXXFLAGS=$(CFLAGS) -fno-rtti
|
||||
include objects.mk
|
||||
|
||||
OBJS+=osnet/BSDRoutingTable.o
|
||||
#osnet/OSXEthernetTap.o osnet/OSXEthernetTapFactory.o
|
||||
|
||||
all: one
|
||||
|
||||
|
@ -95,11 +95,6 @@ public:
|
||||
* @param destroyPersistentDevices If true, destroy persistent device (on platforms where applicable)
|
||||
*/
|
||||
virtual void close(EthernetTap *tap,bool destroyPersistentDevices) = 0;
|
||||
|
||||
/**
|
||||
* @return All currently open tap device names
|
||||
*/
|
||||
virtual std::vector<std::string> allTapDeviceNames() const = 0;
|
||||
};
|
||||
|
||||
} // namespace ZeroTier
|
||||
|
@ -52,9 +52,9 @@
|
||||
#include <set>
|
||||
#include <algorithm>
|
||||
|
||||
#include "../Constants.hpp"
|
||||
#include "../Utils.hpp"
|
||||
#include "../Mutex.hpp"
|
||||
#include "../node/Constants.hpp"
|
||||
#include "../node/Utils.hpp"
|
||||
#include "../node/Mutex.hpp"
|
||||
#include "LinuxEthernetTap.hpp"
|
||||
|
||||
// ff:ff:ff:ff:ff:ff with no ADI
|
||||
|
@ -33,9 +33,8 @@
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
#include "../EthernetTap.hpp"
|
||||
#include "../Mutex.hpp"
|
||||
#include "../Thread.hpp"
|
||||
#include "../node/EthernetTap.hpp"
|
||||
#include "../node/Thread.hpp"
|
||||
|
||||
namespace ZeroTier {
|
||||
|
||||
|
@ -71,13 +71,4 @@ void LinuxEthernetTapFactory::close(EthernetTap *tap,bool destroyPersistentDevic
|
||||
delete tap;
|
||||
}
|
||||
|
||||
std::vector<std::string> allTapDeviceNames() const
|
||||
{
|
||||
std::vector<std::string> dn;
|
||||
Mutex::Lock _l(_devices_m);
|
||||
for(std::vector<EthernetTap *>::const_iterator d(_devices.begin());d!=_devices.end();++d)
|
||||
dn.push_back(d->deviceName());
|
||||
return dn;
|
||||
}
|
||||
|
||||
} // namespace ZeroTier
|
||||
|
@ -31,8 +31,8 @@
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
#include "../EthernetTapFactory.hpp"
|
||||
#include "../Mutex.hpp"
|
||||
#include "../node/EthernetTapFactory.hpp"
|
||||
#include "../node/Mutex.hpp"
|
||||
|
||||
namespace ZeroTier {
|
||||
|
||||
@ -52,7 +52,6 @@ public:
|
||||
void (*handler)(void *,const MAC &,const MAC &,unsigned int,const Buffer<4096> &),
|
||||
void *arg);
|
||||
virtual void close(EthernetTap *tap,bool destroyPersistentDevices);
|
||||
virtual std::vector<std::string> allTapDeviceNames() const;
|
||||
|
||||
private:
|
||||
std::vector<EthernetTap *> _devices;
|
||||
|
@ -259,9 +259,8 @@ static inline void _intl_freeifmaddrs(struct _intl_ifmaddrs *ifmp)
|
||||
#include <set>
|
||||
#include <algorithm>
|
||||
|
||||
#include "../Constants.hpp"
|
||||
#include "../Utils.hpp"
|
||||
#include "../Mutex.hpp"
|
||||
#include "../node/Constants.hpp"
|
||||
#include "../node/Utils.hpp"
|
||||
#include "OSXEthernetTap.hpp"
|
||||
|
||||
// ff:ff:ff:ff:ff:ff with no ADI
|
||||
@ -314,7 +313,6 @@ namespace ZeroTier {
|
||||
static Mutex __tapCreateLock;
|
||||
|
||||
OSXEthernetTap::OSXEthernetTap(
|
||||
const RuntimeEnvironment *renv,
|
||||
const char *tryToGetDevice,
|
||||
const MAC &mac,
|
||||
unsigned int mtu,
|
||||
@ -447,11 +445,8 @@ bool OSXEthernetTap::addIP(const InetAddress &ip)
|
||||
// Remove and reconfigure if address is the same but netmask is different
|
||||
for(std::set<InetAddress>::iterator i(allIps.begin());i!=allIps.end();++i) {
|
||||
if ((i->ipsEqual(ip))&&(i->netmaskBits() != ip.netmaskBits())) {
|
||||
if (___removeIp(_dev,*i)) {
|
||||
if (___removeIp(_dev,*i))
|
||||
break;
|
||||
} else {
|
||||
LOG("WARNING: failed to remove old IP/netmask %s to replace with %s",i->toString().c_str(),ip.toString().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,9 +33,8 @@
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
#include "../EthernetTap.hpp"
|
||||
#include "../Mutex.hpp"
|
||||
#include "../Thread.hpp"
|
||||
#include "../node/EthernetTap.hpp"
|
||||
#include "../node/Thread.hpp"
|
||||
|
||||
namespace ZeroTier {
|
||||
|
||||
|
@ -114,13 +114,4 @@ void OSXEthernetTapFactory::close(EthernetTap *tap,bool destroyPersistentDevices
|
||||
delete tap;
|
||||
}
|
||||
|
||||
std::vector<std::string> allTapDeviceNames() const
|
||||
{
|
||||
std::vector<std::string> dn;
|
||||
Mutex::Lock _l(_devices_m);
|
||||
for(std::vector<EthernetTap *>::const_iterator d(_devices.begin());d!=_devices.end();++d)
|
||||
dn.push_back(d->deviceName());
|
||||
return dn;
|
||||
}
|
||||
|
||||
} // namespace ZeroTier
|
||||
|
@ -31,8 +31,8 @@
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
#include "../EthernetTapFactory.hpp"
|
||||
#include "../Mutex.hpp"
|
||||
#include "../node/EthernetTapFactory.hpp"
|
||||
#include "../node/Mutex.hpp"
|
||||
|
||||
namespace ZeroTier {
|
||||
|
||||
@ -63,7 +63,6 @@ public:
|
||||
void (*handler)(void *,const MAC &,const MAC &,unsigned int,const Buffer<4096> &),
|
||||
void *arg);
|
||||
virtual void close(EthernetTap *tap,bool destroyPersistentDevices);
|
||||
virtual std::vector<std::string> allTapDeviceNames() const;
|
||||
|
||||
private:
|
||||
std::vector<EthernetTap *> _devices;
|
||||
|
Loading…
x
Reference in New Issue
Block a user