Moved some files to util/

This commit is contained in:
EinMByte 2015-07-28 18:37:06 +02:00
parent 581c59a195
commit 3668c27db6
36 changed files with 44 additions and 39 deletions

View File

@ -9,7 +9,7 @@
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
#include <cryptopp/osrng.h> #include <cryptopp/osrng.h>
#include "base64.h" #include "base64.h"
#include "util.h" #include "util/util.h"
#include "Identity.h" #include "Identity.h"
#include "Log.h" #include "Log.h"
#include "NetDb.h" #include "NetDb.h"

View File

@ -9,7 +9,7 @@
#include <mutex> #include <mutex>
#include <boost/asio.hpp> #include <boost/asio.hpp>
#include "base64.h" #include "base64.h"
#include "util.h" #include "util/util.h"
#include "Identity.h" #include "Identity.h"
#include "Log.h" #include "Log.h"

View File

@ -2,7 +2,7 @@
#include <iostream> #include <iostream>
#include <boost/property_tree/ptree.hpp> #include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/ini_parser.hpp> #include <boost/property_tree/ini_parser.hpp>
#include "util.h" #include "util/util.h"
#include "Log.h" #include "Log.h"
#include "Identity.h" #include "Identity.h"
#include "ClientContext.h" #include "ClientContext.h"

View File

@ -12,7 +12,7 @@
#include "Tunnel.h" #include "Tunnel.h"
#include "NetDb.h" #include "NetDb.h"
#include "Garlic.h" #include "Garlic.h"
#include "util.h" #include "util/util.h"
#include "Streaming.h" #include "Streaming.h"
#include "Destination.h" #include "Destination.h"
#include "HTTPServer.h" #include "HTTPServer.h"

View File

@ -9,7 +9,7 @@
#include <sys/stat.h> #include <sys/stat.h>
#include "Log.h" #include "Log.h"
#include "util.h" #include "util/util.h"
void handle_signal(int sig) void handle_signal(int sig)

View File

@ -1,5 +1,5 @@
#include "Daemon.h" #include "Daemon.h"
#include "util.h" #include "util/util.h"
#include "Log.h" #include "Log.h"
#ifdef _WIN32 #ifdef _WIN32

View File

@ -2,9 +2,9 @@
#include <cassert> #include <cassert>
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
#include "Log.h" #include "Log.h"
#include "util.h" #include "util/util.h"
#include "ElGamal.h" #include "ElGamal.h"
#include "Timestamp.h" #include "util/Timestamp.h"
#include "NetDb.h" #include "NetDb.h"
#include "AddressBook.h" #include "AddressBook.h"
#include "Destination.h" #include "Destination.h"

View File

@ -6,7 +6,7 @@
#include "I2NPProtocol.h" #include "I2NPProtocol.h"
#include "Tunnel.h" #include "Tunnel.h"
#include "TunnelPool.h" #include "TunnelPool.h"
#include "Timestamp.h" #include "util/Timestamp.h"
#include "Destination.h" #include "Destination.h"
#include "Garlic.h" #include "Garlic.h"

View File

@ -12,7 +12,7 @@
#include "aes.h" #include "aes.h"
#include "I2NPProtocol.h" #include "I2NPProtocol.h"
#include "LeaseSet.h" #include "LeaseSet.h"
#include "Queue.h" #include "util/Queue.h"
#include "Identity.h" #include "Identity.h"
namespace i2p namespace i2p

View File

@ -5,7 +5,7 @@
#include <string> #include <string>
#include <atomic> #include <atomic>
#include "HTTPProxy.h" #include "HTTPProxy.h"
#include "util.h" #include "util/util.h"
#include "Identity.h" #include "Identity.h"
#include "Streaming.h" #include "Streaming.h"
#include "Destination.h" #include "Destination.h"

View File

@ -3,7 +3,7 @@
#include "I2PEndian.h" #include "I2PEndian.h"
#include <cryptopp/gzip.h> #include <cryptopp/gzip.h>
#include "ElGamal.h" #include "ElGamal.h"
#include "Timestamp.h" #include "util/Timestamp.h"
#include "RouterContext.h" #include "RouterContext.h"
#include "NetDb.h" #include "NetDb.h"
#include "Tunnel.h" #include "Tunnel.h"

