From 60158aa5dd38c979ed823fc477ab84e8d9e7a43d Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Mon, 30 Mar 2015 17:48:48 -0700 Subject: [PATCH] Turns out that node/ likely has no business with or need for the system IP routing table. So shelve that code for now. --- {osnet => attic/rtbl}/BSDRoutingTable.cpp | 0 {osnet => attic/rtbl}/BSDRoutingTable.hpp | 0 {osnet => attic/rtbl}/LinuxRoutingTable.cpp | 0 {osnet => attic/rtbl}/LinuxRoutingTable.hpp | 0 {node => attic/rtbl}/RoutingTable.cpp | 0 {node => attic/rtbl}/RoutingTable.hpp | 0 {testnet => attic/rtbl}/TestRoutingTable.cpp | 0 {testnet => attic/rtbl}/TestRoutingTable.hpp | 0 {osnet => attic/rtbl}/WindowsRoutingTable.cpp | 0 {osnet => attic/rtbl}/WindowsRoutingTable.hpp | 0 include/ZeroTierOne.h | 2 +- main.cpp | 14 +------------- make-freebsd.mk | 4 ++-- make-linux.mk | 4 ++-- make-mac.mk | 4 ++-- node/Node.cpp | 3 --- node/RuntimeEnvironment.hpp | 3 --- objects.mk | 1 - testnet.cpp | 5 +---- 19 files changed, 9 insertions(+), 31 deletions(-) rename {osnet => attic/rtbl}/BSDRoutingTable.cpp (100%) rename {osnet => attic/rtbl}/BSDRoutingTable.hpp (100%) rename {osnet => attic/rtbl}/LinuxRoutingTable.cpp (100%) rename {osnet => attic/rtbl}/LinuxRoutingTable.hpp (100%) rename {node => attic/rtbl}/RoutingTable.cpp (100%) rename {node => attic/rtbl}/RoutingTable.hpp (100%) rename {testnet => attic/rtbl}/TestRoutingTable.cpp (100%) rename {testnet => attic/rtbl}/TestRoutingTable.hpp (100%) rename {osnet => attic/rtbl}/WindowsRoutingTable.cpp (100%) rename {osnet => attic/rtbl}/WindowsRoutingTable.hpp (100%) diff --git a/osnet/BSDRoutingTable.cpp b/attic/rtbl/BSDRoutingTable.cpp similarity index 100% rename from osnet/BSDRoutingTable.cpp rename to attic/rtbl/BSDRoutingTable.cpp diff --git a/osnet/BSDRoutingTable.hpp b/attic/rtbl/BSDRoutingTable.hpp similarity index 100% rename from osnet/BSDRoutingTable.hpp rename to attic/rtbl/BSDRoutingTable.hpp diff --git a/osnet/LinuxRoutingTable.cpp b/attic/rtbl/LinuxRoutingTable.cpp similarity index 100% rename from osnet/LinuxRoutingTable.cpp rename to attic/rtbl/LinuxRoutingTable.cpp diff --git a/osnet/LinuxRoutingTable.hpp b/attic/rtbl/LinuxRoutingTable.hpp similarity index 100% rename from osnet/LinuxRoutingTable.hpp rename to attic/rtbl/LinuxRoutingTable.hpp diff --git a/node/RoutingTable.cpp b/attic/rtbl/RoutingTable.cpp similarity index 100% rename from node/RoutingTable.cpp rename to attic/rtbl/RoutingTable.cpp diff --git a/node/RoutingTable.hpp b/attic/rtbl/RoutingTable.hpp similarity index 100% rename from node/RoutingTable.hpp rename to attic/rtbl/RoutingTable.hpp diff --git a/testnet/TestRoutingTable.cpp b/attic/rtbl/TestRoutingTable.cpp similarity index 100% rename from testnet/TestRoutingTable.cpp rename to attic/rtbl/TestRoutingTable.cpp diff --git a/testnet/TestRoutingTable.hpp b/attic/rtbl/TestRoutingTable.hpp similarity index 100% rename from testnet/TestRoutingTable.hpp rename to attic/rtbl/TestRoutingTable.hpp diff --git a/osnet/WindowsRoutingTable.cpp b/attic/rtbl/WindowsRoutingTable.cpp similarity index 100% rename from osnet/WindowsRoutingTable.cpp rename to attic/rtbl/WindowsRoutingTable.cpp diff --git a/osnet/WindowsRoutingTable.hpp b/attic/rtbl/WindowsRoutingTable.hpp similarity index 100% rename from osnet/WindowsRoutingTable.hpp rename to attic/rtbl/WindowsRoutingTable.hpp diff --git a/include/ZeroTierOne.h b/include/ZeroTierOne.h index 93d5aa8b6..0808a750e 100644 --- a/include/ZeroTierOne.h +++ b/include/ZeroTierOne.h @@ -55,7 +55,7 @@ struct ZT1_Node_Status char address[16]; /** - * ZeroTier address in least significant 40 bits of 64-bit integer + * ZeroTier address (in least significant 40 bits of 64-bit integer) */ uint64_t rawAddress; diff --git a/main.cpp b/main.cpp index 7467ba41f..c78ffa896 100644 --- a/main.cpp +++ b/main.cpp @@ -70,7 +70,6 @@ #include "node/Thread.hpp" #include "node/CertificateOfMembership.hpp" #include "node/EthernetTapFactory.hpp" -#include "node/RoutingTable.hpp" #include "node/SocketManager.hpp" #include "control/NodeControlClient.hpp" @@ -84,31 +83,23 @@ #ifdef __WINDOWS__ #include "osnet/WindowsEthernetTapFactory.hpp" -#include "osnet/WindowsRoutingTable.hpp" #define ZTCreatePlatformEthernetTapFactory (new WindowsEthernetTapFactory(homeDir)) -#define ZTCreatePlatformRoutingTable (new WindowsRoutingTable()) #endif // __WINDOWS__ #ifdef __LINUX__ #include "osnet/LinuxEthernetTapFactory.hpp" -#include "osnet/LinuxRoutingTable.hpp" #define ZTCreatePlatformEthernetTapFactory (new LinuxEthernetTapFactory()) -#define ZTCreatePlatformRoutingTable (new LinuxRoutingTable()) #endif // __LINUX__ #ifdef __APPLE__ #include "osnet/OSXEthernetTapFactory.hpp" -#include "osnet/BSDRoutingTable.hpp" #define ZTCreatePlatformEthernetTapFactory (new OSXEthernetTapFactory(homeDir,"tap.kext")) -#define ZTCreatePlatformRoutingTable (new BSDRoutingTable()) #endif // __APPLE__ #ifndef ZTCreatePlatformEthernetTapFactory #ifdef __BSD__ #include "osnet/BSDEthernetTapFactory.hpp" -#include "osnet/BSDRoutingTable.hpp" #define ZTCreatePlatformEthernetTapFactory (new BSDEthernetTapFactory()) -#define ZTCreatePlatformRoutingTable (new BSDRoutingTable()) #else #error Sorry, this platform has no osnet/ implementation yet. Fork me on GitHub and add one? #endif // __BSD__ @@ -811,7 +802,6 @@ int main(int argc,char **argv) int exitCode = 0; bool needsReset = false; EthernetTapFactory *tapFactory = (EthernetTapFactory *)0; - RoutingTable *routingTable = (RoutingTable *)0; SocketManager *socketManager = (SocketManager *)0; NodeControlService *controlService = (NodeControlService *)0; NetworkConfigMaster *netconfMaster = (NetworkConfigMaster *)0; @@ -823,7 +813,6 @@ int main(int argc,char **argv) std::string authToken(NodeControlClient::getAuthToken((std::string(homeDir) + ZT_PATH_SEPARATOR_S + "authtoken.secret").c_str(),true)); tapFactory = ZTCreatePlatformEthernetTapFactory; - routingTable = ZTCreatePlatformRoutingTable; try { socketManager = new NativeSocketManager(udpPort,tcpPort); @@ -832,7 +821,7 @@ int main(int argc,char **argv) throw; } - node = new Node(homeDir,tapFactory,routingTable,socketManager,netconfMaster,needsReset,(overrideRootTopology.length() > 0) ? overrideRootTopology.c_str() : (const char *)0); + node = new Node(homeDir,tapFactory,socketManager,netconfMaster,needsReset,(overrideRootTopology.length() > 0) ? overrideRootTopology.c_str() : (const char *)0); controlService = new NodeControlService(node,authToken.c_str()); switch(node->run()) { @@ -888,7 +877,6 @@ int main(int argc,char **argv) delete controlService; delete node; node = (Node *)0; delete socketManager; - delete routingTable; delete tapFactory; #ifdef __UNIX_LIKE__ diff --git a/make-freebsd.mk b/make-freebsd.mk index 6a034dc71..0b65ca7a3 100644 --- a/make-freebsd.mk +++ b/make-freebsd.mk @@ -6,8 +6,8 @@ DEFS= LIBS= include objects.mk -OBJS+=osnet/BSDEthernetTapFactory.o osnet/BSDEthernetTap.o osnet/BSDRoutingTable.o -TESTNET_OBJS=testnet/SimNet.o testnet/SimNetSocketManager.o testnet/TestEthernetTap.o testnet/TestEthernetTapFactory.o testnet/TestRoutingTable.o +OBJS+=osnet/BSDEthernetTapFactory.o osnet/BSDEthernetTap.o +TESTNET_OBJS=testnet/SimNet.o testnet/SimNetSocketManager.o testnet/TestEthernetTap.o testnet/TestEthernetTapFactory.o # Enable SSE-optimized Salsa20 on x86 and x86_64 machines MACHINE=$(shell uname -m) diff --git a/make-linux.mk b/make-linux.mk index 67a63a7bd..627b7737f 100644 --- a/make-linux.mk +++ b/make-linux.mk @@ -7,8 +7,8 @@ DEFS= LIBS= include objects.mk -OBJS+=osnet/LinuxRoutingTable.o osnet/LinuxEthernetTap.o osnet/LinuxEthernetTapFactory.o -TESTNET_OBJS=testnet/SimNet.o testnet/SimNetSocketManager.o testnet/TestEthernetTap.o testnet/TestEthernetTapFactory.o testnet/TestRoutingTable.o +OBJS+=osnet/LinuxEthernetTap.o osnet/LinuxEthernetTapFactory.o +TESTNET_OBJS=testnet/SimNet.o testnet/SimNetSocketManager.o testnet/TestEthernetTap.o testnet/TestEthernetTapFactory.o # Enable SSE-optimized Salsa20 on x86 and x86_64 machines MACHINE=$(shell uname -m) diff --git a/make-mac.mk b/make-mac.mk index 28a7c72d1..730bda156 100644 --- a/make-mac.mk +++ b/make-mac.mk @@ -7,8 +7,8 @@ LIBS= ARCH_FLAGS=-arch i386 -arch x86_64 include objects.mk -OBJS+=osnet/BSDRoutingTable.o osnet/OSXEthernetTap.o osnet/OSXEthernetTapFactory.o -TESTNET_OBJS=testnet/SimNet.o testnet/SimNetSocketManager.o testnet/TestEthernetTap.o testnet/TestEthernetTapFactory.o testnet/TestRoutingTable.o +OBJS+=osnet/OSXEthernetTap.o osnet/OSXEthernetTapFactory.o +TESTNET_OBJS=testnet/SimNet.o testnet/SimNetSocketManager.o testnet/TestEthernetTap.o testnet/TestEthernetTapFactory.o # Disable codesign since open source users will not have ZeroTier's certs CODESIGN=echo diff --git a/node/Node.cpp b/node/Node.cpp index d013444a1..71c2d3fab 100644 --- a/node/Node.cpp +++ b/node/Node.cpp @@ -74,7 +74,6 @@ #include "SoftwareUpdater.hpp" #include "Buffer.hpp" #include "AntiRecursion.hpp" -#include "RoutingTable.hpp" #include "HttpClient.hpp" #include "NetworkConfigMaster.hpp" @@ -126,7 +125,6 @@ struct _NodeImpl Node::Node( const char *hp, EthernetTapFactory *tf, - RoutingTable *rt, SocketManager *sm, NetworkConfigMaster *nm, bool resetIdentity, @@ -140,7 +138,6 @@ Node::Node( else impl->renv.homePath = ZT_DEFAULTS.defaultHomePath; impl->renv.tapFactory = tf; - impl->renv.routingTable = rt; impl->renv.sm = sm; impl->renv.netconfMaster = nm; diff --git a/node/RuntimeEnvironment.hpp b/node/RuntimeEnvironment.hpp index 57a1c2624..425c6d84a 100644 --- a/node/RuntimeEnvironment.hpp +++ b/node/RuntimeEnvironment.hpp @@ -46,7 +46,6 @@ class SocketManager; class Multicaster; class AntiRecursion; class EthernetTapFactory; -class RoutingTable; class HttpClient; class NetworkConfigMaster; @@ -73,7 +72,6 @@ public: timeOfLastResynchronize(0), timeOfLastPacketReceived(0), tapFactory((EthernetTapFactory *)0), - routingTable((RoutingTable *)0), sm((SocketManager *)0), netconfMaster((NetworkConfigMaster *)0), log((Logger *)0), @@ -110,7 +108,6 @@ public: // These are passed in from outside and are not created or deleted by the ZeroTier node core EthernetTapFactory *tapFactory; - RoutingTable *routingTable; SocketManager *sm; NetworkConfigMaster *netconfMaster; diff --git a/objects.mk b/objects.mk index 8ed5339de..7fce4abbc 100644 --- a/objects.mk +++ b/objects.mk @@ -24,7 +24,6 @@ OBJS=\ node/Packet.o \ node/Peer.o \ node/Poly1305.o \ - node/RoutingTable.o \ node/Salsa20.o \ node/SoftwareUpdater.o \ node/SHA512.o \ diff --git a/testnet.cpp b/testnet.cpp index eeb59b903..5b175728e 100644 --- a/testnet.cpp +++ b/testnet.cpp @@ -50,7 +50,6 @@ #include "testnet/SimNetSocketManager.hpp" #include "testnet/TestEthernetTap.hpp" #include "testnet/TestEthernetTapFactory.hpp" -#include "testnet/TestRoutingTable.hpp" #ifdef __WINDOWS__ #include @@ -67,9 +66,8 @@ public: SimNode(SimNet &net,const std::string &hp,const char *rootTopology,bool issn,const InetAddress &addr) : home(hp), tapFactory(), - routingTable(), socketManager(net.newEndpoint(addr)), - node(home.c_str(),&tapFactory,&routingTable,socketManager,false,rootTopology), + node(home.c_str(),&tapFactory,socketManager,false,rootTopology), reasonForTermination(Node::NODE_RUNNING), supernode(issn) { @@ -90,7 +88,6 @@ public: std::string home; TestEthernetTapFactory tapFactory; - TestRoutingTable routingTable; SimNetSocketManager *socketManager; Node node; Node::ReasonForTermination reasonForTermination;