Tor  0.4.7.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-2021, 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 
27 void router_perform_bandwidth_test(int num_circs, time_t now);
28 
29 void router_orport_found_reachable(int family);
30 
31 void router_reset_reachability(void);
32 
33 #else /* !defined(HAVE_MODULE_RELAY) */
34 
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)
41 
42 static inline void
44 {
46 }
47 static inline void
48 router_perform_bandwidth_test(int num_circs, time_t now)
49 {
50  (void)num_circs;
51  (void)now;
53 }
54 static inline int
55 inform_testing_reachability(const tor_addr_t *addr, uint16_t port)
56 {
57  (void) addr;
58  (void) port;
60  return 0;
61 }
62 
63 #define router_orport_found_reachable() \
64  STMT_NIL
65 
66 #define router_reset_reachability() \
67  STMT_NIL
68 
69 #endif /* defined(HAVE_MODULE_RELAY) */
70 
71 #endif /* !defined(TOR_SELFTEST_H) */
int router_orport_seems_reachable(const or_options_t *options, int family)
Definition: selftest.c:101
void router_do_reachability_checks(void)
Definition: selftest.c:284
void router_orport_found_reachable(int family)
Definition: selftest.c:364
void router_perform_bandwidth_test(int num_circs, time_t now)
Definition: selftest.c:417
static void inform_testing_reachability(const tor_addr_t *addr, uint16_t port)
Definition: selftest.c:314
void router_reset_reachability(void)
Definition: selftest.c:68
int router_dirport_seems_reachable(const or_options_t *options)
Definition: selftest.c:137
#define tor_assert_nonfatal_unreached()
Definition: util_bug.h:176