Bitcoin ABC  0.22.15
P2P Digital Currency
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
TorController Class Reference

Controller that connects to Tor control socket, authenticate, then create and maintain an ephemeral hidden service. More...

Collaboration diagram for TorController:
[legend]

Public Member Functions

 TorController (struct event_base *base, const std::string &target)
 
 ~TorController ()
 
fs::path GetPrivateKeyFile ()
 Get name fo file to store private key in. More...
 
void Reconnect ()
 Reconnect, after getting disconnected. More...
 

Private Member Functions

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 Private 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
 
std::string target
 
TorControlConnection conn
 
std::string private_key
 
std::string service_id
 
bool reconnect
 
struct event * reconnect_ev
 
float reconnect_timeout
 
CService service
 
std::vector< uint8_t > cookie
 Cookie for SAFECOOKIE auth. More...
 
std::vector< uint8_t > clientNonce
 ClientNonce for SAFECOOKIE auth. More...
 

Detailed Description

Controller that connects to Tor control socket, authenticate, then create and maintain an ephemeral hidden service.

Definition at line 462 of file torcontrol.cpp.

Constructor & Destructor Documentation

◆ TorController()

TorController::TorController ( struct event_base *  base,
const std::string &  target 
)

Definition at line 507 of file torcontrol.cpp.

Here is the call graph for this function:

◆ ~TorController()

TorController::~TorController ( )

Definition at line 534 of file torcontrol.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ add_onion_cb()

void TorController::add_onion_cb ( TorControlConnection conn,
const TorControlReply reply 
)
private

Callback for ADD_ONION result.

Definition at line 544 of file torcontrol.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ auth_cb()

void TorController::auth_cb ( TorControlConnection conn,
const TorControlReply reply 
)
private

Callback for AUTHENTICATE result.

Definition at line 586 of file torcontrol.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ authchallenge_cb()

void TorController::authchallenge_cb ( TorControlConnection conn,
const TorControlReply reply 
)
private

Callback for AUTHCHALLENGE result.

Definition at line 649 of file torcontrol.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ connected_cb()

void TorController::connected_cb ( TorControlConnection conn)
private

Callback after successful connection.

Definition at line 804 of file torcontrol.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ disconnected_cb()

void TorController::disconnected_cb ( TorControlConnection conn)
private

Callback after connection lost or failed connection attempt.

Definition at line 816 of file torcontrol.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetPrivateKeyFile()

fs::path TorController::GetPrivateKeyFile ( )

Get name fo file to store private key in.

Definition at line 853 of file torcontrol.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ protocolinfo_cb()

void TorController::protocolinfo_cb ( TorControlConnection conn,
const TorControlReply reply 
)
private

Callback for PROTOCOLINFO result.

Definition at line 698 of file torcontrol.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Reconnect()

void TorController::Reconnect ( )

Reconnect, after getting disconnected.

Definition at line 838 of file torcontrol.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ reconnect_cb()

void TorController::reconnect_cb ( evutil_socket_t  fd,
short  what,
void *  arg 
)
staticprivate

Callback for reconnect timer.

Definition at line 857 of file torcontrol.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ base

struct event_base* TorController::base
private

Definition at line 474 of file torcontrol.cpp.

◆ clientNonce

std::vector<uint8_t> TorController::clientNonce
private

ClientNonce for SAFECOOKIE auth.

Definition at line 486 of file torcontrol.cpp.

◆ conn

TorControlConnection TorController::conn
private

Definition at line 476 of file torcontrol.cpp.

◆ cookie

std::vector<uint8_t> TorController::cookie
private

Cookie for SAFECOOKIE auth.

Definition at line 484 of file torcontrol.cpp.

◆ private_key

std::string TorController::private_key
private

Definition at line 477 of file torcontrol.cpp.

◆ reconnect

bool TorController::reconnect
private

Definition at line 479 of file torcontrol.cpp.

◆ reconnect_ev

struct event* TorController::reconnect_ev
private

Definition at line 480 of file torcontrol.cpp.

◆ reconnect_timeout

float TorController::reconnect_timeout
private

Definition at line 481 of file torcontrol.cpp.

◆ service

CService TorController::service
private

Definition at line 482 of file torcontrol.cpp.

◆ service_id

std::string TorController::service_id
private

Definition at line 478 of file torcontrol.cpp.

◆ target

std::string TorController::target
private

Definition at line 475 of file torcontrol.cpp.


The documentation for this class was generated from the following file: