Browse Source

Path fixes in osnet/ stuff

pull/1/head
Adam Ierymenko 12 years ago
parent
commit
98d426e1d5
  1. 1
      make-mac.mk
  2. 5
      node/EthernetTapFactory.hpp
  3. 6
      osnet/LinuxEthernetTap.cpp
  4. 5
      osnet/LinuxEthernetTap.hpp
  5. 9
      osnet/LinuxEthernetTapFactory.cpp
  6. 5
      osnet/LinuxEthernetTapFactory.hpp
  7. 11
      osnet/OSXEthernetTap.cpp
  8. 5
      osnet/OSXEthernetTap.hpp
  9. 9
      osnet/OSXEthernetTapFactory.cpp
  10. 5
      osnet/OSXEthernetTapFactory.hpp

1
make-mac.mk

@ -43,6 +43,7 @@ CXXFLAGS=$(CFLAGS) -fno-rtti
include objects.mk
OBJS+=osnet/BSDRoutingTable.o
#osnet/OSXEthernetTap.o osnet/OSXEthernetTapFactory.o
all: one

5
node/EthernetTapFactory.hpp

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

6
osnet/LinuxEthernetTap.cpp

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

5
osnet/LinuxEthernetTap.hpp

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

9
osnet/LinuxEthernetTapFactory.cpp

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

5
osnet/LinuxEthernetTapFactory.hpp

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

11
osnet/OSXEthernetTap.cpp

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

5
osnet/OSXEthernetTap.hpp

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

9
osnet/OSXEthernetTapFactory.cpp

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

5
osnet/OSXEthernetTapFactory.hpp

@ -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…
Cancel
Save