summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2013-10-17 13:07:53 -0400
committerAdam Ierymenko <adam.ierymenko@gmail.com>2013-10-17 13:07:53 -0400
commit797bba04dd738f69aa0554800ab064f35b69e5b3 (patch)
tree2ae88439be5f7b4e598b15d4785eb5f64a90af1a
parentce14ba90045afa711506983c07ecc7e31c53f833 (diff)
downloadinfinitytier-797bba04dd738f69aa0554800ab064f35b69e5b3.tar.gz
infinitytier-797bba04dd738f69aa0554800ab064f35b69e5b3.zip
Get rid of not used and maybe never to be used Filter code.
-rw-r--r--attic/Filter.cpp (renamed from node/Filter.cpp)0
-rw-r--r--attic/Filter.hpp (renamed from node/Filter.hpp)0
-rw-r--r--node/PacketDecoder.cpp1
-rw-r--r--node/Switch.cpp25
-rw-r--r--node/Switch.hpp17
-rw-r--r--objects.mk1
6 files changed, 37 insertions, 7 deletions
diff --git a/node/Filter.cpp b/attic/Filter.cpp
index 6e28b7cd..6e28b7cd 100644
--- a/node/Filter.cpp
+++ b/attic/Filter.cpp
diff --git a/node/Filter.hpp b/attic/Filter.hpp
index 517b81c6..517b81c6 100644
--- a/node/Filter.hpp
+++ b/attic/Filter.hpp
diff --git a/node/PacketDecoder.cpp b/node/PacketDecoder.cpp
index f4100029..0e9bde17 100644
--- a/node/PacketDecoder.cpp
+++ b/node/PacketDecoder.cpp
@@ -39,7 +39,6 @@
#include "Switch.hpp"
#include "Peer.hpp"
#include "NodeConfig.hpp"
-#include "Filter.hpp"
#include "Service.hpp"
#include "Demarc.hpp"
diff --git a/node/Switch.cpp b/node/Switch.cpp
index c6cd7987..37184076 100644
--- a/node/Switch.cpp
+++ b/node/Switch.cpp
@@ -48,7 +48,6 @@
#include "Peer.hpp"
#include "NodeConfig.hpp"
#include "Demarc.hpp"
-#include "Filter.hpp"
#include "CMWC4096.hpp"
#include "../version.h"
@@ -89,12 +88,12 @@ void Switch::onLocalEthernet(const SharedPtr<Network> &network,const MAC &from,c
}
if (from != network->tap().mac()) {
- LOG("ignored tap: %s -> %s %s (bridging not supported)",from.toString().c_str(),to.toString().c_str(),Filter::etherTypeName(etherType));
+ LOG("ignored tap: %s -> %s %s (bridging not supported)",from.toString().c_str(),to.toString().c_str(),etherTypeName(etherType));
return;
}
if (!network->permitsEtherType(etherType)) {
- LOG("ignored tap: %s -> %s: ethertype %s not allowed on network %.16llx",from.toString().c_str(),to.toString().c_str(),Filter::etherTypeName(etherType),(unsigned long long)network->id());
+ LOG("ignored tap: %s -> %s: ethertype %s not allowed on network %.16llx",from.toString().c_str(),to.toString().c_str(),etherTypeName(etherType),(unsigned long long)network->id());
return;
}
@@ -177,10 +176,10 @@ void Switch::onLocalEthernet(const SharedPtr<Network> &network,const MAC &from,c
outp.compress();
send(outp,true);
} else {
- TRACE("UNICAST: %s -> %s %s (dropped, destination not a member of closed network %llu)",from.toString().c_str(),to.toString().c_str(),Filter::etherTypeName(etherType),network->id());
+ TRACE("UNICAST: %s -> %s %s (dropped, destination not a member of closed network %llu)",from.toString().c_str(),to.toString().c_str(),etherTypeName(etherType),network->id());
}
} else {
- TRACE("UNICAST: %s -> %s %s (dropped, destination MAC not ZeroTier)",from.toString().c_str(),to.toString().c_str(),Filter::etherTypeName(etherType));
+ TRACE("UNICAST: %s -> %s %s (dropped, destination MAC not ZeroTier)",from.toString().c_str(),to.toString().c_str(),etherTypeName(etherType));
}
}
@@ -501,6 +500,22 @@ void Switch::doAnythingWaitingForPeer(const SharedPtr<Peer> &peer)
}
}
+const char *Switch::etherTypeName(const unsigned int etherType)
+ throw()
+{
+ switch(etherType) {
+ case ZT_ETHERTYPE_IPV4: return "IPV4";
+ case ZT_ETHERTYPE_ARP: return "ARP";
+ case ZT_ETHERTYPE_RARP: return "RARP";
+ case ZT_ETHERTYPE_ATALK: return "ATALK";
+ case ZT_ETHERTYPE_AARP: return "AARP";
+ case ZT_ETHERTYPE_IPX_A: return "IPX_A";
+ case ZT_ETHERTYPE_IPX_B: return "IPX_B";
+ case ZT_ETHERTYPE_IPV6: return "IPV6";
+ }
+ return "UNKNOWN";
+}
+
void Switch::_handleRemotePacketFragment(Demarc::Port localPort,const InetAddress &fromAddr,const Buffer<4096> &data)
{
Packet::Fragment fragment(data);
diff --git a/node/Switch.hpp b/node/Switch.hpp
index 3cc6887c..68e3c6c4 100644
--- a/node/Switch.hpp
+++ b/node/Switch.hpp
@@ -48,6 +48,16 @@
#include "Multicaster.hpp"
#include "PacketDecoder.hpp"
+/* Ethernet frame types that might be relevant to us */
+#define ZT_ETHERTYPE_IPV4 0x0800
+#define ZT_ETHERTYPE_ARP 0x0806
+#define ZT_ETHERTYPE_RARP 0x8035
+#define ZT_ETHERTYPE_ATALK 0x809b
+#define ZT_ETHERTYPE_AARP 0x80f3
+#define ZT_ETHERTYPE_IPX_A 0x8137
+#define ZT_ETHERTYPE_IPX_B 0x8138
+#define ZT_ETHERTYPE_IPV6 0x86dd
+
namespace ZeroTier {
class RuntimeEnvironment;
@@ -195,6 +205,13 @@ public:
*/
void doAnythingWaitingForPeer(const SharedPtr<Peer> &peer);
+ /**
+ * @param etherType Ethernet type ID
+ * @return Human-readable name
+ */
+ static const char *etherTypeName(const unsigned int etherType)
+ throw();
+
private:
void _handleRemotePacketFragment(
Demarc::Port localPort,
diff --git a/objects.mk b/objects.mk
index cd8f6e46..41e1d83c 100644
--- a/objects.mk
+++ b/objects.mk
@@ -7,7 +7,6 @@ OBJS=\
node/Defaults.o \
node/Demarc.o \
node/EthernetTap.o \
- node/Filter.o \
node/Identity.o \
node/InetAddress.o \
node/Logger.o \