diff --git a/.gitignore b/.gitignore
index d3dd81417ec..c472d88e9a0 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 acdc56d47c7..06c2f1a3a29 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 6b9e4aa769f..579a909287d 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 23e9f065c99..ed8196c3d9f 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 ed1ed16a843..d5a8f05f14e 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 e8a51add1f5..81d6600f24d 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 038a07fa86f..755847400ab 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 201b668ef6a..8791c90b072 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 0acf54cab15..c82fb109f1b 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 5fb5ea1d726..8d451dc9552 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 a1a58c5fa21..585677f2c7f 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 35d7caf4b64..3bbbf71a8eb 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 5cd43858a12..585bd56cbfc 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 a55a01da326..811fd577d5d 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 1b8af25392f..4b749473f99 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 d1284602575..f769ad35b14 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 d8d0ce2ff57..0ab46c0673e 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 63f7b27ebc4..55cc2d1bd45 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 b0ab1d51682..658e87d434f 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);
}
-
-
-