![]() |
Bitcoin Core 31.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 (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 | Interrupt () |
| Interrupt the controller thread. More... | |
| void | Join () |
| Wait for the controller thread to exit. 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, bool pow_was_enabled) |
| 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... | |
Private Member Functions | |
| void | ThreadControl () |
| Main control thread. More... | |
Private Attributes | |
| CThreadInterrupt | m_interrupt |
| std::thread | m_thread |
| const std::string | m_tor_control_center |
| TorControlConnection | m_conn |
| std::string | m_private_key |
| std::string | m_service_id |
| std::atomic< bool > | m_reconnect |
| std::chrono::duration< double > | m_reconnect_timeout |
| CService | m_service |
| const CService | m_target |
| std::vector< uint8_t > | m_cookie |
| Cookie for SAFECOOKIE auth. More... | |
| std::vector< uint8_t > | m_client_nonce |
| ClientNonce for SAFECOOKIE auth. More... | |
Controller that connects to Tor control socket, authenticate, then create and maintain an ephemeral onion service.
Definition at line 122 of file torcontrol.h.
| TorController::TorController | ( | const std::string & | tor_control_center, |
| const CService & | target | ||
| ) |
|
inline |
Definition at line 126 of file torcontrol.h.
| TorController::~TorController | ( | ) |
| void TorController::add_onion_cb | ( | TorControlConnection & | conn, |
| const TorControlReply & | reply, | ||
| bool | pow_was_enabled | ||
| ) |
Callback for ADD_ONION result.
Definition at line 516 of file torcontrol.cpp.
| void TorController::auth_cb | ( | TorControlConnection & | conn, |
| const TorControlReply & | reply | ||
| ) |
Callback for AUTHENTICATE result.
Definition at line 557 of file torcontrol.cpp.
| void TorController::authchallenge_cb | ( | TorControlConnection & | conn, |
| const TorControlReply & | reply | ||
| ) |
Callback for AUTHCHALLENGE result.
Definition at line 609 of file torcontrol.cpp.
| void TorController::connected_cb | ( | TorControlConnection & | conn | ) |
Callback after successful connection.
Definition at line 724 of file torcontrol.cpp.
| void TorController::disconnected_cb | ( | TorControlConnection & | conn | ) |
Callback after connection lost or failed connection attempt.
Definition at line 732 of file torcontrol.cpp.
| void TorController::get_socks_cb | ( | TorControlConnection & | conn, |
| const TorControlReply & | reply | ||
| ) |
Callback for GETINFO net/listeners/socks result.
Definition at line 435 of file torcontrol.cpp.
| fs::path TorController::GetPrivateKeyFile | ( | ) |
Get name of file to store private key in.
Definition at line 745 of file torcontrol.cpp.
| void TorController::Interrupt | ( | ) |
Interrupt the controller thread.
Definition at line 377 of file torcontrol.cpp.
| void TorController::Join | ( | ) |
Wait for the controller thread to exit.
Definition at line 383 of file torcontrol.cpp.
| void TorController::protocolinfo_cb | ( | TorControlConnection & | conn, |
| const TorControlReply & | reply | ||
| ) |
Callback for PROTOCOLINFO result.
Definition at line 648 of file torcontrol.cpp.
|
private |
Main control thread.
Definition at line 390 of file torcontrol.cpp.
|
private |
ClientNonce for SAFECOOKIE auth.
Definition at line 153 of file torcontrol.h.
|
private |
Definition at line 143 of file torcontrol.h.
|
private |
Cookie for SAFECOOKIE auth.
Definition at line 151 of file torcontrol.h.
|
private |
Definition at line 140 of file torcontrol.h.
|
private |
Definition at line 144 of file torcontrol.h.
|
private |
Definition at line 146 of file torcontrol.h.
|
private |
Definition at line 147 of file torcontrol.h.
|
private |
Definition at line 148 of file torcontrol.h.
|
private |
Definition at line 145 of file torcontrol.h.
|
private |
Definition at line 149 of file torcontrol.h.
|
private |
Definition at line 141 of file torcontrol.h.
|
private |
Definition at line 142 of file torcontrol.h.