2018-09-25 15:10:11 -04:00
|
|
|
/* Copyright (c) 2001 Matej Pfajfar.
|
|
|
|
* Copyright (c) 2001-2004, Roger Dingledine.
|
|
|
|
* Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
|
2020-01-08 18:39:17 -05:00
|
|
|
* Copyright (c) 2007-2020, The Tor Project, Inc. */
|
2018-09-25 15:10:11 -04:00
|
|
|
/* See LICENSE for licensing information */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \file selftest.h
|
|
|
|
* \brief Header file for selftest.c.
|
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef TOR_SELFTEST_H
|
|
|
|
#define TOR_SELFTEST_H
|
|
|
|
|
2020-02-18 13:30:20 -05:00
|
|
|
#ifdef HAVE_MODULE_RELAY
|
2020-03-17 16:10:49 +10:00
|
|
|
|
2018-09-25 15:10:11 -04:00
|
|
|
struct or_options_t;
|
2020-05-07 20:07:13 +10:00
|
|
|
int router_should_skip_orport_reachability_check(const struct or_options_t *options);
|
|
|
|
int router_should_skip_dirport_reachability_check(const struct or_options_t *options);
|
2018-09-25 15:10:11 -04:00
|
|
|
|
|
|
|
void router_do_reachability_checks(int test_or, int test_dir);
|
2020-03-17 16:10:49 +10:00
|
|
|
void router_perform_bandwidth_test(int num_circs, time_t now);
|
2020-03-17 16:16:05 +10:00
|
|
|
int inform_testing_reachability(void);
|
2020-03-17 16:10:49 +10:00
|
|
|
|
2018-09-25 15:10:11 -04:00
|
|
|
void router_orport_found_reachable(void);
|
|
|
|
void router_dirport_found_reachable(void);
|
2020-03-17 16:10:49 +10:00
|
|
|
|
2020-02-20 08:36:40 -05:00
|
|
|
void router_reset_reachability(void);
|
|
|
|
|
2020-02-18 13:30:20 -05:00
|
|
|
#else /* !defined(HAVE_MODULE_RELAY) */
|
|
|
|
|
2020-05-07 20:07:13 +10:00
|
|
|
#define router_should_skip_orport_reachability_check(opts) \
|
2020-02-18 13:30:20 -05:00
|
|
|
((void)(opts), 0)
|
2020-05-07 20:07:13 +10:00
|
|
|
#define router_should_skip_dirport_reachability_check(opts) \
|
2020-02-18 13:30:20 -05:00
|
|
|
((void)(opts), 0)
|
|
|
|
|
|
|
|
static inline void
|
|
|
|
router_do_reachability_checks(int test_or, int test_dir)
|
|
|
|
{
|
|
|
|
(void)test_or;
|
|
|
|
(void)test_dir;
|
|
|
|
tor_assert_nonfatal_unreached();
|
|
|
|
}
|
|
|
|
static inline void
|
|
|
|
router_perform_bandwidth_test(int num_circs, time_t now)
|
|
|
|
{
|
|
|
|
(void)num_circs;
|
|
|
|
(void)now;
|
|
|
|
tor_assert_nonfatal_unreached();
|
|
|
|
}
|
2020-03-17 16:16:05 +10:00
|
|
|
static inline int
|
|
|
|
inform_testing_reachability(void)
|
|
|
|
{
|
|
|
|
tor_assert_nonfatal_unreached();
|
|
|
|
return 0;
|
|
|
|
}
|
2020-02-18 13:30:20 -05:00
|
|
|
|
2020-03-17 16:10:49 +10:00
|
|
|
#define router_orport_found_reachable() \
|
|
|
|
STMT_NIL
|
|
|
|
#define router_dirport_found_reachable() \
|
|
|
|
STMT_NIL
|
|
|
|
|
|
|
|
#define router_reset_reachability() \
|
|
|
|
STMT_NIL
|
|
|
|
|
2020-02-18 13:30:20 -05:00
|
|
|
#endif /* defined(HAVE_MODULE_RELAY) */
|
2018-09-25 15:10:11 -04:00
|
|
|
|
2019-06-05 09:33:35 -04:00
|
|
|
#endif /* !defined(TOR_SELFTEST_H) */
|