Tor  0.4.6.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 
17 struct or_options_t;
18 #define router_all_orports_seem_reachable(opts) \
19  router_orport_seems_reachable((opts),0)
21  const struct or_options_t *options,
22  int family);
24  const struct or_options_t *options);
25 
26 void router_do_reachability_checks(int test_or, int test_dir);
27 void router_perform_bandwidth_test(int num_circs, time_t now);
28 
29 void router_orport_found_reachable(int family);
31 
32 void router_reset_reachability(void);
33 
34 #else /* !defined(HAVE_MODULE_RELAY) */
35 
36 #define router_all_orports_seem_reachable(opts) \
37  ((void)(opts), 0)
38 #define router_orport_seems_reachable(opts, fam) \
39  ((void)(opts), (void)(fam), 0)
40 #define router_dirport_seems_reachable(opts) \
41  ((void)(opts), 0)
42 
43 static inline void
44 router_do_reachability_checks(int test_or, int test_dir)
45 {
46  (void)test_or;
47  (void)test_dir;
49 }
50 static inline void
51 router_perform_bandwidth_test(int num_circs, time_t now)
52 {
53  (void)num_circs;
54  (void)now;
56 }
57 static inline int
59 {
61  return 0;
62 }
63 
64 #define router_orport_found_reachable() \
65  STMT_NIL
66 #define router_dirport_found_reachable() \
67  STMT_NIL
68 
69 #define router_reset_reachability() \
70  STMT_NIL
71 
72 #endif /* defined(HAVE_MODULE_RELAY) */
73 
74 #endif /* !defined(TOR_SELFTEST_H) */
inform_testing_reachability
static void inform_testing_reachability(const tor_addr_t *addr, uint16_t port, bool is_dirport)
Definition: selftest.c:370
tor_assert_nonfatal_unreached
#define tor_assert_nonfatal_unreached()
Definition: util_bug.h:176
router_do_reachability_checks
void router_do_reachability_checks(int test_or, int test_dir)
Definition: selftest.c:333
router_dirport_found_reachable
void router_dirport_found_reachable(void)
Definition: selftest.c:477
router_dirport_seems_reachable
int router_dirport_seems_reachable(const or_options_t *options)
Definition: selftest.c:148
router_perform_bandwidth_test
void router_perform_bandwidth_test(int num_circs, time_t now)
Definition: selftest.c:514
or_options_t
Definition: or_options_st.h:64
router_reset_reachability
void router_reset_reachability(void)
Definition: selftest.c:72
router_orport_found_reachable
void router_orport_found_reachable(int family)
Definition: selftest.c:427
router_orport_seems_reachable
int router_orport_seems_reachable(const or_options_t *options, int family)
Definition: selftest.c:106