Line data Source code
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 */ 6 : 7 : /** 8 : * @file opts_testing_helpers.c 9 : * @brief Helper functions to access module-specific config options. 10 : **/ 11 : 12 : #include "orconfig.h" 13 : #include "test/opts_test_helpers.h" 14 : 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" 20 : 21 : #include "lib/crypt_ops/crypto_sys.h" 22 : #include "feature/dirauth/dirauth_sys.h" 23 : 24 : struct dirauth_options_t * 25 6 : get_dirauth_options(struct or_options_t *opt) 26 : { 27 6 : int idx = subsystems_get_options_idx(&sys_dirauth); 28 6 : tor_assert(idx >= 0); 29 6 : return config_mgr_get_obj_mutable(get_options_mgr(), opt, idx); 30 : } 31 : 32 : struct crypto_options_t * 33 3 : get_crypto_options(struct or_options_t *opt) 34 : { 35 3 : int idx = subsystems_get_options_idx(&sys_crypto); 36 3 : tor_assert(idx >= 0); 37 3 : return config_mgr_get_obj_mutable(get_options_mgr(), opt, idx); 38 : }