2018-09-25 21:10:11 +02:00
|
|
|
/* Copyright (c) 2001 Matej Pfajfar.
|
|
|
|
* Copyright (c) 2001-2004, Roger Dingledine.
|
|
|
|
* Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
|
2021-03-12 17:39:23 +01:00
|
|
|
* Copyright (c) 2007-2021, The Tor Project, Inc. */
|
2018-09-25 21:10:11 +02:00
|
|
|
/* See LICENSE for licensing information */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \file selftest.h
|
|
|
|
* \brief Header file for selftest.c.
|
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef TOR_SELFTEST_H
|
|
|
|
#define TOR_SELFTEST_H
|
|
|
|
|
2020-02-18 19:30:20 +01:00
|
|
|
#ifdef HAVE_MODULE_RELAY
|
2020-03-17 07:10:49 +01:00
|
|
|
|
2018-09-25 21:10:11 +02:00
|
|
|
struct or_options_t;
|
2020-06-24 20:39:01 +02:00
|
|
|
#define router_all_orports_seem_reachable(opts) \
|
2020-06-24 19:25:49 +02:00
|
|
|
router_orport_seems_reachable((opts),0)
|
|
|
|
int router_orport_seems_reachable(
|
2020-06-18 22:05:16 +02:00
|
|
|
const struct or_options_t *options,
|
|
|
|
int family);
|
2020-06-24 19:25:49 +02:00
|
|
|
int router_dirport_seems_reachable(
|
2020-05-07 12:16:56 +02:00
|
|
|
const struct or_options_t *options);
|
2018-09-25 21:10:11 +02:00
|
|
|
|
2021-02-17 17:00:14 +01:00
|
|
|
void router_do_reachability_checks(void);
|
2020-03-17 07:10:49 +01:00
|
|
|
void router_perform_bandwidth_test(int num_circs, time_t now);
|
|
|
|
|
2020-06-18 22:05:16 +02:00
|
|
|
void router_orport_found_reachable(int family);
|
2020-03-17 07:10:49 +01:00
|
|
|
|
2020-02-20 14:36:40 +01:00
|
|
|
void router_reset_reachability(void);
|
|
|
|
|
2020-02-18 19:30:20 +01:00
|
|
|
#else /* !defined(HAVE_MODULE_RELAY) */
|
|
|
|
|
2020-06-24 20:39:01 +02:00
|
|
|
#define router_all_orports_seem_reachable(opts) \
|
2020-02-18 19:30:20 +01:00
|
|
|
((void)(opts), 0)
|
2020-06-24 19:25:49 +02:00
|
|
|
#define router_orport_seems_reachable(opts, fam) \
|
2020-06-18 22:05:16 +02:00
|
|
|
((void)(opts), (void)(fam), 0)
|
2020-06-24 19:25:49 +02:00
|
|
|
#define router_dirport_seems_reachable(opts) \
|
2020-02-18 19:30:20 +01:00
|
|
|
((void)(opts), 0)
|
|
|
|
|
|
|
|
static inline void
|
2021-02-17 17:00:14 +01:00
|
|
|
router_do_reachability_checks(void)
|
2020-02-18 19:30:20 +01:00
|
|
|
{
|
|
|
|
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();
|
|
|
|
}
|
2020-03-17 07:16:05 +01:00
|
|
|
static inline int
|
2021-02-17 17:00:14 +01:00
|
|
|
inform_testing_reachability(const tor_addr_t *addr, uint16_t port)
|
2020-03-17 07:16:05 +01:00
|
|
|
{
|
2021-02-17 17:00:14 +01:00
|
|
|
(void) addr;
|
|
|
|
(void) port;
|
2020-03-17 07:16:05 +01:00
|
|
|
tor_assert_nonfatal_unreached();
|
|
|
|
return 0;
|
|
|
|
}
|
2020-02-18 19:30:20 +01:00
|
|
|
|
2020-03-17 07:10:49 +01:00
|
|
|
#define router_orport_found_reachable() \
|
|
|
|
STMT_NIL
|
|
|
|
|
|
|
|
#define router_reset_reachability() \
|
|
|
|
STMT_NIL
|
|
|
|
|
2020-02-18 19:30:20 +01:00
|
|
|
#endif /* defined(HAVE_MODULE_RELAY) */
|
2018-09-25 21:10:11 +02:00
|
|
|
|
2019-06-05 15:33:35 +02:00
|
|
|
#endif /* !defined(TOR_SELFTEST_H) */
|