From d9bb09780f2f72666b76ee0fe37b1c05c6597e9a Mon Sep 17 00:00:00 2001 From: EinMByte Date: Thu, 30 Jul 2015 16:25:43 +0200 Subject: [PATCH] Created tunnel/ --- Daemon.cpp | 2 +- Datagram.cpp | 2 +- Destination.h | 2 +- Garlic.cpp | 4 ++-- HTTPServer.cpp | 4 ++-- I2NPProtocol.cpp | 2 +- I2PControl.cpp | 2 +- LeaseSet.cpp | 2 +- Makefile | 3 +++ NetDb.cpp | 2 +- NetDb.h | 4 ++-- Streaming.cpp | 2 +- Streaming.h | 2 +- api.cpp | 2 +- build/CMakeLists.txt | 10 +++++----- crypto/aes.cpp | 2 +- filelist.mk | 5 +++-- TransitTunnel.cpp => tunnel/TransitTunnel.cpp | 0 TransitTunnel.h => tunnel/TransitTunnel.h | 0 Tunnel.cpp => tunnel/Tunnel.cpp | 0 Tunnel.h => tunnel/Tunnel.h | 0 TunnelBase.h => tunnel/TunnelBase.h | 0 TunnelConfig.h => tunnel/TunnelConfig.h | 0 TunnelEndpoint.cpp => tunnel/TunnelEndpoint.cpp | 0 TunnelEndpoint.h => tunnel/TunnelEndpoint.h | 0 TunnelGateway.cpp => tunnel/TunnelGateway.cpp | 0 TunnelGateway.h => tunnel/TunnelGateway.h | 0 TunnelPool.cpp => tunnel/TunnelPool.cpp | 0 TunnelPool.h => tunnel/TunnelPool.h | 0 29 files changed, 28 insertions(+), 24 deletions(-) rename TransitTunnel.cpp => tunnel/TransitTunnel.cpp (100%) rename TransitTunnel.h => tunnel/TransitTunnel.h (100%) rename Tunnel.cpp => tunnel/Tunnel.cpp (100%) rename Tunnel.h => tunnel/Tunnel.h (100%) rename TunnelBase.h => tunnel/TunnelBase.h (100%) rename TunnelConfig.h => tunnel/TunnelConfig.h (100%) rename TunnelEndpoint.cpp => tunnel/TunnelEndpoint.cpp (100%) rename TunnelEndpoint.h => tunnel/TunnelEndpoint.h (100%) rename TunnelGateway.cpp => tunnel/TunnelGateway.cpp (100%) rename TunnelGateway.h => tunnel/TunnelGateway.h (100%) rename TunnelPool.cpp => tunnel/TunnelPool.cpp (100%) rename TunnelPool.h => tunnel/TunnelPool.h (100%) diff --git a/Daemon.cpp b/Daemon.cpp index 2c52cfc1..46ab2eb2 100644 --- a/Daemon.cpp +++ b/Daemon.cpp @@ -8,7 +8,7 @@ #include "transport/NTCPSession.h" #include "RouterInfo.h" #include "RouterContext.h" -#include "Tunnel.h" +#include "tunnel/Tunnel.h" #include "NetDb.h" #include "Garlic.h" #include "util/util.h" diff --git a/Datagram.cpp b/Datagram.cpp index a4ad5086..c5d4311b 100644 --- a/Datagram.cpp +++ b/Datagram.cpp @@ -3,7 +3,7 @@ #include #include #include "util/Log.h" -#include "TunnelBase.h" +#include "tunnel/TunnelBase.h" #include "RouterContext.h" #include "Destination.h" #include "Datagram.h" diff --git a/Destination.h b/Destination.h index fdad4426..789474e2 100644 --- a/Destination.h +++ b/Destination.h @@ -10,7 +10,7 @@ #include #include #include "Identity.h" -#include "TunnelPool.h" +#include "tunnel/TunnelPool.h" #include "crypto/CryptoConst.h" #include "LeaseSet.h" #include "Garlic.h" diff --git a/Garlic.cpp b/Garlic.cpp index e611addd..3b9e4b43 100644 --- a/Garlic.cpp +++ b/Garlic.cpp @@ -4,8 +4,8 @@ #include #include "RouterContext.h" #include "I2NPProtocol.h" -#include "Tunnel.h" -#include "TunnelPool.h" +#include "tunnel/Tunnel.h" +#include "tunnel/TunnelPool.h" #include "util/Timestamp.h" #include "Destination.h" #include "Garlic.h" diff --git a/HTTPServer.cpp b/HTTPServer.cpp index b45160ca..2419b386 100644 --- a/HTTPServer.cpp +++ b/HTTPServer.cpp @@ -3,8 +3,8 @@ #include #include "util/base64.h" #include "util/Log.h" -#include "Tunnel.h" -#include "TransitTunnel.h" +#include "tunnel/Tunnel.h" +#include "tunnel/TransitTunnel.h" #include "transport/Transports.h" #include "NetDb.h" #include "util/I2PEndian.h" diff --git a/I2NPProtocol.cpp b/I2NPProtocol.cpp index 7a579825..82a015d1 100644 --- a/I2NPProtocol.cpp +++ b/I2NPProtocol.cpp @@ -6,7 +6,7 @@ #include "util/Timestamp.h" #include "RouterContext.h" #include "NetDb.h" -#include "Tunnel.h" +#include "tunnel/Tunnel.h" #include "transport/Transports.h" #include "Garlic.h" #include "I2NPProtocol.h" diff --git a/I2PControl.cpp b/I2PControl.cpp index feeacb6d..4e993aa9 100644 --- a/I2PControl.cpp +++ b/I2PControl.cpp @@ -13,7 +13,7 @@ #include "NetDb.h" #include "RouterContext.h" #include "Daemon.h" -#include "Tunnel.h" +#include "tunnel/Tunnel.h" #include "util/Timestamp.h" #include "transport/Transports.h" #include "version.h" diff --git a/LeaseSet.cpp b/LeaseSet.cpp index 98acec26..15771f65 100644 --- a/LeaseSet.cpp +++ b/LeaseSet.cpp @@ -6,7 +6,7 @@ #include "util/Log.h" #include "util/Timestamp.h" #include "NetDb.h" -#include "TunnelPool.h" +#include "tunnel/TunnelPool.h" #include "LeaseSet.h" namespace i2p diff --git a/Makefile b/Makefile index e97812fa..cd4961f4 100644 --- a/Makefile +++ b/Makefile @@ -31,6 +31,7 @@ mk_build_dir: mkdir -p obj/transport mkdir -p obj/util mkdir -p obj/crypto + mkdir -p obj/tunnel mk_build_test_dir: mkdir -p obj/tests @@ -49,6 +50,7 @@ deps: @mkdir -p obj/tests @mkdir -p obj/util @mkdir -p obj/crypto + @mkdir -p obj/tunnel $(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) -MM *.cpp > $(DEPS) @sed -i -e '/\.o:/ s/^/obj\//' $(DEPS) @@ -58,6 +60,7 @@ obj/%.o : %.cpp @mkdir -p obj/tests @mkdir -p obj/util @mkdir -p obj/crypto + @mkdir -p obj/tunnel $(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) $(INCFLAGS) $(CPU_FLAGS) -c -o $@ $< # '-' is 'ignore if missing' on first run diff --git a/NetDb.cpp b/NetDb.cpp index 248b956e..23d69226 100644 --- a/NetDb.cpp +++ b/NetDb.cpp @@ -8,7 +8,7 @@ #include "util/Log.h" #include "util/Timestamp.h" #include "I2NPProtocol.h" -#include "Tunnel.h" +#include "tunnel/Tunnel.h" #include "transport/Transports.h" #include "RouterContext.h" #include "Garlic.h" diff --git a/NetDb.h b/NetDb.h index 31983919..84280332 100644 --- a/NetDb.h +++ b/NetDb.h @@ -13,8 +13,8 @@ #include "I2NPProtocol.h" #include "RouterInfo.h" #include "LeaseSet.h" -#include "Tunnel.h" -#include "TunnelPool.h" +#include "tunnel/Tunnel.h" +#include "tunnel/TunnelPool.h" #include "Reseed.h" #include "NetDbRequests.h" diff --git a/Streaming.cpp b/Streaming.cpp index 9c891994..8b95139f 100644 --- a/Streaming.cpp +++ b/Streaming.cpp @@ -2,7 +2,7 @@ #include "util/Log.h" #include "RouterInfo.h" #include "RouterContext.h" -#include "Tunnel.h" +#include "tunnel/Tunnel.h" #include "util/Timestamp.h" #include "Destination.h" #include "Streaming.h" diff --git a/Streaming.h b/Streaming.h index 562d5a8e..370d1822 100644 --- a/Streaming.h +++ b/Streaming.h @@ -16,7 +16,7 @@ #include "LeaseSet.h" #include "I2NPProtocol.h" #include "Garlic.h" -#include "Tunnel.h" +#include "tunnel/Tunnel.h" namespace i2p { diff --git a/api.cpp b/api.cpp index 17d6fdac..cd24d15a 100644 --- a/api.cpp +++ b/api.cpp @@ -3,7 +3,7 @@ #include "util/Log.h" #include "NetDb.h" #include "transport/Transports.h" -#include "Tunnel.h" +#include "tunnel/Tunnel.h" #include "RouterContext.h" #include "Identity.h" #include "Destination.h" diff --git a/build/CMakeLists.txt b/build/CMakeLists.txt index bbcfa01a..058d0810 100644 --- a/build/CMakeLists.txt +++ b/build/CMakeLists.txt @@ -26,6 +26,11 @@ set (COMMON_SRC "${CMAKE_SOURCE_DIR}/util/base64.cpp" "${CMAKE_SOURCE_DIR}/util/util.cpp" "${CMAKE_SOURCE_DIR}/util/Log.cpp" + "${CMAKE_SOURCE_DIR}/tunnel/TransitTunnel.cpp" + "${CMAKE_SOURCE_DIR}/tunnel/Tunnel.cpp" + "${CMAKE_SOURCE_DIR}/tunnel/TunnelGateway.cpp" + "${CMAKE_SOURCE_DIR}/tunnel/TunnelEndpoint.cpp" + "${CMAKE_SOURCE_DIR}/tunnel/TunnelPool.cpp" "${CMAKE_SOURCE_DIR}/AddressBook.cpp" "${CMAKE_SOURCE_DIR}/Garlic.cpp" "${CMAKE_SOURCE_DIR}/I2NPProtocol.cpp" @@ -39,11 +44,6 @@ set (COMMON_SRC "${CMAKE_SOURCE_DIR}/RouterInfo.cpp" "${CMAKE_SOURCE_DIR}/Streaming.cpp" "${CMAKE_SOURCE_DIR}/Destination.cpp" - "${CMAKE_SOURCE_DIR}/TransitTunnel.cpp" - "${CMAKE_SOURCE_DIR}/Tunnel.cpp" - "${CMAKE_SOURCE_DIR}/TunnelGateway.cpp" - "${CMAKE_SOURCE_DIR}/TunnelEndpoint.cpp" - "${CMAKE_SOURCE_DIR}/TunnelPool.cpp" "${CMAKE_SOURCE_DIR}/Datagram.cpp" "${CMAKE_SOURCE_DIR}/UPnP.cpp" ) diff --git a/crypto/aes.cpp b/crypto/aes.cpp index fe354b9f..8b89f22f 100644 --- a/crypto/aes.cpp +++ b/crypto/aes.cpp @@ -1,5 +1,5 @@ #include -#include "TunnelBase.h" +#include "tunnel/TunnelBase.h" #include "aes.h" namespace i2p diff --git a/filelist.mk b/filelist.mk index e0a66f04..4e88d5a5 100644 --- a/filelist.mk +++ b/filelist.mk @@ -3,11 +3,12 @@ COMMON_SRC = \ transport/SSUData.cpp transport/Transports.cpp \ util/util.cpp util/base64.cpp util/Log.cpp \ crypto/CryptoConst.cpp crypto/aes.cpp crypto/Signature.cpp \ + tunnel/Tunnel.cpp tunnel/TransitTunnel.cpp tunnel/TunnelEndpoint.cpp \ + tunnel/TunnelEndpoint.cpp tunnel/TunnelPool.cpp tunnel/TunnelGateway.cpp \ Datagram.cpp Garlic.cpp I2NPProtocol.cpp LeaseSet.cpp \ NetDb.cpp NetDbRequests.cpp Profiling.cpp Reseed.cpp \ RouterContext.cpp RouterInfo.cpp Streaming.cpp Identity.cpp \ - TransitTunnel.cpp Tunnel.cpp TunnelEndpoint.cpp TunnelPool.cpp \ - TunnelGateway.cpp Destination.cpp UPnP.cpp + Destination.cpp UPnP.cpp ifeq ($(UNAME),Darwin) diff --git a/TransitTunnel.cpp b/tunnel/TransitTunnel.cpp similarity index 100% rename from TransitTunnel.cpp rename to tunnel/TransitTunnel.cpp diff --git a/TransitTunnel.h b/tunnel/TransitTunnel.h similarity index 100% rename from TransitTunnel.h rename to tunnel/TransitTunnel.h diff --git a/Tunnel.cpp b/tunnel/Tunnel.cpp similarity index 100% rename from Tunnel.cpp rename to tunnel/Tunnel.cpp diff --git a/Tunnel.h b/tunnel/Tunnel.h similarity index 100% rename from Tunnel.h rename to tunnel/Tunnel.h diff --git a/TunnelBase.h b/tunnel/TunnelBase.h similarity index 100% rename from TunnelBase.h rename to tunnel/TunnelBase.h diff --git a/TunnelConfig.h b/tunnel/TunnelConfig.h similarity index 100% rename from TunnelConfig.h rename to tunnel/TunnelConfig.h diff --git a/TunnelEndpoint.cpp b/tunnel/TunnelEndpoint.cpp similarity index 100% rename from TunnelEndpoint.cpp rename to tunnel/TunnelEndpoint.cpp diff --git a/TunnelEndpoint.h b/tunnel/TunnelEndpoint.h similarity index 100% rename from TunnelEndpoint.h rename to tunnel/TunnelEndpoint.h diff --git a/TunnelGateway.cpp b/tunnel/TunnelGateway.cpp similarity index 100% rename from TunnelGateway.cpp rename to tunnel/TunnelGateway.cpp diff --git a/TunnelGateway.h b/tunnel/TunnelGateway.h similarity index 100% rename from TunnelGateway.h rename to tunnel/TunnelGateway.h diff --git a/TunnelPool.cpp b/tunnel/TunnelPool.cpp similarity index 100% rename from TunnelPool.cpp rename to tunnel/TunnelPool.cpp diff --git a/TunnelPool.h b/tunnel/TunnelPool.h similarity index 100% rename from TunnelPool.h rename to tunnel/TunnelPool.h