Update copyrights to 2021, using "make update-copyright"
[tor.git] / src / feature / relay / selftest.h
blobb662fe0fb092852e665c451302d8a4b749b0ade3
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-2021, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
7 /**
8 * \file selftest.h
9 * \brief Header file for selftest.c.
10 **/
12 #ifndef TOR_SELFTEST_H
13 #define TOR_SELFTEST_H
15 #ifdef HAVE_MODULE_RELAY
17 struct or_options_t;
18 #define router_all_orports_seem_reachable(opts) \
19 router_orport_seems_reachable((opts),0)
20 int router_orport_seems_reachable(
21 const struct or_options_t *options,
22 int family);
23 int router_dirport_seems_reachable(
24 const struct or_options_t *options);
26 void router_do_reachability_checks(void);
27 void router_perform_bandwidth_test(int num_circs, time_t now);
29 void router_orport_found_reachable(int family);
31 void router_reset_reachability(void);
33 #else /* !defined(HAVE_MODULE_RELAY) */
35 #define router_all_orports_seem_reachable(opts) \
36 ((void)(opts), 0)
37 #define router_orport_seems_reachable(opts, fam) \
38 ((void)(opts), (void)(fam), 0)
39 #define router_dirport_seems_reachable(opts) \
40 ((void)(opts), 0)
42 static inline void
43 router_do_reachability_checks(void)
45 tor_assert_nonfatal_unreached();
47 static inline void
48 router_perform_bandwidth_test(int num_circs, time_t now)
50 (void)num_circs;
51 (void)now;
52 tor_assert_nonfatal_unreached();
54 static inline int
55 inform_testing_reachability(const tor_addr_t *addr, uint16_t port)
57 (void) addr;
58 (void) port;
59 tor_assert_nonfatal_unreached();
60 return 0;
63 #define router_orport_found_reachable() \
64 STMT_NIL
66 #define router_reset_reachability() \
67 STMT_NIL
69 #endif /* defined(HAVE_MODULE_RELAY) */
71 #endif /* !defined(TOR_SELFTEST_H) */