1 /* Copyright (c) 2001 Matej Pfajfar.
2 * Copyright (c) 2001-2004, Roger Dingledine.
3 * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
4 * Copyright (c) 2007-2021, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
8 * @file opts_testing_helpers.c
9 * @brief Helper functions to access module-specific config options.
13 #include "test/opts_test_helpers.h"
15 #define CONFIG_PRIVATE
16 #include "core/or/or.h"
17 #include "lib/confmgt/confmgt.h"
18 #include "app/main/subsysmgr.h"
19 #include "app/config/config.h"
21 #include "lib/crypt_ops/crypto_sys.h"
22 #include "feature/dirauth/dirauth_sys.h"
24 struct dirauth_options_t
*
25 get_dirauth_options(struct or_options_t
*opt
)
27 int idx
= subsystems_get_options_idx(&sys_dirauth
);
29 return config_mgr_get_obj_mutable(get_options_mgr(), opt
, idx
);
32 struct crypto_options_t
*
33 get_crypto_options(struct or_options_t
*opt
)
35 int idx
= subsystems_get_options_idx(&sys_crypto
);
37 return config_mgr_get_obj_mutable(get_options_mgr(), opt
, idx
);