aboutsummaryrefslogtreecommitdiff
path: root/src/feature/relay/selftest.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2020-06-18 16:05:16 -0400
committerNick Mathewson <nickm@torproject.org>2020-06-18 16:05:16 -0400
commitbc9979a670026004bf0a516bd38a25251ca6d9bb (patch)
tree73fde4834208dbd9209bad0f589244b5be74f9a2 /src/feature/relay/selftest.h
parent6c3897826a21734d2ab4f621df62e337d8bb8391 (diff)
downloadtor-bc9979a670026004bf0a516bd38a25251ca6d9bb.tar.gz
tor-bc9979a670026004bf0a516bd38a25251ca6d9bb.zip
Split "can reach ipv4 orport" from "can reach ipv6 orport".
I've managed to keep this change mainly contained to our self-testing module. The changes here are: * There are two different variables for tracking "is our orport reachable". * We have a new function that says whether we can skip a single family's orport reachability test; the old function for this now tells whether we can skip _all_ orport reachability testing. (The name, router_should_skip_orport_reachability_test, is not so good. I will rename it later if I can think of a good replacement.) * The function that launches orport reachability tests now only launches the ones that haven't completed. * The function that notes that we're reachable on an ORPort now takes a family. * Various log messages are cleaned up.
Diffstat (limited to 'src/feature/relay/selftest.h')
-rw-r--r--src/feature/relay/selftest.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/feature/relay/selftest.h b/src/feature/relay/selftest.h
index 5799a6ca33..d65edf56ff 100644
--- a/src/feature/relay/selftest.h
+++ b/src/feature/relay/selftest.h
@@ -15,8 +15,11 @@
#ifdef HAVE_MODULE_RELAY
struct or_options_t;
-int router_should_skip_orport_reachability_check(
- const struct or_options_t *options);
+#define router_should_skip_orport_reachability_check(opts) \
+ router_should_skip_orport_reachability_check_family((opts),0)
+int router_should_skip_orport_reachability_check_family(
+ const struct or_options_t *options,
+ int family);
int router_should_skip_dirport_reachability_check(
const struct or_options_t *options);
@@ -24,15 +27,17 @@ void router_do_reachability_checks(int test_or, int test_dir);
void router_perform_bandwidth_test(int num_circs, time_t now);
int inform_testing_reachability(void);
-void router_orport_found_reachable(void);
+void router_orport_found_reachable(int family);
void router_dirport_found_reachable(void);
void router_reset_reachability(void);
#else /* !defined(HAVE_MODULE_RELAY) */
-#define router_should_skip_orport_reachability_check(opts) \
+#define router_should_skip_orport_reachability_check(opts) \
((void)(opts), 0)
+#define router_should_skip_orport_reachability_check_family(opts, fam) \
+ ((void)(opts), (void)(fam), 0)
#define router_should_skip_dirport_reachability_check(opts) \
((void)(opts), 0)