42 const char *digest_rcvd,
48 time_t now = time(NULL);
53 if (node == NULL || node->ri == NULL)
58 if (dirauth_get_options()->AuthDirTestEd25519LinkKeys &&
68 log_info(
LD_DIRSERV,
"Router at %s:%d with RSA ID %s "
69 "did not present expected Ed25519 ID.",
76 orport.port = or_port;
77 if (router_has_orport(ri, &orport)) {
84 log_info(
LD_DIRSERV,
"Found router %s to be reachable at %s:%d. Yay.",
93 node->last_reachable6 = now;
108 if (! dirauth_get_options()->AuthDirTestReachability)
123 log_info(
LD_DIR,
"address or port changed: router %s",
138 const node_t *node = NULL;
155 log_info(
LD_OR,
"Testing reachability of %s at %s:%u.",
157 router->ipv4_orport);
164 if (dirauth_get_options()->AuthDirHasIPv6Connectivity == 1 &&
167 log_info(
LD_OR,
"Testing reachability of %s at %s:%u.",
170 router->ipv6_orport);
197 if (! dirauth_get_options()->AuthDirTestReachability)
205 const char *id_digest = router->cache_info.identity_digest;
215 } SMARTLIST_FOREACH_END(router);
void tor_addr_copy(tor_addr_t *dest, const tor_addr_t *src)
const char * tor_addr_to_str(char *dest, const tor_addr_t *addr, size_t len, int decorate)
int tor_addr_is_null(const tor_addr_t *addr)
static sa_family_t tor_addr_family(const tor_addr_t *a)
int authdir_mode_handles_descs(const or_options_t *options, int purpose)
int authdir_mode_bridge(const or_options_t *options)
Header file for directory authority mode.
const char * hex_str(const char *from, size_t fromlen)
Header file for channel.c.
channel_t * channel_tls_connect(const tor_addr_t *addr, uint16_t port, const char *id_digest, const ed25519_public_key_t *ed_id)
Header file for channeltls.c.
void command_setup_channel(channel_t *chan)
Header file for command.c.
const or_options_t * get_options(void)
Header file for config.c.
int ed25519_public_key_is_zero(const ed25519_public_key_t *pubkey)
int ed25519_pubkey_eq(const ed25519_public_key_t *key1, const ed25519_public_key_t *key2)
const char * router_describe(const routerinfo_t *ri)
Header file for describe.c.
Structure dirauth_options_t to hold directory authority options.
Header for dirauth_sys.c.
Node information structure.
node_t * node_get_mutable_by_id(const char *identity_digest)
bool node_supports_ed25519_link_authentication(const node_t *node, bool compatible_with_us)
const node_t * node_get_by_id(const char *identity_digest)
Header file for nodelist.c.
Master header file for Tor-specific functionality.
int dirserv_should_launch_reachability_test(const routerinfo_t *ri, const routerinfo_t *ri_old)
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)
void dirserv_single_reachability_test(time_t now, routerinfo_t *router)
void dirserv_test_reachability(time_t now)
Header file for reachability.c.
#define REACHABILITY_MODULO_PER_TEST
void rep_hist_note_router_reachable(const char *id, const tor_addr_t *at_addr, const uint16_t at_port, time_t when)
Header file for rephist.c.
int router_is_me(const routerinfo_t *router)
Header file for routerinfo.c.
Router descriptor structure.
#define ROUTER_PURPOSE_BRIDGE
routerlist_t * router_get_routerlist(void)
int routers_have_same_or_addrs(const routerinfo_t *r1, const routerinfo_t *r2)
Header file for routerlist.c.
Router descriptor list structure.
#define SMARTLIST_FOREACH_BEGIN(sl, type, var)
BOOL AuthDirTestEd25519LinkKeys
unsigned int is_hibernating
char identity_digest[DIGEST_LEN]
struct tor_cert_st * signing_key_cert