diff options
author | Micah Elizabeth Scott <beth@torproject.org> | 2023-03-08 15:44:55 -0800 |
---|---|---|
committer | Micah Elizabeth Scott <beth@torproject.org> | 2023-05-10 07:38:28 -0700 |
commit | dcb9c4df67d116dc16f5361c8e4cd6e21fbb9abf (patch) | |
tree | e99810169c841c6cb74036d22a59dc4ccdf014a4 /src/app/config/config.c | |
parent | 9d1a57397739b869ab102783b858889bcc2e5066 (diff) | |
download | tor-dcb9c4df67d116dc16f5361c8e4cd6e21fbb9abf.tar.gz tor-dcb9c4df67d116dc16f5361c8e4cd6e21fbb9abf.zip |
hs_pow: Make proof-of-work support optional in configure
This adds a new "pow" module for the user-visible proof
of work support in ./configure, and this disables
src/feature/hs/hs_pow at compile-time.
Signed-off-by: Micah Elizabeth Scott <beth@torproject.org>
Diffstat (limited to 'src/app/config/config.c')
-rw-r--r-- | src/app/config/config.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/app/config/config.c b/src/app/config/config.c index cb71d0fb6d..24321b764f 100644 --- a/src/app/config/config.c +++ b/src/app/config/config.c @@ -88,9 +88,11 @@ #include "feature/control/control.h" #include "feature/control/control_auth.h" #include "feature/control/control_events.h" +#include "feature/dircache/dirserv.h" #include "feature/dirclient/dirclient_modes.h" #include "feature/hibernate/hibernate.h" #include "feature/hs/hs_config.h" +#include "feature/hs/hs_pow.h" #include "feature/metrics/metrics.h" #include "feature/nodelist/dirlist.h" #include "feature/nodelist/networkstatus.h" @@ -2731,11 +2733,19 @@ list_deprecated_options(void) static void list_enabled_modules(void) { - printf("%s: %s\n", "relay", have_module_relay() ? "yes" : "no"); - printf("%s: %s\n", "dirauth", have_module_dirauth() ? "yes" : "no"); - // We don't list dircache, because it cannot be enabled or disabled - // independently from relay. Listing it here would proliferate - // test variants in test_parseconf.sh to no useful purpose. + static const struct { + const char *name; + bool have; + } list[] = { + { "relay", have_module_relay() }, + { "dirauth", have_module_dirauth() }, + { "dircache", have_module_dircache() }, + { "pow", have_module_pow() } + }; + + for (unsigned i = 0; i < sizeof list / sizeof list[0]; i++) { + printf("%s: %s\n", list[i].name, list[i].have ? "yes" : "no"); + } } /** Prints compile-time and runtime library versions. */ |