2018-09-20 14:09:35 +02:00
|
|
|
/* Copyright (c) 2001 Matej Pfajfar.
|
|
|
|
* Copyright (c) 2001-2004, Roger Dingledine.
|
|
|
|
* Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
|
2020-01-09 00:39:17 +01:00
|
|
|
* Copyright (c) 2007-2020, The Tor Project, Inc. */
|
2018-09-20 14:09:35 +02:00
|
|
|
/* See LICENSE for licensing information */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \file reachability.h
|
|
|
|
* \brief Header file for reachability.c.
|
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef TOR_REACHABILITY_H
|
|
|
|
#define TOR_REACHABILITY_H
|
|
|
|
|
|
|
|
/** What fraction (1 over this number) of the relay ID space do we
|
|
|
|
* (as a directory authority) launch connections to at each reachability
|
|
|
|
* test? */
|
|
|
|
#define REACHABILITY_MODULO_PER_TEST 128
|
|
|
|
|
|
|
|
/** How often (in seconds) do we launch reachability tests? */
|
|
|
|
#define REACHABILITY_TEST_INTERVAL 10
|
|
|
|
|
|
|
|
/** How many seconds apart are the reachability tests for a given relay? */
|
|
|
|
#define REACHABILITY_TEST_CYCLE_PERIOD \
|
|
|
|
(REACHABILITY_TEST_INTERVAL*REACHABILITY_MODULO_PER_TEST)
|
|
|
|
|
2019-11-14 06:43:27 +01:00
|
|
|
#ifdef HAVE_MODULE_DIRAUTH
|
2018-09-20 14:09:35 +02:00
|
|
|
void dirserv_single_reachability_test(time_t now, routerinfo_t *router);
|
|
|
|
void dirserv_test_reachability(time_t now);
|
|
|
|
|
2019-08-29 15:50:38 +02:00
|
|
|
int dirserv_should_launch_reachability_test(const routerinfo_t *ri,
|
|
|
|
const routerinfo_t *ri_old);
|
2019-08-29 17:18:42 +02:00
|
|
|
void dirserv_orconn_tls_done(const tor_addr_t *addr,
|
|
|
|
uint16_t or_port,
|
|
|
|
const char *digest_rcvd,
|
|
|
|
const struct ed25519_public_key_t *ed_id_rcvd);
|
2019-09-30 14:57:37 +02:00
|
|
|
#else /* !defined(HAVE_MODULE_DIRAUTH) */
|
2019-11-14 06:43:27 +01:00
|
|
|
#define dirserv_single_reachability_test(now, router) \
|
|
|
|
(((void)(now)),((void)(router)))
|
|
|
|
#define dirserv_test_reachability(now) \
|
|
|
|
(((void)(now)))
|
|
|
|
|
|
|
|
#define dirserv_should_launch_reachability_test(ri, ri_old) \
|
|
|
|
(((void)(ri)),((void)(ri_old)),0)
|
|
|
|
#define dirserv_orconn_tls_done(addr, or_port, digest_rcvd, ed_id_rcvd) \
|
|
|
|
(((void)(addr)),((void)(or_port)),((void)(digest_rcvd)), \
|
|
|
|
((void)(ed_id_rcvd)))
|
2019-09-16 19:27:42 +02:00
|
|
|
#endif /* defined(HAVE_MODULE_DIRAUTH) */
|
2019-08-29 15:50:38 +02:00
|
|
|
|
2019-06-05 15:33:35 +02:00
|
|
|
#endif /* !defined(TOR_REACHABILITY_H) */
|