reachability.c File Reference

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

#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/dirauth/dirauth_sys.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/dirauth/dirauth_options_st.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 40 of file reachability.c.

◆ 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 103 of file reachability.c.

◆ dirserv_single_reachability_test()

void dirserv_single_reachability_test ( time_t  now,
routerinfo_t router 

Helper function for dirserv_test_reachability(). Start a TLS connection to router, and annotate it with when we started the test.

Definition at line 134 of file reachability.c.

Referenced by routerlist_descriptors_added().

◆ 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 186 of file reachability.c.

Referenced by launch_reachability_tests_callback().