diff options
author | Nick Mathewson <nickm@torproject.org> | 2020-02-18 13:30:20 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2020-02-18 13:31:33 -0500 |
commit | e85f46b7be0e658f3d5cd76dff3f1a98b426f22e (patch) | |
tree | 874d205419c6fa118a626370cef4d92c67fbe246 /src/feature/relay/selftest.h | |
parent | 17724a7cdeb9b98539831f1164a82784f1fb050f (diff) | |
download | tor-e85f46b7be0e658f3d5cd76dff3f1a98b426f22e.tar.gz tor-e85f46b7be0e658f3d5cd76dff3f1a98b426f22e.zip |
Do not build selftest.c when running relay mode is disabled.
Diffstat (limited to 'src/feature/relay/selftest.h')
-rw-r--r-- | src/feature/relay/selftest.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/feature/relay/selftest.h b/src/feature/relay/selftest.h index 94f305f203..c7987cf4a8 100644 --- a/src/feature/relay/selftest.h +++ b/src/feature/relay/selftest.h @@ -12,6 +12,7 @@ #ifndef TOR_SELFTEST_H #define TOR_SELFTEST_H +#ifdef HAVE_MODULE_RELAY struct or_options_t; int check_whether_orport_reachable(const struct or_options_t *options); int check_whether_dirport_reachable(const struct or_options_t *options); @@ -20,5 +21,33 @@ void router_do_reachability_checks(int test_or, int test_dir); void router_orport_found_reachable(void); void router_dirport_found_reachable(void); void router_perform_bandwidth_test(int num_circs, time_t now); +#else /* !defined(HAVE_MODULE_RELAY) */ + +#define check_whether_orport_reachable(opts) \ + ((void)(opts), 0) +#define check_whether_dirport_reachable(opts) \ + ((void)(opts), 0) + +#define router_orport_found_reachable() \ + STMT_NIL +#define router_dirport_found_reachable() \ + STMT_NIL + +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(); +} + +#endif /* defined(HAVE_MODULE_RELAY) */ #endif /* !defined(TOR_SELFTEST_H) */ |