From ffa3499d81823eb21811a479c31b59f1bfb5bc61 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Sun, 15 Dec 2019 11:46:55 -0500 Subject: Add config object for dirauth; move one option there. I've chosen the "AuthDirMaxServersPerAddr" option here for simplicity, since it is used literally nowhere else besides the dirauth module. Once we have all the infrastructure in place for this, we can move more options into this structure. --- src/feature/dirauth/dirauth_config.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/feature/dirauth/dirauth_config.c') diff --git a/src/feature/dirauth/dirauth_config.c b/src/feature/dirauth/dirauth_config.c index 552f851461..b7e160c241 100644 --- a/src/feature/dirauth/dirauth_config.c +++ b/src/feature/dirauth/dirauth_config.c @@ -15,6 +15,7 @@ #include "lib/encoding/confline.h" #include "lib/confmgt/confmgt.h" +#include "lib/conf/confdecl.h" /* Required for dirinfo_type_t in or_options_t */ #include "core/or/or.h" @@ -28,6 +29,7 @@ #include "feature/dirauth/dirauth_periodic.h" #include "feature/dirauth/dirvote.h" #include "feature/dirauth/guardfraction.h" +#include "feature/dirauth/dirauth_options_st.h" /* Copied from config.c, we will refactor later in 29211. */ #define REJECT(arg) \ @@ -438,3 +440,23 @@ options_act_dirauth_stats(const or_options_t *old_options, return 0; } + +/* Declare the options field table for dirauth_options */ +#define CONF_CONTEXT TABLE +#include "feature/dirauth/dirauth_options.inc" +#undef CONF_CONTEXT + +/** Magic number for dirauth_options_t. */ +#define DIRAUTH_OPTIONS_MAGIC 0x41757448 + +/** + * Declare the configuration options for the dirauth module. + **/ +const config_format_t dirauth_options_fmt = { + .size = sizeof(dirauth_options_t), + .magic = { "dirauth_options_t", + DIRAUTH_OPTIONS_MAGIC, + offsetof(dirauth_options_t, magic) }, + .vars = dirauth_options_t_vars, +}; + -- cgit v1.2.3-54-g00ecf