Bitcoin Core 28.99.0
P2P Digital Currency
|
Controller that connects to Tor control socket, authenticate, then create and maintain an ephemeral onion service. More...
#include <torcontrol.h>
Public Member Functions | |
TorController (struct event_base *base, const std::string &tor_control_center, const CService &target) | |
TorController () | |
~TorController () | |
fs::path | GetPrivateKeyFile () |
Get name of file to store private key in. More... | |
void | Reconnect () |
Reconnect, after getting disconnected. More... | |
void | get_socks_cb (TorControlConnection &conn, const TorControlReply &reply) |
Callback for GETINFO net/listeners/socks result. More... | |
void | add_onion_cb (TorControlConnection &conn, const TorControlReply &reply) |
Callback for ADD_ONION result. More... | |
void | auth_cb (TorControlConnection &conn, const TorControlReply &reply) |
Callback for AUTHENTICATE result. More... | |
void | authchallenge_cb (TorControlConnection &conn, const TorControlReply &reply) |
Callback for AUTHCHALLENGE result. More... | |
void | protocolinfo_cb (TorControlConnection &conn, const TorControlReply &reply) |
Callback for PROTOCOLINFO result. More... | |
void | connected_cb (TorControlConnection &conn) |
Callback after successful connection. More... | |
void | disconnected_cb (TorControlConnection &conn) |
Callback after connection lost or failed connection attempt. More... | |
Static Public Member Functions | |
static void | reconnect_cb (evutil_socket_t fd, short what, void *arg) |
Callback for reconnect timer. More... | |
Private Attributes | |
struct event_base * | base |
const std::string | m_tor_control_center |
TorControlConnection | conn |
std::string | private_key |
std::string | service_id |
bool | reconnect |
struct event * | reconnect_ev = nullptr |
float | reconnect_timeout |
CService | service |
const CService | m_target |
std::vector< uint8_t > | cookie |
Cookie for SAFECOOKIE auth. More... | |
std::vector< uint8_t > | clientNonce |
ClientNonce for SAFECOOKIE auth. More... | |
Controller that connects to Tor control socket, authenticate, then create and maintain an ephemeral onion service.
Definition at line 106 of file torcontrol.h.
TorController::TorController | ( | struct event_base * | base, |
const std::string & | tor_control_center, | ||
const CService & | target | ||
) |
|
inline |
Definition at line 110 of file torcontrol.h.
TorController::~TorController | ( | ) |
void TorController::add_onion_cb | ( | TorControlConnection & | conn, |
const TorControlReply & | reply | ||
) |
Callback for ADD_ONION result.
Definition at line 420 of file torcontrol.cpp.
void TorController::auth_cb | ( | TorControlConnection & | conn, |
const TorControlReply & | reply | ||
) |
Callback for AUTHENTICATE result.
Definition at line 455 of file torcontrol.cpp.
void TorController::authchallenge_cb | ( | TorControlConnection & | conn, |
const TorControlReply & | reply | ||
) |
Callback for AUTHCHALLENGE result.
Definition at line 506 of file torcontrol.cpp.
void TorController::connected_cb | ( | TorControlConnection & | conn | ) |
Callback after successful connection.
Definition at line 617 of file torcontrol.cpp.
void TorController::disconnected_cb | ( | TorControlConnection & | conn | ) |
Callback after connection lost or failed connection attempt.
Definition at line 625 of file torcontrol.cpp.
void TorController::get_socks_cb | ( | TorControlConnection & | conn, |
const TorControlReply & | reply | ||
) |
Callback for GETINFO net/listeners/socks result.
Definition at line 353 of file torcontrol.cpp.
fs::path TorController::GetPrivateKeyFile | ( | ) |
Get name of file to store private key in.
Definition at line 654 of file torcontrol.cpp.
void TorController::protocolinfo_cb | ( | TorControlConnection & | conn, |
const TorControlReply & | reply | ||
) |
Callback for PROTOCOLINFO result.
Definition at line 541 of file torcontrol.cpp.
void TorController::Reconnect | ( | ) |
Reconnect, after getting disconnected.
Definition at line 643 of file torcontrol.cpp.
|
static |
Callback for reconnect timer.
Definition at line 659 of file torcontrol.cpp.
|
private |
Definition at line 121 of file torcontrol.h.
|
private |
ClientNonce for SAFECOOKIE auth.
Definition at line 134 of file torcontrol.h.
|
private |
Definition at line 123 of file torcontrol.h.
|
private |
Cookie for SAFECOOKIE auth.
Definition at line 132 of file torcontrol.h.
|
private |
Definition at line 130 of file torcontrol.h.
|
private |
Definition at line 122 of file torcontrol.h.
|
private |
Definition at line 124 of file torcontrol.h.
|
private |
Definition at line 126 of file torcontrol.h.
|
private |
Definition at line 127 of file torcontrol.h.
|
private |
Definition at line 128 of file torcontrol.h.
|
private |
Definition at line 129 of file torcontrol.h.
|
private |
Definition at line 125 of file torcontrol.h.