Tor  0.4.4.0-alpha-dev
selftest.h
Go to the documentation of this file.
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-2020, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
6 
7 /**
8  * \file selftest.h
9  * \brief Header file for selftest.c.
10  **/
11 
12 #ifndef TOR_SELFTEST_H
13 #define TOR_SELFTEST_H
14 
15 #ifdef HAVE_MODULE_RELAY
16 struct or_options_t;
17 int check_whether_orport_reachable(const struct or_options_t *options);
18 int check_whether_dirport_reachable(const struct or_options_t *options);
19 
20 void router_do_reachability_checks(int test_or, int test_dir);
23 void router_perform_bandwidth_test(int num_circs, time_t now);
24 void router_reset_reachability(void);
25 
26 #else /* !defined(HAVE_MODULE_RELAY) */
27 
28 #define check_whether_orport_reachable(opts) \
29  ((void)(opts), 0)
30 #define check_whether_dirport_reachable(opts) \
31  ((void)(opts), 0)
32 
33 #define router_orport_found_reachable() \
34  STMT_NIL
35 #define router_dirport_found_reachable() \
36  STMT_NIL
37 #define router_reset_reachability() \
38  STMT_NIL
39 
40 static inline void
41 router_do_reachability_checks(int test_or, int test_dir)
42 {
43  (void)test_or;
44  (void)test_dir;
45  tor_assert_nonfatal_unreached();
46 }
47 static inline void
48 router_perform_bandwidth_test(int num_circs, time_t now)
49 {
50  (void)num_circs;
51  (void)now;
52  tor_assert_nonfatal_unreached();
53 }
54 
55 #endif /* defined(HAVE_MODULE_RELAY) */
56 
57 #endif /* !defined(TOR_SELFTEST_H) */
void router_do_reachability_checks(int test_or, int test_dir)
Definition: selftest.c:170
void router_perform_bandwidth_test(int num_circs, time_t now)
Definition: selftest.c:275
void router_dirport_found_reachable(void)
Definition: selftest.c:245
void router_reset_reachability(void)
Definition: selftest.c:47
void router_orport_found_reachable(void)
Definition: selftest.c:218
int check_whether_orport_reachable(const or_options_t *options)
Definition: selftest.c:73
int check_whether_dirport_reachable(const or_options_t *options)
Definition: selftest.c:90