From cdc0aa658a735479e246674e9c1d78bfea6dae93 Mon Sep 17 00:00:00 2001 From: orignal Date: Wed, 7 Jan 2015 13:26:44 -0500 Subject: [PATCH] I2PControl added --- I2PControl.cpp | 15 +++++++++++++++ I2PControl.h | 29 +++++++++++++++++++++++++++++ Win32/i2pd.vcxproj | 2 ++ build/CMakeLists.txt | 1 + build/autotools/Makefile.in | 9 ++++++--- filelist.mk | 2 +- 6 files changed, 54 insertions(+), 4 deletions(-) create mode 100644 I2PControl.cpp create mode 100644 I2PControl.h diff --git a/I2PControl.cpp b/I2PControl.cpp new file mode 100644 index 00000000..260e8b80 --- /dev/null +++ b/I2PControl.cpp @@ -0,0 +1,15 @@ +#include +#include +#include "I2PControl.h" + +namespace i2p +{ +namespace client +{ + I2PControlService::I2PControlService (int port): + m_IsRunning (false), m_Thread (nullptr), + m_Acceptor (m_Service, boost::asio::ip::tcp::endpoint(boost::asio::ip::tcp::v4(), port)) + { + } +} +} diff --git a/I2PControl.h b/I2PControl.h new file mode 100644 index 00000000..1c0e90da --- /dev/null +++ b/I2PControl.h @@ -0,0 +1,29 @@ +#ifndef I2P_CONTROL_H__ +#define I2P_CONTROL_H__ + +#include +#include + +namespace i2p +{ +namespace client +{ + class I2PControlService + { + public: + + I2PControlService (int port); + + private: + + bool m_IsRunning; + std::thread * m_Thread; + + boost::asio::io_service m_Service; + boost::asio::ip::tcp::acceptor m_Acceptor; + }; +} +} + +#endif + diff --git a/Win32/i2pd.vcxproj b/Win32/i2pd.vcxproj index bba9a6a7..745ebe10 100644 --- a/Win32/i2pd.vcxproj +++ b/Win32/i2pd.vcxproj @@ -57,6 +57,7 @@ + @@ -102,6 +103,7 @@ + diff --git a/build/CMakeLists.txt b/build/CMakeLists.txt index bad1daf9..26447d76 100644 --- a/build/CMakeLists.txt +++ b/build/CMakeLists.txt @@ -48,6 +48,7 @@ set (DAEMON_SRC "${CMAKE_SOURCE_DIR}/Daemon.cpp" "${CMAKE_SOURCE_DIR}/HTTPProxy.cpp" "${CMAKE_SOURCE_DIR}/HTTPServer.cpp" + "${CMAKE_SOURCE_DIR}/I2PControl.cpp" "${CMAKE_SOURCE_DIR}/I2PTunnel.cpp" "${CMAKE_SOURCE_DIR}/SAM.cpp" "${CMAKE_SOURCE_DIR}/SOCKS.cpp" diff --git a/build/autotools/Makefile.in b/build/autotools/Makefile.in index 6c861710..b28c620d 100644 --- a/build/autotools/Makefile.in +++ b/build/autotools/Makefile.in @@ -115,7 +115,8 @@ am_i2p_OBJECTS = AddressBook.$(OBJEXT) CryptoConst.$(OBJEXT) \ TunnelGateway.$(OBJEXT) TunnelPool.$(OBJEXT) UPnP.$(OBJEXT) \ aes.$(OBJEXT) base64.$(OBJEXT) i2p.$(OBJEXT) util.$(OBJEXT) \ SAM.$(OBJEXT) Destination.$(OBJEXT) ClientContext.$(OBJEXT) \ - Datagram.$(OBJEXT) SSUSession.$(OBJEXT) BOB.$(OBJEXT) + Datagram.$(OBJEXT) SSUSession.$(OBJEXT) BOB.$(OBJEXT) \ + I2PControl.$(OBJEXT) i2p_OBJECTS = $(am_i2p_OBJECTS) i2p_LDADD = $(LDADD) AM_V_P = $(am__v_P_@AM_V@) @@ -326,7 +327,8 @@ i2p_SOURCES = AddressBook.cpp CryptoConst.cpp Daemon.cpp \ Transports.cpp Tunnel.cpp TunnelEndpoint.cpp \ TunnelGateway.cpp TunnelPool.cpp UPnP.cpp aes.cpp \ base64.cpp i2p.cpp util.cpp SAM.cpp Destination.cpp \ - ClientContext.cpp DataFram.cpp SSUSession.cpp BOB.cpp \ + ClientContext.cpp DataFram.cpp SSUSession.cpp BOB.cpp \ + I2PControl.cpp \ \ AddressBook.h CryptoConst.h Daemon.h ElGamal.h \ Garlic.h HTTPProxy.h HTTPServer.h I2NPProtocol.h \ @@ -338,7 +340,8 @@ i2p_SOURCES = AddressBook.cpp CryptoConst.cpp Daemon.cpp \ TunnelConfig.h TunnelEndpoint.h TunnelGateway.h \ TunnelPool.h UPnP.h aes.h base64.h config.h hmac.h \ util.h version.h Destination.h ClientContext.h \ - TransportSession.h Datagram.h SSUSession.h BOB.h + TransportSession.h Datagram.h SSUSession.h BOB.h \ + I2PControl.h AM_LDFLAGS = @BOOST_DATE_TIME_LIB@ @BOOST_FILESYSTEM_LIB@ \ @BOOST_PROGRAM_OPTIONS_LIB@ @BOOST_REGEX_LIB@ \ diff --git a/filelist.mk b/filelist.mk index 08ba2885..56c18cec 100644 --- a/filelist.mk +++ b/filelist.mk @@ -18,7 +18,7 @@ endif # also: Daemon{Linux,Win32}.cpp will be added later DAEMON_SRC = $(COMMON_SRC) \ BOB.cpp ClientContext.cpp Daemon.cpp I2PTunnel.cpp SAM.cpp SOCKS.cpp UPnP.cpp \ - HTTPServer.cpp HTTPProxy.cpp i2p.cpp + HTTPServer.cpp HTTPProxy.cpp I2PControl.cpp i2p.cpp LIB_SRC := $(COMMON_SRC) \ api.cpp