reachability.c File Reference
#include "core/or/or.h"
#include "feature/dirauth/reachability.h"
#include "app/config/config.h"
#include "core/or/channel.h"
#include "core/or/channeltls.h"
#include "core/or/command.h"
#include "feature/dirauth/authmode.h"
#include "feature/nodelist/describe.h"
#include "feature/nodelist/nodelist.h"
#include "feature/nodelist/routerinfo.h"
#include "feature/nodelist/routerlist.h"
#include "feature/nodelist/torcert.h"
#include "feature/stats/rephist.h"
#include "feature/nodelist/node_st.h"
#include "feature/nodelist/routerinfo_st.h"
#include "feature/nodelist/routerlist_st.h"

Go to the source code of this file.


void dirserv_orconn_tls_done (const tor_addr_t *addr, uint16_t or_port, const char *digest_rcvd, const ed25519_public_key_t *ed_id_rcvd)
int dirserv_should_launch_reachability_test (const routerinfo_t *ri, const routerinfo_t *ri_old)
void dirserv_single_reachability_test (time_t now, routerinfo_t *router)
void dirserv_test_reachability (time_t now)

Detailed Description

Router reachability testing; run by authorities to tell who is running.

Definition in file reachability.c.

Function Documentation

◆ dirserv_orconn_tls_done()

void dirserv_orconn_tls_done ( const tor_addr_t addr,
uint16_t  or_port,
const char *  digest_rcvd,
const ed25519_public_key_t ed_id_rcvd 

Called when a TLS handshake has completed successfully with a router listening at address:or_port, and has yielded a certificate with digest digest_rcvd.

Inform the reachability checker that we could get to this relay.

Definition at line 38 of file reachability.c.

References ed25519_pubkey_eq(), ed25519_public_key_is_zero(), node_supports_ed25519_link_authentication(), tor_cert_st::signing_key, signed_descriptor_t::signing_key_cert, and tor_assert().

◆ dirserv_should_launch_reachability_test()

int dirserv_should_launch_reachability_test ( const routerinfo_t ri,
const routerinfo_t ri_old 

Called when we, as an authority, receive a new router descriptor either as an upload or a download. Used to decide whether to relaunch reachability testing for the server.

Definition at line 101 of file reachability.c.

References authdir_mode_handles_descs(), routerinfo_t::is_hibernating, routerinfo_t::purpose, and routers_have_same_or_addrs().

◆ dirserv_single_reachability_test()

void dirserv_single_reachability_test ( time_t  now,
routerinfo_t router 

◆ dirserv_test_reachability()

void dirserv_test_reachability ( time_t  now)

Auth dir server only: load balance such that we only try a few connections per call.

The load balancing is such that if we get called once every ten seconds, we will cycle through all the tests in REACHABILITY_TEST_CYCLE_PERIOD seconds (a bit over 20 minutes).

Definition at line 179 of file reachability.c.

References authdir_mode_bridge(), dirserv_single_reachability_test(), REACHABILITY_MODULO_PER_TEST, router_get_routerlist(), router_is_me(), routerlist_t::routers, and SMARTLIST_FOREACH_BEGIN.