Browse Source

Turns out that node/ likely has no business with or need for the system IP routing table. So shelve that code for now.

Adam Ierymenko 10 years ago
parent
commit
60158aa5dd

+ 0 - 0
osnet/BSDRoutingTable.cpp → attic/rtbl/BSDRoutingTable.cpp


+ 0 - 0
osnet/BSDRoutingTable.hpp → attic/rtbl/BSDRoutingTable.hpp


+ 0 - 0
osnet/LinuxRoutingTable.cpp → attic/rtbl/LinuxRoutingTable.cpp


+ 0 - 0
osnet/LinuxRoutingTable.hpp → attic/rtbl/LinuxRoutingTable.hpp


+ 0 - 0
node/RoutingTable.cpp → attic/rtbl/RoutingTable.cpp


+ 0 - 0
node/RoutingTable.hpp → attic/rtbl/RoutingTable.hpp


+ 0 - 0
testnet/TestRoutingTable.cpp → attic/rtbl/TestRoutingTable.cpp


+ 0 - 0
testnet/TestRoutingTable.hpp → attic/rtbl/TestRoutingTable.hpp


+ 0 - 0
osnet/WindowsRoutingTable.cpp → attic/rtbl/WindowsRoutingTable.cpp


+ 0 - 0
osnet/WindowsRoutingTable.hpp → attic/rtbl/WindowsRoutingTable.hpp


+ 1 - 1
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;
 

+ 1 - 13
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__

+ 2 - 2
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)

+ 2 - 2
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)

+ 2 - 2
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

+ 0 - 3
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;
 

+ 0 - 3
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;
 

+ 0 - 1
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 \

+ 1 - 4
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 <windows.h>
@@ -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;