View File

@ -14,7 +14,7 @@
#include "RouterContext.h" #include "RouterContext.h"
#include "Daemon.h" #include "Daemon.h"
#include "Tunnel.h" #include "Tunnel.h"
#include "Timestamp.h" #include "util/Timestamp.h"
#include "transport/Transports.h" #include "transport/Transports.h"
#include "version.h" #include "version.h"

View File

@ -4,7 +4,7 @@
#include <cryptopp/osrng.h> #include <cryptopp/osrng.h>
#include "CryptoConst.h" #include "CryptoConst.h"
#include "Log.h" #include "Log.h"
#include "Timestamp.h" #include "util/Timestamp.h"
#include "NetDb.h" #include "NetDb.h"
#include "TunnelPool.h" #include "TunnelPool.h"
#include "LeaseSet.h" #include "LeaseSet.h"

2
Log.h
View File

@ -7,7 +7,7 @@
#include <fstream> #include <fstream>
#include <functional> #include <functional>
#include <chrono> #include <chrono>
#include "Queue.h" #include "util/Queue.h"
enum LogLevel enum LogLevel
{ {

View File

@ -29,6 +29,7 @@ tests: mk_build_test_dir $(TESTS)
mk_build_dir: mk_build_dir:
mkdir -p obj mkdir -p obj
mkdir -p obj/transport mkdir -p obj/transport
mkdir -p obj/util
mk_build_test_dir: mk_build_test_dir:
mkdir -p obj/tests mkdir -p obj/tests
@ -45,6 +46,7 @@ deps:
@mkdir -p obj @mkdir -p obj
@mkdir -p obj/transport @mkdir -p obj/transport
@mkdir -p obj/tests @mkdir -p obj/tests
@mkdir -p obj/util
$(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) -MM *.cpp > $(DEPS) $(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) -MM *.cpp > $(DEPS)
@sed -i -e '/\.o:/ s/^/obj\//' $(DEPS) @sed -i -e '/\.o:/ s/^/obj\//' $(DEPS)
@ -52,6 +54,7 @@ obj/%.o : %.cpp
@mkdir -p obj @mkdir -p obj
@mkdir -p obj/transport @mkdir -p obj/transport
@mkdir -p obj/tests @mkdir -p obj/tests
@mkdir -p obj/util
$(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) $(INCFLAGS) $(CPU_FLAGS) -c -o $@ $< $(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) $(INCFLAGS) $(CPU_FLAGS) -c -o $@ $<
# '-' is 'ignore if missing' on first run # '-' is 'ignore if missing' on first run

View File

@ -6,14 +6,14 @@
#include <cryptopp/gzip.h> #include <cryptopp/gzip.h>
#include "base64.h" #include "base64.h"
#include "Log.h" #include "Log.h"
#include "Timestamp.h" #include "util/Timestamp.h"
#include "I2NPProtocol.h" #include "I2NPProtocol.h"
#include "Tunnel.h" #include "Tunnel.h"
#include "transport/Transports.h" #include "transport/Transports.h"
#include "RouterContext.h" #include "RouterContext.h"
#include "Garlic.h" #include "Garlic.h"
#include "NetDb.h" #include "NetDb.h"
#include "util.h" #include "util/util.h"
using namespace i2p::transport; using namespace i2p::transport;

View File

@ -9,7 +9,7 @@
#include <thread> #include <thread>
#include <mutex> #include <mutex>
#include <boost/filesystem.hpp> #include <boost/filesystem.hpp>
#include "Queue.h" #include "util/Queue.h"
#include "I2NPProtocol.h" #include "I2NPProtocol.h"
#include "RouterInfo.h" #include "RouterInfo.h"
#include "LeaseSet.h" #include "LeaseSet.h"

View File

@ -2,7 +2,7 @@
#include <boost/property_tree/ptree.hpp> #include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/ini_parser.hpp> #include <boost/property_tree/ini_parser.hpp>
#include "base64.h" #include "base64.h"
#include "util.h" #include "util/util.h"
#include "Profiling.h" #include "Profiling.h"
namespace i2p namespace i2p

View File

@ -17,7 +17,7 @@
#include "Identity.h" #include "Identity.h"
#include "CryptoConst.h" #include "CryptoConst.h"
#include "NetDb.h" #include "NetDb.h"
#include "util.h" #include "util/util.h"
namespace i2p namespace i2p

View File

@ -4,10 +4,10 @@
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
#include "CryptoConst.h" #include "CryptoConst.h"
#include "RouterContext.h" #include "RouterContext.h"
#include "Timestamp.h" #include "util/Timestamp.h"
#include "I2NPProtocol.h" #include "I2NPProtocol.h"
#include "NetDb.h" #include "NetDb.h"
#include "util.h" #include "util/util.h"
#include "version.h" #include "version.h"
namespace i2p namespace i2p

View File

@ -7,7 +7,7 @@
#include <cryptopp/dsa.h> #include <cryptopp/dsa.h>
#include "CryptoConst.h" #include "CryptoConst.h"
#include "base64.h" #include "base64.h"
#include "Timestamp.h" #include "util/Timestamp.h"
#include "Log.h" #include "Log.h"
#include "RouterInfo.h" #include "RouterInfo.h"
#include "RouterContext.h" #include "RouterContext.h"

View File

@ -3,7 +3,7 @@
#include "RouterInfo.h" #include "RouterInfo.h"
#include "RouterContext.h" #include "RouterContext.h"
#include "Tunnel.h" #include "Tunnel.h"
#include "Timestamp.h" #include "util/Timestamp.h"
#include "Destination.h" #include "Destination.h"
#include "Streaming.h" #include "Streaming.h"

View File

@ -6,7 +6,7 @@
#include <cryptopp/sha.h> #include <cryptopp/sha.h>
#include "RouterContext.h" #include "RouterContext.h"
#include "Log.h" #include "Log.h"
#include "Timestamp.h" #include "util/Timestamp.h"
#include "I2NPProtocol.h" #include "I2NPProtocol.h"
#include "transport/Transports.h" #include "transport/Transports.h"
#include "NetDb.h" #include "NetDb.h"

View File

@ -9,7 +9,7 @@
#include <thread> #include <thread>
#include <mutex> #include <mutex>
#include <memory> #include <memory>
#include "Queue.h" #include "util/Queue.h"
#include "TunnelConfig.h" #include "TunnelConfig.h"
#include "TunnelPool.h" #include "TunnelPool.h"
#include "TransitTunnel.h" #include "TransitTunnel.h"

View File

@ -3,7 +3,7 @@
#include <inttypes.h> #include <inttypes.h>
#include <memory> #include <memory>
#include "Timestamp.h" #include "util/Timestamp.h"
#include "I2NPProtocol.h" #include "I2NPProtocol.h"
#include "Identity.h" #include "Identity.h"

View File

@ -8,7 +8,7 @@
#include "aes.h" #include "aes.h"
#include "RouterInfo.h" #include "RouterInfo.h"
#include "RouterContext.h" #include "RouterContext.h"
#include "Timestamp.h" #include "util/Timestamp.h"
namespace i2p namespace i2p
{ {

View File

@ -3,7 +3,7 @@
#include "CryptoConst.h" #include "CryptoConst.h"
#include "Tunnel.h" #include "Tunnel.h"
#include "NetDb.h" #include "NetDb.h"
#include "Timestamp.h" #include "util/Timestamp.h"
#include "Garlic.h" #include "Garlic.h"
#include "transport/Transports.h" #include "transport/Transports.h"
#include "TunnelPool.h" #include "TunnelPool.h"

View File

@ -18,7 +18,7 @@
#include "RouterContext.h" #include "RouterContext.h"
#include "UPnP.h" #include "UPnP.h"
#include "NetDb.h" #include "NetDb.h"
#include "util.h" #include "util/util.h"
#include <miniupnpc/miniupnpc.h> #include <miniupnpc/miniupnpc.h>
#include <miniupnpc/upnpcommands.h> #include <miniupnpc/upnpcommands.h>

2
UPnP.h
View File

@ -12,7 +12,7 @@
#include <boost/asio.hpp> #include <boost/asio.hpp>
#include "util.h" #include "util/util.h"
#define I2P_UPNP_TCP 1 #define I2P_UPNP_TCP 1
#define I2P_UPNP_UDP 2 #define I2P_UPNP_UDP 2

View File

@ -7,7 +7,7 @@
#include "RouterContext.h" #include "RouterContext.h"
#include "Identity.h" #include "Identity.h"
#include "Destination.h" #include "Destination.h"
#include "util.h" #include "util/util.h"
#include "api.h" #include "api.h"
namespace i2p namespace i2p

View File

@ -1,29 +1,31 @@
COMMON_SRC = \ COMMON_SRC = \
transport/NTCPSession.cpp transport/SSU.cpp transport/SSUSession.cpp \ transport/NTCPSession.cpp transport/SSU.cpp transport/SSUSession.cpp \
transport/SSUData.cpp transport/Transports.cpp \ transport/SSUData.cpp transport/Transports.cpp \
util/util.cpp \
CryptoConst.cpp Datagram.cpp Garlic.cpp I2NPProtocol.cpp LeaseSet.cpp \ CryptoConst.cpp Datagram.cpp Garlic.cpp I2NPProtocol.cpp LeaseSet.cpp \
Log.cpp NetDb.cpp NetDbRequests.cpp Profiling.cpp Reseed.cpp \ Log.cpp NetDb.cpp NetDbRequests.cpp Profiling.cpp Reseed.cpp \
RouterContext.cpp RouterInfo.cpp Signature.cpp Streaming.cpp Identity.cpp \ RouterContext.cpp RouterInfo.cpp Signature.cpp Streaming.cpp Identity.cpp \
TransitTunnel.cpp Tunnel.cpp TunnelEndpoint.cpp TunnelPool.cpp \ TransitTunnel.cpp Tunnel.cpp TunnelEndpoint.cpp TunnelPool.cpp \
TunnelGateway.cpp Destination.cpp UPnP.cpp util.cpp aes.cpp base64.cpp TunnelGateway.cpp Destination.cpp UPnP.cpp aes.cpp base64.cpp
ifeq ($(UNAME),Darwin) ifeq ($(UNAME),Darwin)
# This is needed on OS X for some reason I don't understand (yet). # This is needed on OS X for some reason I don't understand (yet).
# Else will get linker error about unknown symbols. - torkel # Else will get linker error about unknown symbols. - torkel
COMMON_SRC += \ COMMON_SRC += \
AddressBook.cpp BOB.cpp ClientContext.cpp Daemon.cpp I2PTunnel.cpp I2PService.cpp SAM.cpp SOCKS.cpp \ AddressBook.cpp BOB.cpp ClientContext.cpp Daemon.cpp I2PTunnel.cpp I2PService.cpp \
UPnP.cpp HTTPServer.cpp HTTPProxy.cpp i2p.cpp DaemonLinux.cpp I2PControl.cpp SAM.cpp SOCKS.cpp UPnP.cpp HTTPProxy.cpp i2p.cpp DaemonLinux.cpp I2PControl.cpp \
HTTPServer.cpp
endif endif
# also: Daemon{Linux,Win32}.cpp will be added later # also: Daemon{Linux,Win32}.cpp will be added later
DAEMON_SRC = $(COMMON_SRC) \ DAEMON_SRC = $(COMMON_SRC) \
AddressBook.cpp BOB.cpp ClientContext.cpp Daemon.cpp I2PTunnel.cpp I2PService.cpp \ AddressBook.cpp BOB.cpp ClientContext.cpp Daemon.cpp I2PTunnel.cpp I2PService.cpp \
SAM.cpp SOCKS.cpp HTTPServer.cpp HTTPProxy.cpp I2PControl.cpp i2p.cpp SAM.cpp SOCKS.cpp HTTPServer.cpp HTTPProxy.cpp I2PControl.cpp i2p.cpp
LIB_SRC := $(COMMON_SRC) \ LIB_SRC := $(COMMON_SRC) \
api.cpp api.cpp
TESTS_SRC := $(COMMON_SRC) \ TESTS_SRC := $(COMMON_SRC) \
tests/Utility.cpp tests/Identity.cpp tests/Data.cpp tests/Utility.cpp tests/Identity.cpp tests/Data.cpp

View File