reachability.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. /* Copyright (c) 2001 Matej Pfajfar.
  2. * Copyright (c) 2001-2004, Roger Dingledine.
  3. * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
  4. * Copyright (c) 2007-2018, The Tor Project, Inc. */
  5. /* See LICENSE for licensing information */
  6. /**
  7. * \file reachability.h
  8. * \brief Header file for reachability.c.
  9. **/
  10. #ifndef TOR_REACHABILITY_H
  11. #define TOR_REACHABILITY_H
  12. /** What fraction (1 over this number) of the relay ID space do we
  13. * (as a directory authority) launch connections to at each reachability
  14. * test? */
  15. #define REACHABILITY_MODULO_PER_TEST 128
  16. /** How often (in seconds) do we launch reachability tests? */
  17. #define REACHABILITY_TEST_INTERVAL 10
  18. /** How many seconds apart are the reachability tests for a given relay? */
  19. #define REACHABILITY_TEST_CYCLE_PERIOD \
  20. (REACHABILITY_TEST_INTERVAL*REACHABILITY_MODULO_PER_TEST)
  21. void dirserv_orconn_tls_done(const tor_addr_t *addr,
  22. uint16_t or_port,
  23. const char *digest_rcvd,
  24. const struct ed25519_public_key_t *ed_id_rcvd);
  25. int dirserv_should_launch_reachability_test(const routerinfo_t *ri,
  26. const routerinfo_t *ri_old);
  27. void dirserv_single_reachability_test(time_t now, routerinfo_t *router);
  28. void dirserv_test_reachability(time_t now);
  29. #endif