From 4cc3b7f9fb6833b616cac664d48fedec684cdb37 Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Fri, 21 Apr 2017 06:33:45 -0400 Subject: [PATCH] restructure build to separate the 3 main components into 3 subdirectories libi2pd for core libs libi2pd_client for i2pd client libs daemon for i2pd daemon libs --- .gitignore | 10 +- Makefile | 20 ++- DaemonWin32.cpp => Win32/DaemonWin32.cpp | 0 Win32/Resource.rc2 | 2 +- android/build.xml | 1 - android/jni/Android.mk | 62 +------ android/jni/Application.mk | 9 +- android/jni/DaemonAndroid.cpp | 3 +- android/jni/i2pd_android.cpp | 8 +- build/CMakeLists.txt | 152 +++++++++--------- Daemon.cpp => daemon/Daemon.cpp | 0 Daemon.h => daemon/Daemon.h | 0 HTTPServer.cpp => daemon/HTTPServer.cpp | 0 HTTPServer.h => daemon/HTTPServer.h | 0 I2PControl.cpp => daemon/I2PControl.cpp | 0 I2PControl.h => daemon/I2PControl.h | 0 UPnP.cpp => daemon/UPnP.cpp | 0 UPnP.h => daemon/UPnP.h | 0 DaemonLinux.cpp => daemon/UnixDaemon.cpp | 0 i2pd.cpp => daemon/i2pd.cpp | 0 filelist.mk | 32 ++-- Base.cpp => libi2pd/Base.cpp | 0 Base.h => libi2pd/Base.h | 0 BloomFilter.cpp => libi2pd/BloomFilter.cpp | 0 BloomFilter.h => libi2pd/BloomFilter.h | 0 Config.cpp => libi2pd/Config.cpp | 0 Config.h => libi2pd/Config.h | 0 Crypto.cpp => libi2pd/Crypto.cpp | 0 Crypto.h => libi2pd/Crypto.h | 0 Datagram.cpp => libi2pd/Datagram.cpp | 0 Datagram.h => libi2pd/Datagram.h | 0 Destination.cpp => libi2pd/Destination.cpp | 0 Destination.h => libi2pd/Destination.h | 0 Event.cpp => libi2pd/Event.cpp | 0 Event.h => libi2pd/Event.h | 0 FS.cpp => libi2pd/FS.cpp | 0 FS.h => libi2pd/FS.h | 0 Family.cpp => libi2pd/Family.cpp | 0 Family.h => libi2pd/Family.h | 0 Garlic.cpp => libi2pd/Garlic.cpp | 0 Garlic.h => libi2pd/Garlic.h | 0 Gost.cpp => libi2pd/Gost.cpp | 0 Gost.h => libi2pd/Gost.h | 0 Gzip.cpp => libi2pd/Gzip.cpp | 0 Gzip.h => libi2pd/Gzip.h | 0 HTTP.cpp => libi2pd/HTTP.cpp | 0 HTTP.h => libi2pd/HTTP.h | 0 I2NPProtocol.cpp => libi2pd/I2NPProtocol.cpp | 0 I2NPProtocol.h => libi2pd/I2NPProtocol.h | 0 I2PEndian.cpp => libi2pd/I2PEndian.cpp | 0 I2PEndian.h => libi2pd/I2PEndian.h | 0 Identity.cpp => libi2pd/Identity.cpp | 0 Identity.h => libi2pd/Identity.h | 0 LeaseSet.cpp => libi2pd/LeaseSet.cpp | 0 LeaseSet.h => libi2pd/LeaseSet.h | 0 .../LittleBigEndian.h | 0 Log.cpp => libi2pd/Log.cpp | 0 Log.h => libi2pd/Log.h | 0 NTCPSession.cpp => libi2pd/NTCPSession.cpp | 0 NTCPSession.h => libi2pd/NTCPSession.h | 0 NetDb.cpp => libi2pd/NetDb.cpp | 0 NetDb.h => libi2pd/NetDb.h | 0 .../NetDbRequests.cpp | 0 NetDbRequests.h => libi2pd/NetDbRequests.h | 0 Profiling.cpp => libi2pd/Profiling.cpp | 0 Profiling.h => libi2pd/Profiling.h | 0 Queue.h => libi2pd/Queue.h | 0 Reseed.cpp => libi2pd/Reseed.cpp | 0 Reseed.h => libi2pd/Reseed.h | 0 .../RouterContext.cpp | 0 RouterContext.h => libi2pd/RouterContext.h | 0 RouterInfo.cpp => libi2pd/RouterInfo.cpp | 0 RouterInfo.h => libi2pd/RouterInfo.h | 0 SSU.cpp => libi2pd/SSU.cpp | 0 SSU.h => libi2pd/SSU.h | 0 SSUData.cpp => libi2pd/SSUData.cpp | 0 SSUData.h => libi2pd/SSUData.h | 0 SSUSession.cpp => libi2pd/SSUSession.cpp | 0 SSUSession.h => libi2pd/SSUSession.h | 0 Signature.cpp => libi2pd/Signature.cpp | 0 Signature.h => libi2pd/Signature.h | 0 Streaming.cpp => libi2pd/Streaming.cpp | 0 Streaming.h => libi2pd/Streaming.h | 0 Tag.h => libi2pd/Tag.h | 0 Timestamp.cpp => libi2pd/Timestamp.cpp | 0 Timestamp.h => libi2pd/Timestamp.h | 0 .../TransitTunnel.cpp | 0 TransitTunnel.h => libi2pd/TransitTunnel.h | 0 .../TransportSession.h | 0 Transports.cpp => libi2pd/Transports.cpp | 0 Transports.h => libi2pd/Transports.h | 0 Tunnel.cpp => libi2pd/Tunnel.cpp | 0 Tunnel.h => libi2pd/Tunnel.h | 0 TunnelBase.h => libi2pd/TunnelBase.h | 0 TunnelConfig.h => libi2pd/TunnelConfig.h | 0 .../TunnelEndpoint.cpp | 0 TunnelEndpoint.h => libi2pd/TunnelEndpoint.h | 0 .../TunnelGateway.cpp | 0 TunnelGateway.h => libi2pd/TunnelGateway.h | 0 TunnelPool.cpp => libi2pd/TunnelPool.cpp | 0 TunnelPool.h => libi2pd/TunnelPool.h | 0 api.cpp => libi2pd/api.cpp | 0 api.h => libi2pd/api.h | 0 stdafx.cpp => libi2pd/stdafx.cpp | 0 stdafx.h => libi2pd/stdafx.h | 0 util.cpp => libi2pd/util.cpp | 0 util.h => libi2pd/util.h | 0 version.h => libi2pd/version.h | 0 .../AddressBook.cpp | 0 AddressBook.h => libi2pd_client/AddressBook.h | 0 BOB.cpp => libi2pd_client/BOB.cpp | 0 BOB.h => libi2pd_client/BOB.h | 0 .../ClientContext.cpp | 0 .../ClientContext.h | 0 HTTPProxy.cpp => libi2pd_client/HTTPProxy.cpp | 0 HTTPProxy.h => libi2pd_client/HTTPProxy.h | 0 I2CP.cpp => libi2pd_client/I2CP.cpp | 0 I2CP.h => libi2pd_client/I2CP.h | 0 .../I2PService.cpp | 0 I2PService.h => libi2pd_client/I2PService.h | 0 I2PTunnel.cpp => libi2pd_client/I2PTunnel.cpp | 0 I2PTunnel.h => libi2pd_client/I2PTunnel.h | 0 .../MatchedDestination.cpp | 0 .../MatchedDestination.h | 0 SAM.cpp => libi2pd_client/SAM.cpp | 0 SAM.h => libi2pd_client/SAM.h | 0 SOCKS.cpp => libi2pd_client/SOCKS.cpp | 0 SOCKS.h => libi2pd_client/SOCKS.h | 0 WebSocks.cpp => libi2pd_client/WebSocks.cpp | 0 WebSocks.h => libi2pd_client/WebSocks.h | 0 Websocket.cpp => libi2pd_client/Websocket.cpp | 2 + Websocket.h => libi2pd_client/Websocket.h | 0 qt/i2pd_qt/.gitignore | 6 + qt/i2pd_qt/DaemonQT.cpp | 2 +- qt/i2pd_qt/i2pd_qt.pro | 72 +++++---- qt/i2pd_qt/mainwindow.cpp | 2 +- tests/Makefile | 10 +- tests/test-base-64.cpp | 2 +- tests/test-gost-sig.cpp | 7 +- tests/test-gost.cpp | 15 +- 140 files changed, 210 insertions(+), 207 deletions(-) rename DaemonWin32.cpp => Win32/DaemonWin32.cpp (100%) rename Daemon.cpp => daemon/Daemon.cpp (100%) rename Daemon.h => daemon/Daemon.h (100%) rename HTTPServer.cpp => daemon/HTTPServer.cpp (100%) rename HTTPServer.h => daemon/HTTPServer.h (100%) rename I2PControl.cpp => daemon/I2PControl.cpp (100%) rename I2PControl.h => daemon/I2PControl.h (100%) rename UPnP.cpp => daemon/UPnP.cpp (100%) rename UPnP.h => daemon/UPnP.h (100%) rename DaemonLinux.cpp => daemon/UnixDaemon.cpp (100%) rename i2pd.cpp => daemon/i2pd.cpp (100%) rename Base.cpp => libi2pd/Base.cpp (100%) rename Base.h => libi2pd/Base.h (100%) rename BloomFilter.cpp => libi2pd/BloomFilter.cpp (100%) rename BloomFilter.h => libi2pd/BloomFilter.h (100%) rename Config.cpp => libi2pd/Config.cpp (100%) rename Config.h => libi2pd/Config.h (100%) rename Crypto.cpp => libi2pd/Crypto.cpp (100%) rename Crypto.h => libi2pd/Crypto.h (100%) rename Datagram.cpp => libi2pd/Datagram.cpp (100%) rename Datagram.h => libi2pd/Datagram.h (100%) rename Destination.cpp => libi2pd/Destination.cpp (100%) rename Destination.h => libi2pd/Destination.h (100%) rename Event.cpp => libi2pd/Event.cpp (100%) rename Event.h => libi2pd/Event.h (100%) rename FS.cpp => libi2pd/FS.cpp (100%) rename FS.h => libi2pd/FS.h (100%) rename Family.cpp => libi2pd/Family.cpp (100%) rename Family.h => libi2pd/Family.h (100%) rename Garlic.cpp => libi2pd/Garlic.cpp (100%) rename Garlic.h => libi2pd/Garlic.h (100%) rename Gost.cpp => libi2pd/Gost.cpp (100%) rename Gost.h => libi2pd/Gost.h (100%) rename Gzip.cpp => libi2pd/Gzip.cpp (100%) rename Gzip.h => libi2pd/Gzip.h (100%) rename HTTP.cpp => libi2pd/HTTP.cpp (100%) rename HTTP.h => libi2pd/HTTP.h (100%) rename I2NPProtocol.cpp => libi2pd/I2NPProtocol.cpp (100%) rename I2NPProtocol.h => libi2pd/I2NPProtocol.h (100%) rename I2PEndian.cpp => libi2pd/I2PEndian.cpp (100%) rename I2PEndian.h => libi2pd/I2PEndian.h (100%) rename Identity.cpp => libi2pd/Identity.cpp (100%) rename Identity.h => libi2pd/Identity.h (100%) rename LeaseSet.cpp => libi2pd/LeaseSet.cpp (100%) rename LeaseSet.h => libi2pd/LeaseSet.h (100%) rename LittleBigEndian.h => libi2pd/LittleBigEndian.h (100%) rename Log.cpp => libi2pd/Log.cpp (100%) rename Log.h => libi2pd/Log.h (100%) rename NTCPSession.cpp => libi2pd/NTCPSession.cpp (100%) rename NTCPSession.h => libi2pd/NTCPSession.h (100%) rename NetDb.cpp => libi2pd/NetDb.cpp (100%) rename NetDb.h => libi2pd/NetDb.h (100%) rename NetDbRequests.cpp => libi2pd/NetDbRequests.cpp (100%) rename NetDbRequests.h => libi2pd/NetDbRequests.h (100%) rename Profiling.cpp => libi2pd/Profiling.cpp (100%) rename Profiling.h => libi2pd/Profiling.h (100%) rename Queue.h => libi2pd/Queue.h (100%) rename Reseed.cpp => libi2pd/Reseed.cpp (100%) rename Reseed.h => libi2pd/Reseed.h (100%) rename RouterContext.cpp => libi2pd/RouterContext.cpp (100%) rename RouterContext.h => libi2pd/RouterContext.h (100%) rename RouterInfo.cpp => libi2pd/RouterInfo.cpp (100%) rename RouterInfo.h => libi2pd/RouterInfo.h (100%) rename SSU.cpp => libi2pd/SSU.cpp (100%) rename SSU.h => libi2pd/SSU.h (100%) rename SSUData.cpp => libi2pd/SSUData.cpp (100%) rename SSUData.h => libi2pd/SSUData.h (100%) rename SSUSession.cpp => libi2pd/SSUSession.cpp (100%) rename SSUSession.h => libi2pd/SSUSession.h (100%) rename Signature.cpp => libi2pd/Signature.cpp (100%) rename Signature.h => libi2pd/Signature.h (100%) rename Streaming.cpp => libi2pd/Streaming.cpp (100%) rename Streaming.h => libi2pd/Streaming.h (100%) rename Tag.h => libi2pd/Tag.h (100%) rename Timestamp.cpp => libi2pd/Timestamp.cpp (100%) rename Timestamp.h => libi2pd/Timestamp.h (100%) rename TransitTunnel.cpp => libi2pd/TransitTunnel.cpp (100%) rename TransitTunnel.h => libi2pd/TransitTunnel.h (100%) rename TransportSession.h => libi2pd/TransportSession.h (100%) rename Transports.cpp => libi2pd/Transports.cpp (100%) rename Transports.h => libi2pd/Transports.h (100%) rename Tunnel.cpp => libi2pd/Tunnel.cpp (100%) rename Tunnel.h => libi2pd/Tunnel.h (100%) rename TunnelBase.h => libi2pd/TunnelBase.h (100%) rename TunnelConfig.h => libi2pd/TunnelConfig.h (100%) rename TunnelEndpoint.cpp => libi2pd/TunnelEndpoint.cpp (100%) rename TunnelEndpoint.h => libi2pd/TunnelEndpoint.h (100%) rename TunnelGateway.cpp => libi2pd/TunnelGateway.cpp (100%) rename TunnelGateway.h => libi2pd/TunnelGateway.h (100%) rename TunnelPool.cpp => libi2pd/TunnelPool.cpp (100%) rename TunnelPool.h => libi2pd/TunnelPool.h (100%) rename api.cpp => libi2pd/api.cpp (100%) rename api.h => libi2pd/api.h (100%) rename stdafx.cpp => libi2pd/stdafx.cpp (100%) rename stdafx.h => libi2pd/stdafx.h (100%) rename util.cpp => libi2pd/util.cpp (100%) rename util.h => libi2pd/util.h (100%) rename version.h => libi2pd/version.h (100%) rename AddressBook.cpp => libi2pd_client/AddressBook.cpp (100%) rename AddressBook.h => libi2pd_client/AddressBook.h (100%) rename BOB.cpp => libi2pd_client/BOB.cpp (100%) rename BOB.h => libi2pd_client/BOB.h (100%) rename ClientContext.cpp => libi2pd_client/ClientContext.cpp (100%) rename ClientContext.h => libi2pd_client/ClientContext.h (100%) rename HTTPProxy.cpp => libi2pd_client/HTTPProxy.cpp (100%) rename HTTPProxy.h => libi2pd_client/HTTPProxy.h (100%) rename I2CP.cpp => libi2pd_client/I2CP.cpp (100%) rename I2CP.h => libi2pd_client/I2CP.h (100%) rename I2PService.cpp => libi2pd_client/I2PService.cpp (100%) rename I2PService.h => libi2pd_client/I2PService.h (100%) rename I2PTunnel.cpp => libi2pd_client/I2PTunnel.cpp (100%) rename I2PTunnel.h => libi2pd_client/I2PTunnel.h (100%) rename MatchedDestination.cpp => libi2pd_client/MatchedDestination.cpp (100%) rename MatchedDestination.h => libi2pd_client/MatchedDestination.h (100%) rename SAM.cpp => libi2pd_client/SAM.cpp (100%) rename SAM.h => libi2pd_client/SAM.h (100%) rename SOCKS.cpp => libi2pd_client/SOCKS.cpp (100%) rename SOCKS.h => libi2pd_client/SOCKS.h (100%) rename WebSocks.cpp => libi2pd_client/WebSocks.cpp (100%) rename WebSocks.h => libi2pd_client/WebSocks.h (100%) rename Websocket.cpp => libi2pd_client/Websocket.cpp (99%) rename Websocket.h => libi2pd_client/Websocket.h (100%) diff --git a/.gitignore b/.gitignore index d3dd8141..c472d88e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ # i2pd -obj/*.o +*.o router.info router.keys i2p @@ -248,4 +248,10 @@ docs/generated *\#* # gdb files -.gdb_history \ No newline at end of file +.gdb_history + +# cmake makefile +build/Makefile + +# debian stuff +.pc/ \ No newline at end of file diff --git a/Makefile b/Makefile index acdc56d4..06c2f1a3 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,10 @@ I2PD := i2pd GREP := grep DEPS := obj/make.dep +LIB_SRC_DIR := libi2pd +LIB_CLIENT_SRC_DIR := libi2pd_client +DAEMON_SRC_DIR := daemon + include filelist.mk USE_AESNI := yes @@ -17,24 +21,23 @@ USE_UPNP := no ifeq ($(WEBSOCKETS),1) NEEDED_CXXFLAGS += -DWITH_EVENTS - DAEMON_SRC += Websocket.cpp endif ifeq ($(UNAME),Darwin) - DAEMON_SRC += DaemonLinux.cpp + DAEMON_SRC += $(DAEMON_SRC_DIR)/UnixDaemon.cpp ifeq ($(HOMEBREW),1) include Makefile.homebrew else include Makefile.osx endif else ifeq ($(shell echo $(UNAME) | $(GREP) -Ec '(Free|Open)BSD'),1) - DAEMON_SRC += DaemonLinux.cpp + DAEMON_SRC += $(DAEMON_SRC_DIR)/UnixDaemon.cpp include Makefile.bsd else ifeq ($(UNAME),Linux) - DAEMON_SRC += DaemonLinux.cpp + DAEMON_SRC += $(DAEMON_SRC_DIR)/UnixDaemon.cpp include Makefile.linux -else # win32 mingw - DAEMON_SRC += DaemonWin32.cpp Win32/Win32Service.cpp Win32/Win32App.cpp +else + DAEMON_SRC += Win32/DaemonWin32.cpp Win32/Win32Service.cpp Win32/Win32App.cpp include Makefile.mingw endif @@ -42,11 +45,16 @@ ifeq ($(USE_MESHNET),yes) NEEDED_CXXFLAGS += -DMESHNET endif +NEEDED_CXXFLAGS += -I$(LIB_SRC_DIR) -I$(LIB_CLIENT_SRC_DIR) + all: mk_obj_dir $(ARLIB) $(ARLIB_CLIENT) $(I2PD) mk_obj_dir: @mkdir -p obj @mkdir -p obj/Win32 + @mkdir -p obj/$(LIB_SRC_DIR) + @mkdir -p obj/$(LIB_CLIENT_SRC_DIR) + @mkdir -p obj/$(DAEMON_SRC_DIR) api: mk_obj_dir $(SHLIB) $(ARLIB) api_client: mk_obj_dir $(SHLIB) $(ARLIB) $(SHLIB_CLIENT) $(ARLIB_CLIENT) diff --git a/DaemonWin32.cpp b/Win32/DaemonWin32.cpp similarity index 100% rename from DaemonWin32.cpp rename to Win32/DaemonWin32.cpp diff --git a/Win32/Resource.rc2 b/Win32/Resource.rc2 index 6b9e4aa7..579a9092 100644 --- a/Win32/Resource.rc2 +++ b/Win32/Resource.rc2 @@ -6,7 +6,7 @@ #error this file is not editable by Microsoft Visual C++ #endif //APSTUDIO_INVOKED -#include "../version.h" +#include "../src/core/version.h" ///////////////////////////////////////////////////////////////////////////// // diff --git a/android/build.xml b/android/build.xml index 23e9f065..ed8196c3 100644 --- a/android/build.xml +++ b/android/build.xml @@ -93,5 +93,4 @@ --> - diff --git a/android/jni/Android.mk b/android/jni/Android.mk index ed1ed16a..d5a8f05f 100755 --- a/android/jni/Android.mk +++ b/android/jni/Android.mk @@ -2,7 +2,7 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := i2pd LOCAL_CPP_FEATURES := rtti exceptions -LOCAL_C_INCLUDES += $(IFADDRS_PATH) ../.. +LOCAL_C_INCLUDES += $(IFADDRS_PATH) $(LIB_SRC_PATH) $(LIB_CLIENT_SRC_PATH) $(DAEMON_SRC_PATH) LOCAL_STATIC_LIBRARIES := \ boost_system \ boost_date_time \ @@ -12,59 +12,13 @@ LOCAL_STATIC_LIBRARIES := \ miniupnpc LOCAL_LDLIBS := -lz -LOCAL_SRC_FILES := DaemonAndroid.cpp i2pd_android.cpp \ - $(IFADDRS_PATH)/ifaddrs.c \ - ../../HTTPServer.cpp ../../I2PControl.cpp ../../Daemon.cpp ../../Config.cpp \ - ../../AddressBook.cpp \ - ../../api.cpp \ - ../../Base.cpp \ - ../../BOB.cpp \ - ../../ClientContext.cpp \ - ../../Crypto.cpp \ - ../../Datagram.cpp \ - ../../Destination.cpp \ - ../../Family.cpp \ - ../../FS.cpp \ - ../../Garlic.cpp \ - ../../Gzip.cpp \ - ../../HTTP.cpp \ - ../../HTTPProxy.cpp \ - ../../I2CP.cpp \ - ../../I2NPProtocol.cpp \ - ../../I2PEndian.cpp \ - ../../I2PService.cpp \ - ../../I2PTunnel.cpp \ - ../../Identity.cpp \ - ../../LeaseSet.cpp \ - ../../Log.cpp \ - ../../NetDb.cpp \ - ../../NetDbRequests.cpp \ - ../../NTCPSession.cpp \ - ../../Profiling.cpp \ - ../../Reseed.cpp \ - ../../RouterContext.cpp \ - ../../RouterInfo.cpp \ - ../../SAM.cpp \ - ../../Signature.cpp \ - ../../SOCKS.cpp \ - ../../SSU.cpp \ - ../../SSUData.cpp \ - ../../SSUSession.cpp \ - ../../Streaming.cpp \ - ../../TransitTunnel.cpp \ - ../../Transports.cpp \ - ../../Tunnel.cpp \ - ../../TunnelEndpoint.cpp \ - ../../TunnelGateway.cpp \ - ../../TunnelPool.cpp \ - ../../Timestamp.cpp \ - ../../Event.cpp \ - ../../Gost.cpp \ - ../../WebSocks.cpp \ - ../../BloomFilter.cpp \ - ../../MatchedDestination.cpp \ - ../../util.cpp \ - ../../i2pd.cpp ../../UPnP.cpp +LOCAL_SRC_FILES := DaemonAndroid.cpp i2pd_android.cpp $(IFADDRS_PATH)/ifaddrs.c \ + $(wildcard $(LIB_SRC_PATH)/*.cpp)\ + $(wildcard $(LIB_CLIENT_SRC_PATH)/*.cpp)\ + $(DAEMON_SRC_PATH)/Daemon.cpp \ + $(DAEMON_SRC_PATH)/UPnP.cpp \ + $(DAEMON_SRC_PATH)/HTTPServer.cpp \ + $(DAEMON_SRC_PATH)/I2PControl.cpp include $(BUILD_SHARED_LIBRARY) diff --git a/android/jni/Application.mk b/android/jni/Application.mk index e8a51add..81d6600f 100755 --- a/android/jni/Application.mk +++ b/android/jni/Application.mk @@ -25,8 +25,15 @@ APP_OPTIM := debug # git clone https://github.com/PurpleI2P/MiniUPnP-for-Android-Prebuilt.git # git clone https://github.com/PurpleI2P/android-ifaddrs.git # change to your own -I2PD_LIBS_PATH=/path/to/libraries +I2PD_LIBS_PATH=/tmp/i2pd BOOST_PATH = $(I2PD_LIBS_PATH)/Boost-for-Android-Prebuilt OPENSSL_PATH = $(I2PD_LIBS_PATH)/OpenSSL-for-Android-Prebuilt MINIUPNP_PATH = $(I2PD_LIBS_PATH)/MiniUPnP-for-Android-Prebuilt IFADDRS_PATH = $(I2PD_LIBS_PATH)/android-ifaddrs + +# don't change me +I2PD_SRC_PATH = $(PWD)/.. + +LIB_SRC_PATH = $(I2PD_SRC_PATH)/libi2pd +LIB_CLIENT_SRC_PATH = $(I2PD_SRC_PATH)/libi2pd_client +DAEMON_SRC_PATH = $(I2PD_SRC_PATH)/daemon diff --git a/android/jni/DaemonAndroid.cpp b/android/jni/DaemonAndroid.cpp index 038a07fa..75584740 100644 --- a/android/jni/DaemonAndroid.cpp +++ b/android/jni/DaemonAndroid.cpp @@ -1,5 +1,5 @@ #include "DaemonAndroid.h" -#include "../../Daemon.h" +#include "Daemon.h" #include #include #include @@ -191,4 +191,3 @@ namespace android } } } - diff --git a/android/jni/i2pd_android.cpp b/android/jni/i2pd_android.cpp index 201b668e..8791c90b 100755 --- a/android/jni/i2pd_android.cpp +++ b/android/jni/i2pd_android.cpp @@ -3,8 +3,8 @@ #include #include "org_purplei2p_i2pd_I2PD_JNI.h" #include "DaemonAndroid.h" -#include "../../RouterContext.h" -#include "../../Transports.h" +#include "RouterContext.h" +#include "Transports.h" JNIEXPORT jstring JNICALL Java_org_purplei2p_i2pd_I2PD_1JNI_getABICompiledWith (JNIEnv * env, jclass clazz) { @@ -59,8 +59,8 @@ JNIEXPORT void JNICALL Java_org_purplei2p_i2pd_I2PD_1JNI_stopAcceptingTunnels } JNIEXPORT void JNICALL Java_org_purplei2p_i2pd_I2PD_1JNI_onNetworkStateChanged - (JNIEnv * env, jclass clazz, jboolean isConnected) + (JNIEnv * env, jclass clazz, jboolean isConnected) { bool isConnectedBool = (bool) isConnected; - i2p::transport::transports.SetOnline (isConnectedBool); + i2p::transport::transports.SetOnline (isConnectedBool); } diff --git a/build/CMakeLists.txt b/build/CMakeLists.txt index 0acf54ca..c82fb109 100644 --- a/build/CMakeLists.txt +++ b/build/CMakeLists.txt @@ -25,44 +25,51 @@ option(WITH_WEBSOCKETS "Build with websocket ui" OFF) set ( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules" ) set ( CMAKE_SOURCE_DIR ".." ) +set(LIBI2PD_SRC_DIR ../libi2pd) +set(LIBI2PD_CLIENT_SRC_DIR ../libi2pd_client) + +include_directories(${LIBI2PD_SRC_DIR}) +include_directories(${LIBI2PD_CLIENT_SRC_DIR}) + set (LIBI2PD_SRC - "${CMAKE_SOURCE_DIR}/BloomFilter.cpp" - "${CMAKE_SOURCE_DIR}/Config.cpp" - "${CMAKE_SOURCE_DIR}/Crypto.cpp" - "${CMAKE_SOURCE_DIR}/Garlic.cpp" - "${CMAKE_SOURCE_DIR}/Gzip.cpp" - "${CMAKE_SOURCE_DIR}/I2NPProtocol.cpp" - "${CMAKE_SOURCE_DIR}/Identity.cpp" - "${CMAKE_SOURCE_DIR}/LeaseSet.cpp" - "${CMAKE_SOURCE_DIR}/FS.cpp" - "${CMAKE_SOURCE_DIR}/Log.cpp" - "${CMAKE_SOURCE_DIR}/NTCPSession.cpp" - "${CMAKE_SOURCE_DIR}/NetDbRequests.cpp" - "${CMAKE_SOURCE_DIR}/NetDb.cpp" - "${CMAKE_SOURCE_DIR}/Profiling.cpp" - "${CMAKE_SOURCE_DIR}/Reseed.cpp" - "${CMAKE_SOURCE_DIR}/RouterContext.cpp" - "${CMAKE_SOURCE_DIR}/RouterInfo.cpp" - "${CMAKE_SOURCE_DIR}/SSU.cpp" - "${CMAKE_SOURCE_DIR}/SSUData.cpp" - "${CMAKE_SOURCE_DIR}/SSUSession.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}/Transports.cpp" - "${CMAKE_SOURCE_DIR}/TunnelEndpoint.cpp" - "${CMAKE_SOURCE_DIR}/TunnelPool.cpp" - "${CMAKE_SOURCE_DIR}/Base.cpp" - "${CMAKE_SOURCE_DIR}/util.cpp" - "${CMAKE_SOURCE_DIR}/Datagram.cpp" - "${CMAKE_SOURCE_DIR}/Family.cpp" - "${CMAKE_SOURCE_DIR}/Signature.cpp" - "${CMAKE_SOURCE_DIR}/Timestamp.cpp" - "${CMAKE_SOURCE_DIR}/api.cpp" - "${CMAKE_SOURCE_DIR}/Event.cpp" - "${CMAKE_SOURCE_DIR}/Gost.cpp" + "${LIBI2PD_SRC_DIR}/BloomFilter.cpp" + "${LIBI2PD_SRC_DIR}/Config.cpp" + "${LIBI2PD_SRC_DIR}/Crypto.cpp" + "${LIBI2PD_SRC_DIR}/Garlic.cpp" + "${LIBI2PD_SRC_DIR}/Gzip.cpp" + "${LIBI2PD_SRC_DIR}/HTTP.cpp" + "${LIBI2PD_SRC_DIR}/I2NPProtocol.cpp" + "${LIBI2PD_SRC_DIR}/Identity.cpp" + "${LIBI2PD_SRC_DIR}/LeaseSet.cpp" + "${LIBI2PD_SRC_DIR}/FS.cpp" + "${LIBI2PD_SRC_DIR}/Log.cpp" + "${LIBI2PD_SRC_DIR}/NTCPSession.cpp" + "${LIBI2PD_SRC_DIR}/NetDbRequests.cpp" + "${LIBI2PD_SRC_DIR}/NetDb.cpp" + "${LIBI2PD_SRC_DIR}/Profiling.cpp" + "${LIBI2PD_SRC_DIR}/Reseed.cpp" + "${LIBI2PD_SRC_DIR}/RouterContext.cpp" + "${LIBI2PD_SRC_DIR}/RouterInfo.cpp" + "${LIBI2PD_SRC_DIR}/SSU.cpp" + "${LIBI2PD_SRC_DIR}/SSUData.cpp" + "${LIBI2PD_SRC_DIR}/SSUSession.cpp" + "${LIBI2PD_SRC_DIR}/Streaming.cpp" + "${LIBI2PD_SRC_DIR}/Destination.cpp" + "${LIBI2PD_SRC_DIR}/TransitTunnel.cpp" + "${LIBI2PD_SRC_DIR}/Tunnel.cpp" + "${LIBI2PD_SRC_DIR}/TunnelGateway.cpp" + "${LIBI2PD_SRC_DIR}/Transports.cpp" + "${LIBI2PD_SRC_DIR}/TunnelEndpoint.cpp" + "${LIBI2PD_SRC_DIR}/TunnelPool.cpp" + "${LIBI2PD_SRC_DIR}/Base.cpp" + "${LIBI2PD_SRC_DIR}/util.cpp" + "${LIBI2PD_SRC_DIR}/Datagram.cpp" + "${LIBI2PD_SRC_DIR}/Family.cpp" + "${LIBI2PD_SRC_DIR}/Signature.cpp" + "${LIBI2PD_SRC_DIR}/Timestamp.cpp" + "${LIBI2PD_SRC_DIR}/api.cpp" + "${LIBI2PD_SRC_DIR}/Event.cpp" + "${LIBI2PD_SRC_DIR}/Gost.cpp" ) if (WITH_WEBSOCKETS) @@ -89,31 +96,32 @@ install(TARGETS libi2pd # install(EXPORT libi2pd DESTINATION ${CMAKE_INSTALL_LIBDIR}) set (CLIENT_SRC - "${CMAKE_SOURCE_DIR}/AddressBook.cpp" - "${CMAKE_SOURCE_DIR}/BOB.cpp" - "${CMAKE_SOURCE_DIR}/ClientContext.cpp" - "${CMAKE_SOURCE_DIR}/MatchedDestination.cpp" - "${CMAKE_SOURCE_DIR}/I2PTunnel.cpp" - "${CMAKE_SOURCE_DIR}/I2PService.cpp" - "${CMAKE_SOURCE_DIR}/SAM.cpp" - "${CMAKE_SOURCE_DIR}/SOCKS.cpp" - "${CMAKE_SOURCE_DIR}/HTTP.cpp" - "${CMAKE_SOURCE_DIR}/HTTPProxy.cpp" - "${CMAKE_SOURCE_DIR}/I2CP.cpp" - "${CMAKE_SOURCE_DIR}/WebSocks.cpp" - ) + "${LIBI2PD_CLIENT_SRC_DIR}/AddressBook.cpp" + "${LIBI2PD_CLIENT_SRC_DIR}/BOB.cpp" + "${LIBI2PD_CLIENT_SRC_DIR}/ClientContext.cpp" + "${LIBI2PD_CLIENT_SRC_DIR}/MatchedDestination.cpp" + "${LIBI2PD_CLIENT_SRC_DIR}/I2PTunnel.cpp" + "${LIBI2PD_CLIENT_SRC_DIR}/I2PService.cpp" + "${LIBI2PD_CLIENT_SRC_DIR}/SAM.cpp" + "${LIBI2PD_CLIENT_SRC_DIR}/SOCKS.cpp" + "${LIBI2PD_CLIENT_SRC_DIR}/HTTPProxy.cpp" + "${LIBI2PD_CLIENT_SRC_DIR}/I2CP.cpp" + "${LIBI2PD_CLIENT_SRC_DIR}/WebSocks.cpp" +) if(WITH_WEBSOCKETS) - list (APPEND CLIENT_SRC "${CMAKE_SOURCE_DIR}/Websocket.cpp") + list (APPEND CLIENT_SRC "${LIBI2PD_SRC_DIR}/Websocket.cpp") endif () add_library(i2pdclient ${CLIENT_SRC}) +set(DAEMON_SRC_DIR ../daemon) + set (DAEMON_SRC - "${CMAKE_SOURCE_DIR}/Daemon.cpp" - "${CMAKE_SOURCE_DIR}/HTTPServer.cpp" - "${CMAKE_SOURCE_DIR}/I2PControl.cpp" - "${CMAKE_SOURCE_DIR}/i2pd.cpp" - "${CMAKE_SOURCE_DIR}/UPnP.cpp" + "${DAEMON_SRC_DIR}/Daemon.cpp" + "${DAEMON_SRC_DIR}/HTTPServer.cpp" + "${DAEMON_SRC_DIR}/I2PControl.cpp" + "${DAEMON_SRC_DIR}/i2pd.cpp" + "${DAEMON_SRC_DIR}/UPnP.cpp" ) if (WITH_MESHNET) @@ -178,22 +186,22 @@ endif () # compiler flags customization (by system) if (CMAKE_SYSTEM_NAME STREQUAL "Linux") - list (APPEND DAEMON_SRC "${CMAKE_SOURCE_DIR}/DaemonLinux.cpp") + list (APPEND DAEMON_SRC "${DAEMON_SRC_DIR}/UnixDaemon.cpp") # "'sleep_for' is not a member of 'std::this_thread'" in gcc 4.7/4.8 add_definitions( "-D_GLIBCXX_USE_NANOSLEEP=1" ) elseif (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") - list (APPEND DAEMON_SRC "${CMAKE_SOURCE_DIR}/DaemonLinux.cpp") + list (APPEND DAEMON_SRC "${DAEMON_SRC_DIR}/UnixDaemon.cpp") # "'sleep_for' is not a member of 'std::this_thread'" in gcc 4.7/4.8 add_definitions( "-D_GLIBCXX_USE_NANOSLEEP=1" ) elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin") - list (APPEND DAEMON_SRC "${CMAKE_SOURCE_DIR}/DaemonLinux.cpp") -elseif (CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") - list (APPEND DAEMON_SRC "${CMAKE_SOURCE_DIR}/DaemonLinux.cpp") -elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows" OR MSYS) - list (APPEND DAEMON_SRC "${CMAKE_SOURCE_DIR}/DaemonWin32.cpp") + list (APPEND DAEMON_SRC "${DAEMON_SRC_DIR}/UnixDaemon.cpp") + elseif (CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") + list (APPEND DAEMON_SRC "${DAEMON_SRC_DIR}/UnixDaemon.cpp") + elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows" OR MSYS) + list (APPEND DAEMON_SRC "${CMAKE_SOURCE_DIR}/Win32/DaemonWin32.cpp") if (WITH_GUI) list (APPEND DAEMON_SRC "${CMAKE_SOURCE_DIR}/Win32/Win32App.cpp") - set_source_files_properties("${CMAKE_SOURCE_DIR}/DaemonWin32.cpp" + set_source_files_properties("${CMAKE_SOURCE_DIR}/Win32/DaemonWin32.cpp" PROPERTIES COMPILE_DEFINITIONS WIN32_APP) endif () list (APPEND DAEMON_SRC "${CMAKE_SOURCE_DIR}/Win32/Win32Service.cpp") @@ -275,7 +283,7 @@ endif () if (WITH_PCH) include_directories(BEFORE ${CMAKE_BINARY_DIR}) - add_library(stdafx STATIC "${CMAKE_SOURCE_DIR}/stdafx.cpp") + add_library(stdafx STATIC "${LIBI2PD_SRC_DIR}/stdafx.cpp") if(MSVC) target_compile_options(stdafx PRIVATE /Ycstdafx.h /Zm155) add_custom_command(TARGET stdafx POST_BUILD @@ -291,10 +299,10 @@ if (WITH_PCH) get_directory_property(DEFS DEFINITIONS) string(REPLACE " " ";" FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${BTU}} ${DEFS}") add_custom_command(TARGET stdafx PRE_BUILD - COMMAND ${CMAKE_CXX_COMPILER} ${FLAGS} -c ${CMAKE_CURRENT_SOURCE_DIR}/../stdafx.h -o ${CMAKE_BINARY_DIR}/stdafx.h.gch + COMMAND ${CMAKE_CXX_COMPILER} ${FLAGS} -c ${CMAKE_CURRENT_SOURCE_DIR}/../libi2pd/stdafx.h -o ${CMAKE_BINARY_DIR}/stdafx.h.gch ) - target_compile_options(libi2pd PRIVATE -include stdafx.h) - target_compile_options(i2pdclient PRIVATE -include stdafx.h) + target_compile_options(libi2pd PRIVATE -include libi2pd/stdafx.h) + target_compile_options(i2pdclient PRIVATE -include libi2pd/stdafx.h) endif() target_link_libraries(libi2pd stdafx) endif() @@ -402,7 +410,7 @@ if (WITH_BINARY) if (MSVC) target_compile_options("${PROJECT_NAME}" PRIVATE /FIstdafx.h /Yustdafx.h /Zm155 "/Fp${CMAKE_BINARY_DIR}/stdafx.dir/$/stdafx.pch") else() - target_compile_options("${PROJECT_NAME}" PRIVATE -include stdafx.h) + target_compile_options("${PROJECT_NAME}" PRIVATE -include src/core/stdafx.h) endif() endif() @@ -453,7 +461,7 @@ install(FILES "C:/projects/openssl-$ENV{OPENSSL}/LICENSE" OPTIONAL # for local builds only! ) -file(GLOB_RECURSE I2PD_SOURCES "../*.cpp" "../build" "../Win32" "../Makefile*") +file(GLOB_RECURSE I2PD_SOURCES "../libi2pd/*.cpp" "../libi2pd_client/*.cpp" "../daemon/*.cpp" "../build" "../Win32" "../Makefile*") install(FILES ${I2PD_SOURCES} DESTINATION src/ COMPONENT Source) # install(DIRECTORY ../ DESTINATION src/ # # OPTIONAL @@ -462,7 +470,7 @@ install(FILES ${I2PD_SOURCES} DESTINATION src/ COMPONENT Source) # PATTERN "*.cpp" # ) -file(GLOB I2PD_HEADERS "../*.h") +file(GLOB I2PD_HEADERS "../libi2pd/*.h" "../libi2pd_client/*.h" "../daemon/*.h") install(FILES ${I2PD_HEADERS} DESTINATION src/ COMPONENT Headers) # install(DIRECTORY ../ DESTINATION src/ # # OPTIONAL @@ -475,7 +483,7 @@ set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Purple I2P, a C++ I2P daemon") set(CPACK_PACKAGE_VENDOR "Purple I2P") set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/../README.md") set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/../LICENSE") -file(READ ../version.h version_h) +file(READ ../libi2pd/version.h version_h) string(REGEX REPLACE ".*I2PD_VERSION_MAJOR ([0-9]+).*" "\\1" CPACK_PACKAGE_VERSION_MAJOR "${version_h}") string(REGEX REPLACE ".*I2PD_VERSION_MINOR ([0-9]+).*" "\\1" CPACK_PACKAGE_VERSION_MINOR "${version_h}") string(REGEX REPLACE ".*I2PD_VERSION_MICRO ([0-9]+).*" "\\1" CPACK_PACKAGE_VERSION_MICRO "${version_h}") diff --git a/Daemon.cpp b/daemon/Daemon.cpp similarity index 100% rename from Daemon.cpp rename to daemon/Daemon.cpp diff --git a/Daemon.h b/daemon/Daemon.h similarity index 100% rename from Daemon.h rename to daemon/Daemon.h diff --git a/HTTPServer.cpp b/daemon/HTTPServer.cpp similarity index 100% rename from HTTPServer.cpp rename to daemon/HTTPServer.cpp diff --git a/HTTPServer.h b/daemon/HTTPServer.h similarity index 100% rename from HTTPServer.h rename to daemon/HTTPServer.h diff --git a/I2PControl.cpp b/daemon/I2PControl.cpp similarity index 100% rename from I2PControl.cpp rename to daemon/I2PControl.cpp diff --git a/I2PControl.h b/daemon/I2PControl.h similarity index 100% rename from I2PControl.h rename to daemon/I2PControl.h diff --git a/UPnP.cpp b/daemon/UPnP.cpp similarity index 100% rename from UPnP.cpp rename to daemon/UPnP.cpp diff --git a/UPnP.h b/daemon/UPnP.h similarity index 100% rename from UPnP.h rename to daemon/UPnP.h diff --git a/DaemonLinux.cpp b/daemon/UnixDaemon.cpp similarity index 100% rename from DaemonLinux.cpp rename to daemon/UnixDaemon.cpp diff --git a/i2pd.cpp b/daemon/i2pd.cpp similarity index 100% rename from i2pd.cpp rename to daemon/i2pd.cpp diff --git a/filelist.mk b/filelist.mk index 5fb5ea1d..8d451dc9 100644 --- a/filelist.mk +++ b/filelist.mk @@ -1,16 +1,22 @@ -LIB_SRC = \ - BloomFilter.cpp Gzip.cpp Crypto.cpp Datagram.cpp Garlic.cpp I2NPProtocol.cpp LeaseSet.cpp \ - Log.cpp NTCPSession.cpp NetDb.cpp NetDbRequests.cpp Profiling.cpp \ - Reseed.cpp RouterContext.cpp RouterInfo.cpp Signature.cpp SSU.cpp \ - SSUSession.cpp SSUData.cpp Streaming.cpp Identity.cpp TransitTunnel.cpp \ - Transports.cpp Tunnel.cpp TunnelEndpoint.cpp TunnelPool.cpp TunnelGateway.cpp \ - Destination.cpp Base.cpp I2PEndian.cpp FS.cpp Config.cpp Family.cpp \ - Config.cpp HTTP.cpp Timestamp.cpp util.cpp api.cpp Event.cpp Gost.cpp +#LIB_SRC = \ +# BloomFilter.cpp Gzip.cpp Crypto.cpp Datagram.cpp Garlic.cpp I2NPProtocol.cpp LeaseSet.cpp \ +# Log.cpp NTCPSession.cpp NetDb.cpp NetDbRequests.cpp Profiling.cpp \ +# Reseed.cpp RouterContext.cpp RouterInfo.cpp Signature.cpp SSU.cpp \ +# SSUSession.cpp SSUData.cpp Streaming.cpp Identity.cpp TransitTunnel.cpp \ +# Transports.cpp Tunnel.cpp TunnelEndpoint.cpp TunnelPool.cpp TunnelGateway.cpp \ +# Destination.cpp Base.cpp I2PEndian.cpp FS.cpp Config.cpp Family.cpp \ +# Config.cpp HTTP.cpp Timestamp.cpp util.cpp api.cpp Event.cpp Gost.cpp -LIB_CLIENT_SRC = \ - AddressBook.cpp BOB.cpp ClientContext.cpp I2PTunnel.cpp I2PService.cpp MatchedDestination.cpp \ - SAM.cpp SOCKS.cpp HTTPProxy.cpp I2CP.cpp WebSocks.cpp +LIB_SRC = $(wildcard $(LIB_SRC_DIR)/*.cpp) + +#LIB_CLIENT_SRC = \ +# AddressBook.cpp BOB.cpp ClientContext.cpp I2PTunnel.cpp I2PService.cpp MatchedDestination.cpp \ +# SAM.cpp SOCKS.cpp HTTPProxy.cpp I2CP.cpp WebSocks.cpp + +LIB_CLIENT_SRC = $(wildcard $(LIB_CLIENT_SRC_DIR)/*.cpp) # also: Daemon{Linux,Win32}.cpp will be added later -DAEMON_SRC = \ - HTTPServer.cpp I2PControl.cpp UPnP.cpp Daemon.cpp i2pd.cpp +#DAEMON_SRC = \ +# HTTPServer.cpp I2PControl.cpp UPnP.cpp Daemon.cpp i2pd.cpp + +DAEMON_SRC = $(wildcard $(DAEMON_SRC_DIR)/*.cpp) diff --git a/Base.cpp b/libi2pd/Base.cpp similarity index 100% rename from Base.cpp rename to libi2pd/Base.cpp diff --git a/Base.h b/libi2pd/Base.h similarity index 100% rename from Base.h rename to libi2pd/Base.h diff --git a/BloomFilter.cpp b/libi2pd/BloomFilter.cpp similarity index 100% rename from BloomFilter.cpp rename to libi2pd/BloomFilter.cpp diff --git a/BloomFilter.h b/libi2pd/BloomFilter.h similarity index 100% rename from BloomFilter.h rename to libi2pd/BloomFilter.h diff --git a/Config.cpp b/libi2pd/Config.cpp similarity index 100% rename from Config.cpp rename to libi2pd/Config.cpp diff --git a/Config.h b/libi2pd/Config.h similarity index 100% rename from Config.h rename to libi2pd/Config.h diff --git a/Crypto.cpp b/libi2pd/Crypto.cpp similarity index 100% rename from Crypto.cpp rename to libi2pd/Crypto.cpp diff --git a/Crypto.h b/libi2pd/Crypto.h similarity index 100% rename from Crypto.h rename to libi2pd/Crypto.h diff --git a/Datagram.cpp b/libi2pd/Datagram.cpp similarity index 100% rename from Datagram.cpp rename to libi2pd/Datagram.cpp diff --git a/Datagram.h b/libi2pd/Datagram.h similarity index 100% rename from Datagram.h rename to libi2pd/Datagram.h diff --git a/Destination.cpp b/libi2pd/Destination.cpp similarity index 100% rename from Destination.cpp rename to libi2pd/Destination.cpp diff --git a/Destination.h b/libi2pd/Destination.h similarity index 100% rename from Destination.h rename to libi2pd/Destination.h diff --git a/Event.cpp b/libi2pd/Event.cpp similarity index 100% rename from Event.cpp rename to libi2pd/Event.cpp diff --git a/Event.h b/libi2pd/Event.h similarity index 100% rename from Event.h rename to libi2pd/Event.h diff --git a/FS.cpp b/libi2pd/FS.cpp similarity index 100% rename from FS.cpp rename to libi2pd/FS.cpp diff --git a/FS.h b/libi2pd/FS.h similarity index 100% rename from FS.h rename to libi2pd/FS.h diff --git a/Family.cpp b/libi2pd/Family.cpp similarity index 100% rename from Family.cpp rename to libi2pd/Family.cpp diff --git a/Family.h b/libi2pd/Family.h similarity index 100% rename from Family.h rename to libi2pd/Family.h diff --git a/Garlic.cpp b/libi2pd/Garlic.cpp similarity index 100% rename from Garlic.cpp rename to libi2pd/Garlic.cpp diff --git a/Garlic.h b/libi2pd/Garlic.h similarity index 100% rename from Garlic.h rename to libi2pd/Garlic.h diff --git a/Gost.cpp b/libi2pd/Gost.cpp similarity index 100% rename from Gost.cpp rename to libi2pd/Gost.cpp diff --git a/Gost.h b/libi2pd/Gost.h similarity index 100% rename from Gost.h rename to libi2pd/Gost.h diff --git a/Gzip.cpp b/libi2pd/Gzip.cpp similarity index 100% rename from Gzip.cpp rename to libi2pd/Gzip.cpp diff --git a/Gzip.h b/libi2pd/Gzip.h similarity index 100% rename from Gzip.h rename to libi2pd/Gzip.h diff --git a/HTTP.cpp b/libi2pd/HTTP.cpp similarity index 100% rename from HTTP.cpp rename to libi2pd/HTTP.cpp diff --git a/HTTP.h b/libi2pd/HTTP.h similarity index 100% rename from HTTP.h rename to libi2pd/HTTP.h diff --git a/I2NPProtocol.cpp b/libi2pd/I2NPProtocol.cpp similarity index 100% rename from I2NPProtocol.cpp rename to libi2pd/I2NPProtocol.cpp diff --git a/I2NPProtocol.h b/libi2pd/I2NPProtocol.h similarity index 100% rename from I2NPProtocol.h rename to libi2pd/I2NPProtocol.h diff --git a/I2PEndian.cpp b/libi2pd/I2PEndian.cpp similarity index 100% rename from I2PEndian.cpp rename to libi2pd/I2PEndian.cpp diff --git a/I2PEndian.h b/libi2pd/I2PEndian.h similarity index 100% rename from I2PEndian.h rename to libi2pd/I2PEndian.h diff --git a/Identity.cpp b/libi2pd/Identity.cpp similarity index 100% rename from Identity.cpp rename to libi2pd/Identity.cpp diff --git a/Identity.h b/libi2pd/Identity.h similarity index 100% rename from Identity.h rename to libi2pd/Identity.h diff --git a/LeaseSet.cpp b/libi2pd/LeaseSet.cpp similarity index 100% rename from LeaseSet.cpp rename to libi2pd/LeaseSet.cpp diff --git a/LeaseSet.h b/libi2pd/LeaseSet.h similarity index 100% rename from LeaseSet.h rename to libi2pd/LeaseSet.h diff --git a/LittleBigEndian.h b/libi2pd/LittleBigEndian.h similarity index 100% rename from LittleBigEndian.h rename to libi2pd/LittleBigEndian.h diff --git a/Log.cpp b/libi2pd/Log.cpp similarity index 100% rename from Log.cpp rename to libi2pd/Log.cpp diff --git a/Log.h b/libi2pd/Log.h similarity index 100% rename from Log.h rename to libi2pd/Log.h diff --git a/NTCPSession.cpp b/libi2pd/NTCPSession.cpp similarity index 100% rename from NTCPSession.cpp rename to libi2pd/NTCPSession.cpp diff --git a/NTCPSession.h b/libi2pd/NTCPSession.h similarity index 100% rename from NTCPSession.h rename to libi2pd/NTCPSession.h diff --git a/NetDb.cpp b/libi2pd/NetDb.cpp similarity index 100% rename from NetDb.cpp rename to libi2pd/NetDb.cpp diff --git a/NetDb.h b/libi2pd/NetDb.h similarity index 100% rename from NetDb.h rename to libi2pd/NetDb.h diff --git a/NetDbRequests.cpp b/libi2pd/NetDbRequests.cpp similarity index 100% rename from NetDbRequests.cpp rename to libi2pd/NetDbRequests.cpp diff --git a/NetDbRequests.h b/libi2pd/NetDbRequests.h similarity index 100% rename from NetDbRequests.h rename to libi2pd/NetDbRequests.h diff --git a/Profiling.cpp b/libi2pd/Profiling.cpp similarity index 100% rename from Profiling.cpp rename to libi2pd/Profiling.cpp diff --git a/Profiling.h b/libi2pd/Profiling.h similarity index 100% rename from Profiling.h rename to libi2pd/Profiling.h diff --git a/Queue.h b/libi2pd/Queue.h similarity index 100% rename from Queue.h rename to libi2pd/Queue.h diff --git a/Reseed.cpp b/libi2pd/Reseed.cpp similarity index 100% rename from Reseed.cpp rename to libi2pd/Reseed.cpp diff --git a/Reseed.h b/libi2pd/Reseed.h similarity index 100% rename from Reseed.h rename to libi2pd/Reseed.h diff --git a/RouterContext.cpp b/libi2pd/RouterContext.cpp similarity index 100% rename from RouterContext.cpp rename to libi2pd/RouterContext.cpp diff --git a/RouterContext.h b/libi2pd/RouterContext.h similarity index 100% rename from RouterContext.h rename to libi2pd/RouterContext.h diff --git a/RouterInfo.cpp b/libi2pd/RouterInfo.cpp similarity index 100% rename from RouterInfo.cpp rename to libi2pd/RouterInfo.cpp diff --git a/RouterInfo.h b/libi2pd/RouterInfo.h similarity index 100% rename from RouterInfo.h rename to libi2pd/RouterInfo.h diff --git a/SSU.cpp b/libi2pd/SSU.cpp similarity index 100% rename from SSU.cpp rename to libi2pd/SSU.cpp diff --git a/SSU.h b/libi2pd/SSU.h similarity index 100% rename from SSU.h rename to libi2pd/SSU.h diff --git a/SSUData.cpp b/libi2pd/SSUData.cpp similarity index 100% rename from SSUData.cpp rename to libi2pd/SSUData.cpp diff --git a/SSUData.h b/libi2pd/SSUData.h similarity index 100% rename from SSUData.h rename to libi2pd/SSUData.h diff --git a/SSUSession.cpp b/libi2pd/SSUSession.cpp similarity index 100% rename from SSUSession.cpp rename to libi2pd/SSUSession.cpp diff --git a/SSUSession.h b/libi2pd/SSUSession.h similarity index 100% rename from SSUSession.h rename to libi2pd/SSUSession.h diff --git a/Signature.cpp b/libi2pd/Signature.cpp similarity index 100% rename from Signature.cpp rename to libi2pd/Signature.cpp diff --git a/Signature.h b/libi2pd/Signature.h similarity index 100% rename from Signature.h rename to libi2pd/Signature.h diff --git a/Streaming.cpp b/libi2pd/Streaming.cpp similarity index 100% rename from Streaming.cpp rename to libi2pd/Streaming.cpp diff --git a/Streaming.h b/libi2pd/Streaming.h similarity index 100% rename from Streaming.h rename to libi2pd/Streaming.h diff --git a/Tag.h b/libi2pd/Tag.h similarity index 100% rename from Tag.h rename to libi2pd/Tag.h diff --git a/Timestamp.cpp b/libi2pd/Timestamp.cpp similarity index 100% rename from Timestamp.cpp rename to libi2pd/Timestamp.cpp diff --git a/Timestamp.h b/libi2pd/Timestamp.h similarity index 100% rename from Timestamp.h rename to libi2pd/Timestamp.h diff --git a/TransitTunnel.cpp b/libi2pd/TransitTunnel.cpp similarity index 100% rename from TransitTunnel.cpp rename to libi2pd/TransitTunnel.cpp diff --git a/TransitTunnel.h b/libi2pd/TransitTunnel.h similarity index 100% rename from TransitTunnel.h rename to libi2pd/TransitTunnel.h diff --git a/TransportSession.h b/libi2pd/TransportSession.h similarity index 100% rename from TransportSession.h rename to libi2pd/TransportSession.h diff --git a/Transports.cpp b/libi2pd/Transports.cpp similarity index 100% rename from Transports.cpp rename to libi2pd/Transports.cpp diff --git a/Transports.h b/libi2pd/Transports.h similarity index 100% rename from Transports.h rename to libi2pd/Transports.h diff --git a/Tunnel.cpp b/libi2pd/Tunnel.cpp similarity index 100% rename from Tunnel.cpp rename to libi2pd/Tunnel.cpp diff --git a/Tunnel.h b/libi2pd/Tunnel.h similarity index 100% rename from Tunnel.h rename to libi2pd/Tunnel.h diff --git a/TunnelBase.h b/libi2pd/TunnelBase.h similarity index 100% rename from TunnelBase.h rename to libi2pd/TunnelBase.h diff --git a/TunnelConfig.h b/libi2pd/TunnelConfig.h similarity index 100% rename from TunnelConfig.h rename to libi2pd/TunnelConfig.h diff --git a/TunnelEndpoint.cpp b/libi2pd/TunnelEndpoint.cpp similarity index 100% rename from TunnelEndpoint.cpp rename to libi2pd/TunnelEndpoint.cpp diff --git a/TunnelEndpoint.h b/libi2pd/TunnelEndpoint.h similarity index 100% rename from TunnelEndpoint.h rename to libi2pd/TunnelEndpoint.h diff --git a/TunnelGateway.cpp b/libi2pd/TunnelGateway.cpp similarity index 100% rename from TunnelGateway.cpp rename to libi2pd/TunnelGateway.cpp diff --git a/TunnelGateway.h b/libi2pd/TunnelGateway.h similarity index 100% rename from TunnelGateway.h rename to libi2pd/TunnelGateway.h diff --git a/TunnelPool.cpp b/libi2pd/TunnelPool.cpp similarity index 100% rename from TunnelPool.cpp rename to libi2pd/TunnelPool.cpp diff --git a/TunnelPool.h b/libi2pd/TunnelPool.h similarity index 100% rename from TunnelPool.h rename to libi2pd/TunnelPool.h diff --git a/api.cpp b/libi2pd/api.cpp similarity index 100% rename from api.cpp rename to libi2pd/api.cpp diff --git a/api.h b/libi2pd/api.h similarity index 100% rename from api.h rename to libi2pd/api.h diff --git a/stdafx.cpp b/libi2pd/stdafx.cpp similarity index 100% rename from stdafx.cpp rename to libi2pd/stdafx.cpp diff --git a/stdafx.h b/libi2pd/stdafx.h similarity index 100% rename from stdafx.h rename to libi2pd/stdafx.h diff --git a/util.cpp b/libi2pd/util.cpp similarity index 100% rename from util.cpp rename to libi2pd/util.cpp diff --git a/util.h b/libi2pd/util.h similarity index 100% rename from util.h rename to libi2pd/util.h diff --git a/version.h b/libi2pd/version.h similarity index 100% rename from version.h rename to libi2pd/version.h diff --git a/AddressBook.cpp b/libi2pd_client/AddressBook.cpp similarity index 100% rename from AddressBook.cpp rename to libi2pd_client/AddressBook.cpp diff --git a/AddressBook.h b/libi2pd_client/AddressBook.h similarity index 100% rename from AddressBook.h rename to libi2pd_client/AddressBook.h diff --git a/BOB.cpp b/libi2pd_client/BOB.cpp similarity index 100% rename from BOB.cpp rename to libi2pd_client/BOB.cpp diff --git a/BOB.h b/libi2pd_client/BOB.h similarity index 100% rename from BOB.h rename to libi2pd_client/BOB.h diff --git a/ClientContext.cpp b/libi2pd_client/ClientContext.cpp similarity index 100% rename from ClientContext.cpp rename to libi2pd_client/ClientContext.cpp diff --git a/ClientContext.h b/libi2pd_client/ClientContext.h similarity index 100% rename from ClientContext.h rename to libi2pd_client/ClientContext.h diff --git a/HTTPProxy.cpp b/libi2pd_client/HTTPProxy.cpp similarity index 100% rename from HTTPProxy.cpp rename to libi2pd_client/HTTPProxy.cpp diff --git a/HTTPProxy.h b/libi2pd_client/HTTPProxy.h similarity index 100% rename from HTTPProxy.h rename to libi2pd_client/HTTPProxy.h diff --git a/I2CP.cpp b/libi2pd_client/I2CP.cpp similarity index 100% rename from I2CP.cpp rename to libi2pd_client/I2CP.cpp diff --git a/I2CP.h b/libi2pd_client/I2CP.h similarity index 100% rename from I2CP.h rename to libi2pd_client/I2CP.h diff --git a/I2PService.cpp b/libi2pd_client/I2PService.cpp similarity index 100% rename from I2PService.cpp rename to libi2pd_client/I2PService.cpp diff --git a/I2PService.h b/libi2pd_client/I2PService.h similarity index 100% rename from I2PService.h rename to libi2pd_client/I2PService.h diff --git a/I2PTunnel.cpp b/libi2pd_client/I2PTunnel.cpp similarity index 100% rename from I2PTunnel.cpp rename to libi2pd_client/I2PTunnel.cpp diff --git a/I2PTunnel.h b/libi2pd_client/I2PTunnel.h similarity index 100% rename from I2PTunnel.h rename to libi2pd_client/I2PTunnel.h diff --git a/MatchedDestination.cpp b/libi2pd_client/MatchedDestination.cpp similarity index 100% rename from MatchedDestination.cpp rename to libi2pd_client/MatchedDestination.cpp diff --git a/MatchedDestination.h b/libi2pd_client/MatchedDestination.h similarity index 100% rename from MatchedDestination.h rename to libi2pd_client/MatchedDestination.h diff --git a/SAM.cpp b/libi2pd_client/SAM.cpp similarity index 100% rename from SAM.cpp rename to libi2pd_client/SAM.cpp diff --git a/SAM.h b/libi2pd_client/SAM.h similarity index 100% rename from SAM.h rename to libi2pd_client/SAM.h diff --git a/SOCKS.cpp b/libi2pd_client/SOCKS.cpp similarity index 100% rename from SOCKS.cpp rename to libi2pd_client/SOCKS.cpp diff --git a/SOCKS.h b/libi2pd_client/SOCKS.h similarity index 100% rename from SOCKS.h rename to libi2pd_client/SOCKS.h diff --git a/WebSocks.cpp b/libi2pd_client/WebSocks.cpp similarity index 100% rename from WebSocks.cpp rename to libi2pd_client/WebSocks.cpp diff --git a/WebSocks.h b/libi2pd_client/WebSocks.h similarity index 100% rename from WebSocks.h rename to libi2pd_client/WebSocks.h diff --git a/Websocket.cpp b/libi2pd_client/Websocket.cpp similarity index 99% rename from Websocket.cpp rename to libi2pd_client/Websocket.cpp index a1a58c5f..585677f2 100644 --- a/Websocket.cpp +++ b/libi2pd_client/Websocket.cpp @@ -1,3 +1,4 @@ +#ifdef USE_EVENTS #include "Websocket.h" #include "Log.h" @@ -191,3 +192,4 @@ namespace i2p } } } +#endif diff --git a/Websocket.h b/libi2pd_client/Websocket.h similarity index 100% rename from Websocket.h rename to libi2pd_client/Websocket.h diff --git a/qt/i2pd_qt/.gitignore b/qt/i2pd_qt/.gitignore index 35d7caf4..3bbbf71a 100644 --- a/qt/i2pd_qt/.gitignore +++ b/qt/i2pd_qt/.gitignore @@ -1 +1,7 @@ i2pd_qt.pro.user* +moc_* +ui_* +qrc_* +i2pd_qt +Makefile +*.stash diff --git a/qt/i2pd_qt/DaemonQT.cpp b/qt/i2pd_qt/DaemonQT.cpp index 5cd43858..585bd56c 100644 --- a/qt/i2pd_qt/DaemonQT.cpp +++ b/qt/i2pd_qt/DaemonQT.cpp @@ -1,5 +1,5 @@ #include "DaemonQT.h" -#include "../../Daemon.h" +#include "Daemon.h" #include "mainwindow.h" #include #include diff --git a/qt/i2pd_qt/i2pd_qt.pro b/qt/i2pd_qt/i2pd_qt.pro index a55a01da..811fd577 100644 --- a/qt/i2pd_qt/i2pd_qt.pro +++ b/qt/i2pd_qt/i2pd_qt.pro @@ -24,35 +24,49 @@ IFADDRS_PATH = $$MAIN_PATH/android-ifaddrs # 2) Check API 11 # Finally, click Install. -SOURCES += DaemonQT.cpp mainwindow.cpp \ - ../../HTTPServer.cpp ../../I2PControl.cpp ../../Daemon.cpp ../../Config.cpp \ - ../../AddressBook.cpp ../../api.cpp ../../Base.cpp ../../BOB.cpp ../../ClientContext.cpp \ - ../../Crypto.cpp ../../Datagram.cpp ../../Destination.cpp ../../Family.cpp ../../FS.cpp \ - ../../Garlic.cpp ../../HTTP.cpp ../../HTTPProxy.cpp ../../I2CP.cpp ../../I2NPProtocol.cpp \ - ../../I2PEndian.cpp ../../I2PService.cpp ../../I2PTunnel.cpp ../../Identity.cpp \ - ../../LeaseSet.cpp ../../Log.cpp ../../NetDb.cpp ../../NetDbRequests.cpp \ - ../../NTCPSession.cpp ../../Profiling.cpp ../../Reseed.cpp ../../RouterContext.cpp \ - ../../RouterInfo.cpp ../../SAM.cpp ../../Signature.cpp ../../SOCKS.cpp ../../SSU.cpp \ - ../../SSUData.cpp ../../SSUSession.cpp ../../Streaming.cpp ../../TransitTunnel.cpp \ - ../../Transports.cpp ../../Tunnel.cpp ../../TunnelEndpoint.cpp ../../TunnelGateway.cpp \ - ../../TunnelPool.cpp ../../UPnP.cpp ../../Gzip.cpp ../../Timestamp.cpp ../../util.cpp \ - ../../Event.cpp ../../BloomFiler.cpp ../../Gost.cpp ../../MatchedDestination.cpp \ - ../../i2pd.cpp - -HEADERS += DaemonQT.h mainwindow.h \ - ../../HTTPServer.h ../../I2PControl.h ../../UPnP.h ../../Daemon.h ../../Config.h \ - ../../AddressBook.h ../../api.h ../../Base.h ../../BOB.h ../../ClientContext.h \ - ../../Crypto.h ../../Datagram.h ../../Destination.h ../../Family.h ../../FS.h \ - ../../Garlic.h ../../HTTP.h ../../HTTPProxy.h ../../I2CP.h ../../I2NPProtocol.h \ - ../../I2PEndian.h ../../I2PService.h ../../I2PTunnel.h ../../Identity.h ../../LeaseSet.h \ - ../../LittleBigEndian.h ../../Log.h ../../NetDb.h ../../NetDbRequests.h ../../NTCPSession.h \ - ../../Profiling.h ../../Queue.h ../../Reseed.h ../../RouterContext.h ../../RouterInfo.h \ - ../../SAM.h ../../Signature.h ../../SOCKS.h ../../SSU.h ../../SSUData.h ../../SSUSession.h \ - ../../Streaming.h ../../Timestamp.h ../../TransitTunnel.h ../../Transports.h \ - ../../TransportSession.h ../../Tunnel.h ../../TunnelBase.h ../../TunnelConfig.h \ - ../../TunnelEndpoint.h ../../TunnelGateway.h ../../TunnelPool.h ../../UPnP.h \ - ../../util.h ../../version.h ../../Gzip.h ../../Tag.h \ - ../../BloomFiler.h ../../Event.h ../../Gost.h ../../MatchedDestination.h +SOURCES += DaemonQT.cpp mainwindow.cpp +# ../../HTTPServer.cpp ../../I2PControl.cpp ../../Daemon.cpp ../../Config.cpp \ +# ../../AddressBook.cpp ../../api.cpp ../../Base.cpp ../../BOB.cpp ../../ClientContext.cpp \ +# ../../Crypto.cpp ../../Datagram.cpp ../../Destination.cpp ../../Family.cpp ../../FS.cpp \ +# ../../Garlic.cpp ../../HTTP.cpp ../../HTTPProxy.cpp ../../I2CP.cpp ../../I2NPProtocol.cpp \ +# ../../I2PEndian.cpp ../../I2PService.cpp ../../I2PTunnel.cpp ../../Identity.cpp \ +# ../../LeaseSet.cpp ../../Log.cpp ../../NetDb.cpp ../../NetDbRequests.cpp \ +# ../../NTCPSession.cpp ../../Profiling.cpp ../../Reseed.cpp ../../RouterContext.cpp \ +# ../../RouterInfo.cpp ../../SAM.cpp ../../Signature.cpp ../../SOCKS.cpp ../../SSU.cpp \ +# ../../SSUData.cpp ../../SSUSession.cpp ../../Streaming.cpp ../../TransitTunnel.cpp \ +# ../../Transports.cpp ../../Tunnel.cpp ../../TunnelEndpoint.cpp ../../TunnelGateway.cpp \ +# ../../TunnelPool.cpp ../../UPnP.cpp ../../Gzip.cpp ../../Timestamp.cpp ../../util.cpp \ +# ../../Event.cpp ../../BloomFiler.cpp ../../Gost.cpp ../../MatchedDestination.cpp \ +# ../../i2pd.cpp + +SOURCES += $$files(../../libi2pd/*.cpp) +SOURCES += $$files(../../libi2pd_client/*.cpp) +SOURCES += $$files(../../daemon/*.cpp) + +SOURCES -= ../../daemon/UnixDaemon.cpp + +HEADERS += DaemonQT.h mainwindow.h +# ../../HTTPServer.h ../../I2PControl.h ../../UPnP.h ../../Daemon.h ../../Config.h \ +# ../../AddressBook.h ../../api.h ../../Base.h ../../BOB.h ../../ClientContext.h \ +# ../../Crypto.h ../../Datagram.h ../../Destination.h ../../Family.h ../../FS.h \ +# ../../Garlic.h ../../HTTP.h ../../HTTPProxy.h ../../I2CP.h ../../I2NPProtocol.h \ +# ../../I2PEndian.h ../../I2PService.h ../../I2PTunnel.h ../../Identity.h ../../LeaseSet.h \ +# ../../LittleBigEndian.h ../../Log.h ../../NetDb.h ../../NetDbRequests.h ../../NTCPSession.h \ +# ../../Profiling.h ../../Queue.h ../../Reseed.h ../../RouterContext.h ../../RouterInfo.h \ +# ../../SAM.h ../../Signature.h ../../SOCKS.h ../../SSU.h ../../SSUData.h ../../SSUSession.h \ +# ../../Streaming.h ../../Timestamp.h ../../TransitTunnel.h ../../Transports.h \ +# ../../TransportSession.h ../../Tunnel.h ../../TunnelBase.h ../../TunnelConfig.h \ +# ../../TunnelEndpoint.h ../../TunnelGateway.h ../../TunnelPool.h ../../UPnP.h \ +# ../../util.h ../../version.h ../../Gzip.h ../../Tag.h \ +# ../../BloomFiler.h ../../Event.h ../../Gost.h ../../MatchedDestination.h + +HEADERS += $$files(../../libi2pd/*.h) +HEADERS += $$files(../../libi2pd_client/*.h) +HEADERS += $$files(../../daemon/*.h) + +INCLUDEPATH += ../../libi2pd +INCLUDEPATH += ../../libi2pd_client +INCLUDEPATH += ../../daemon FORMS += mainwindow.ui diff --git a/qt/i2pd_qt/mainwindow.cpp b/qt/i2pd_qt/mainwindow.cpp index 1b8af253..4b749473 100644 --- a/qt/i2pd_qt/mainwindow.cpp +++ b/qt/i2pd_qt/mainwindow.cpp @@ -2,7 +2,7 @@ //#include "ui_mainwindow.h" #include #include -#include "../../RouterContext.h" +#include "RouterContext.h" #ifndef ANDROID #include #endif diff --git a/tests/Makefile b/tests/Makefile index d1284602..f769ad35 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,19 +1,19 @@ -CXXFLAGS += -Wall -Wextra -pedantic -O0 -g -std=c++11 -D_GLIBCXX_USE_NANOSLEEP=1 +CXXFLAGS += -Wall -Wextra -pedantic -O0 -g -std=c++11 -D_GLIBCXX_USE_NANOSLEEP=1 -I../libi2pd/ -pthread TESTS = test-gost test-gost-sig test-base-64 all: $(TESTS) run -test-http-%: ../HTTP.cpp test-http-%.cpp +test-http-%: ../libi2pd/HTTP.cpp test-http-%.cpp $(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) $(INCFLAGS) -o $@ $^ -test-base-%: ../Base.cpp test-base-%.cpp +test-base-%: ../libi2pd/Base.cpp test-base-%.cpp $(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) $(INCFLAGS) -o $@ $^ -test-gost: ../Gost.cpp ../I2PEndian.cpp test-gost.cpp +test-gost: ../libi2pd/Gost.cpp ../libi2pd/I2PEndian.cpp test-gost.cpp $(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) $(INCFLAGS) -o $@ $^ -lcrypto -test-gost-sig: ../Gost.cpp ../I2PEndian.cpp ../Signature.cpp ../Crypto.cpp ../Log.cpp test-gost-sig.cpp +test-gost-sig: ../libi2pd/Gost.cpp ../libi2pd/I2PEndian.cpp ../libi2pd/Signature.cpp ../libi2pd/Crypto.cpp ../libi2pd/Log.cpp test-gost-sig.cpp $(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) $(INCFLAGS) -o $@ $^ -lcrypto -lssl -lboost_system run: $(TESTS) diff --git a/tests/test-base-64.cpp b/tests/test-base-64.cpp index d8d0ce2f..0ab46c06 100644 --- a/tests/test-base-64.cpp +++ b/tests/test-base-64.cpp @@ -1,7 +1,7 @@ #include #include -#include "../Base.h" +#include "Base.h" using namespace i2p::data; diff --git a/tests/test-gost-sig.cpp b/tests/test-gost-sig.cpp index 63f7b27e..55cc2d1b 100644 --- a/tests/test-gost-sig.cpp +++ b/tests/test-gost-sig.cpp @@ -2,8 +2,8 @@ #include #include -#include "../Gost.h" -#include "../Signature.h" +#include "Gost.h" +#include "Signature.h" const uint8_t example2[72] = { @@ -30,6 +30,3 @@ int main () i2p::crypto::GOSTR3410_256_Verifier verifier1 (i2p::crypto::eGOSTR3410CryptoProA, pub); assert (verifier1.Verify (example2, 72, signature)); } - - - diff --git a/tests/test-gost.cpp b/tests/test-gost.cpp index b0ab1d51..658e87d4 100644 --- a/tests/test-gost.cpp +++ b/tests/test-gost.cpp @@ -2,7 +2,7 @@ #include #include -#include "../Gost.h" +#include "Gost.h" const uint8_t example1[63] = { @@ -51,19 +51,16 @@ const uint8_t example2_hash_256[32] = int main () { - uint8_t digest[64]; - i2p::crypto::GOSTR3411_2012_512 (example1, 63, digest); + uint8_t digest[64]; + i2p::crypto::GOSTR3411_2012_512 (example1, 63, digest); assert(memcmp (digest, example1_hash_512, 64) == 0); - i2p::crypto::GOSTR3411_2012_256 (example1, 63, digest); + i2p::crypto::GOSTR3411_2012_256 (example1, 63, digest); assert(memcmp (digest, example1_hash_256, 32) == 0); - i2p::crypto::GOSTR3411_2012_512 (example2, 72, digest); + i2p::crypto::GOSTR3411_2012_512 (example2, 72, digest); assert(memcmp (digest, example2_hash_512, 64) == 0); - i2p::crypto::GOSTR3411_2012_256 (example2, 72, digest); + i2p::crypto::GOSTR3411_2012_256 (example2, 72, digest); assert(memcmp (digest, example2_hash_256, 32) == 0); } - - -