mirror of
https://github.com/monero-project/monero.git
synced 2025-05-06 10:25:02 -04:00
Added support for "noise" over I1P/Tor to mask Tx transmission.
This commit is contained in:
parent
bdfc63ae4d
commit
3b24b1d082
28 changed files with 2731 additions and 162 deletions
|
@ -49,10 +49,11 @@
|
|||
#include <boost/asio/ssl.hpp>
|
||||
#include <boost/array.hpp>
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/shared_ptr.hpp> //! \TODO Convert to std::shared_ptr
|
||||
#include <boost/enable_shared_from_this.hpp>
|
||||
#include <boost/interprocess/detail/atomic.hpp>
|
||||
#include <boost/thread/thread.hpp>
|
||||
#include <memory>
|
||||
#include "byte_slice.h"
|
||||
#include "net_utils_base.h"
|
||||
#include "syncobj.h"
|
||||
|
@ -91,25 +92,24 @@ namespace net_utils
|
|||
public:
|
||||
typedef typename t_protocol_handler::connection_context t_connection_context;
|
||||
|
||||
struct shared_state : connection_basic_shared_state
|
||||
struct shared_state : connection_basic_shared_state, t_protocol_handler::config_type
|
||||
{
|
||||
shared_state()
|
||||
: connection_basic_shared_state(), pfilter(nullptr), config(), stop_signal_sent(false)
|
||||
: connection_basic_shared_state(), t_protocol_handler::config_type(), pfilter(nullptr), stop_signal_sent(false)
|
||||
{}
|
||||
|
||||
i_connection_filter* pfilter;
|
||||
typename t_protocol_handler::config_type config;
|
||||
bool stop_signal_sent;
|
||||
};
|
||||
|
||||
/// Construct a connection with the given io_service.
|
||||
explicit connection( boost::asio::io_service& io_service,
|
||||
boost::shared_ptr<shared_state> state,
|
||||
std::shared_ptr<shared_state> state,
|
||||
t_connection_type connection_type,
|
||||
epee::net_utils::ssl_support_t ssl_support);
|
||||
|
||||
explicit connection( boost::asio::ip::tcp::socket&& sock,
|
||||
boost::shared_ptr<shared_state> state,
|
||||
std::shared_ptr<shared_state> state,
|
||||
t_connection_type connection_type,
|
||||
epee::net_utils::ssl_support_t ssl_support);
|
||||
|
||||
|
@ -271,7 +271,13 @@ namespace net_utils
|
|||
typename t_protocol_handler::config_type& get_config_object()
|
||||
{
|
||||
assert(m_state != nullptr); // always set in constructor
|
||||
return m_state->config;
|
||||
return *m_state;
|
||||
}
|
||||
|
||||
std::shared_ptr<typename t_protocol_handler::config_type> get_config_shared()
|
||||
{
|
||||
assert(m_state != nullptr); // always set in constructor
|
||||
return {m_state};
|
||||
}
|
||||
|
||||
int get_binded_port(){return m_port;}
|
||||
|
@ -352,7 +358,7 @@ namespace net_utils
|
|||
|
||||
bool is_thread_worker();
|
||||
|
||||
const boost::shared_ptr<typename connection<t_protocol_handler>::shared_state> m_state;
|
||||
const std::shared_ptr<typename connection<t_protocol_handler>::shared_state> m_state;
|
||||
|
||||
/// The io_service used to perform asynchronous operations.
|
||||
struct worker
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue