summaryrefslogtreecommitdiff
path: root/osnet
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2014-07-31 14:09:32 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2014-07-31 14:09:32 -0700
commitb80c229d873ca51bf679ff9df90c8360dca5d0d7 (patch)
treee5c4342b78dcb83f6c9312fff42d073e1f134ae3 /osnet
parent9b93141dd0f39af70a867231ce8ba7cb34cd23e6 (diff)
downloadinfinitytier-b80c229d873ca51bf679ff9df90c8360dca5d0d7.tar.gz
infinitytier-b80c229d873ca51bf679ff9df90c8360dca5d0d7.zip
Tons of code cleanup, refactor Network to use EthernetTapFactory, probably also fix GitHub issue #90
Diffstat (limited to 'osnet')
-rw-r--r--osnet/BSDRoutingTable.cpp2
-rw-r--r--osnet/BSDRoutingTable.hpp2
-rw-r--r--osnet/LinuxEthernetTap.cpp3
-rw-r--r--osnet/LinuxEthernetTap.hpp2
-rw-r--r--osnet/LinuxEthernetTapFactory.cpp2
-rw-r--r--osnet/LinuxEthernetTapFactory.hpp2
-rw-r--r--osnet/OSXEthernetTap.cpp3
-rw-r--r--osnet/OSXEthernetTap.hpp2
-rw-r--r--osnet/OSXEthernetTapFactory.cpp2
-rw-r--r--osnet/OSXEthernetTapFactory.hpp2
10 files changed, 10 insertions, 12 deletions
diff --git a/osnet/BSDRoutingTable.cpp b/osnet/BSDRoutingTable.cpp
index fede9cce..63dd5cef 100644
--- a/osnet/BSDRoutingTable.cpp
+++ b/osnet/BSDRoutingTable.cpp
@@ -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.
diff --git a/osnet/BSDRoutingTable.hpp b/osnet/BSDRoutingTable.hpp
index c0e98943..b498d5ce 100644
--- a/osnet/BSDRoutingTable.hpp
+++ b/osnet/BSDRoutingTable.hpp
@@ -28,7 +28,7 @@
#ifndef ZT_BSDROUTINGTABLE_HPP
#define ZT_BSDROUTINGTABLE_HPP
-#include "../RoutingTable.hpp"
+#include "../node/RoutingTable.hpp"
namespace ZeroTier {
diff --git a/osnet/LinuxEthernetTap.cpp b/osnet/LinuxEthernetTap.cpp
index 0b0c1c4f..d77d56c0 100644
--- a/osnet/LinuxEthernetTap.cpp
+++ b/osnet/LinuxEthernetTap.cpp
@@ -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)
diff --git a/osnet/LinuxEthernetTap.hpp b/osnet/LinuxEthernetTap.hpp
index e6aea2ec..f74fdf86 100644
--- a/osnet/LinuxEthernetTap.hpp
+++ b/osnet/LinuxEthernetTap.hpp
@@ -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()
diff --git a/osnet/LinuxEthernetTapFactory.cpp b/osnet/LinuxEthernetTapFactory.cpp
index fccb6bd5..01633abb 100644
--- a/osnet/LinuxEthernetTapFactory.cpp
+++ b/osnet/LinuxEthernetTapFactory.cpp
@@ -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);
diff --git a/osnet/LinuxEthernetTapFactory.hpp b/osnet/LinuxEthernetTapFactory.hpp
index a5d13216..695fe52e 100644
--- a/osnet/LinuxEthernetTapFactory.hpp
+++ b/osnet/LinuxEthernetTapFactory.hpp
@@ -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:
diff --git a/osnet/OSXEthernetTap.cpp b/osnet/OSXEthernetTap.cpp
index 1e2ddbed..164b24a2 100644
--- a/osnet/OSXEthernetTap.cpp
+++ b/osnet/OSXEthernetTap.cpp
@@ -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)
diff --git a/osnet/OSXEthernetTap.hpp b/osnet/OSXEthernetTap.hpp
index 7ca63730..680fef15 100644
--- a/osnet/OSXEthernetTap.hpp
+++ b/osnet/OSXEthernetTap.hpp
@@ -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()
diff --git a/osnet/OSXEthernetTapFactory.cpp b/osnet/OSXEthernetTapFactory.cpp
index 4d0f2069..223cec7f 100644
--- a/osnet/OSXEthernetTapFactory.cpp
+++ b/osnet/OSXEthernetTapFactory.cpp
@@ -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);
diff --git a/osnet/OSXEthernetTapFactory.hpp b/osnet/OSXEthernetTapFactory.hpp
index 720e038a..2368d982 100644
--- a/osnet/OSXEthernetTapFactory.hpp
+++ b/osnet/OSXEthernetTapFactory.hpp
@@ -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: