Tor  0.4.3.0-alpha-dev
dirauth_sys.c
Go to the documentation of this file.
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-2020, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
6 
7 /**
8  * @file dirauth_sys.c
9  * @brief Directory authority subsystem declarations
10  **/
11 
12 #include "core/or/or.h"
13 
14 #define DIRAUTH_SYS_PRIVATE
15 #include "feature/dirauth/bwauth.h"
19 #include "feature/dirauth/keypin.h"
22 
24 
25 #include "lib/subsys/subsys.h"
26 
27 static const dirauth_options_t *global_dirauth_options;
28 
29 static int
30 subsys_dirauth_initialize(void)
31 {
32  dirauth_register_periodic_events();
33  return 0;
34 }
35 
36 static void
37 subsys_dirauth_shutdown(void)
38 {
43  global_dirauth_options = NULL;
44 }
45 
46 const dirauth_options_t *
47 dirauth_get_options(void)
48 {
49  tor_assert(global_dirauth_options);
50  return global_dirauth_options;
51 }
52 
53 STATIC int
54 dirauth_set_options(void *arg)
55 {
56  dirauth_options_t *opts = arg;
57  global_dirauth_options = opts;
58  return 0;
59 }
60 
61 const struct subsys_fns_t sys_dirauth = {
62  .name = "dirauth",
63  .supported = true,
64  .level = DIRAUTH_SUBSYS_LEVEL,
65  .initialize = subsys_dirauth_initialize,
66  .shutdown = subsys_dirauth_shutdown,
67 
68  .options_format = &dirauth_options_fmt,
69  .set_options = dirauth_set_options,
70 };
void dirserv_free_fingerprint_list(void)
Structure dirauth_options_t to hold directory authority options.
Header for dirauth_sys.c.
const char * name
Definition: subsys.h:42
Header for dirauth_periodic.c.
#define tor_assert(expr)
Definition: util_bug.h:102
Header for keypin.c.
void dirserv_clear_measured_bw_cache(void)
Definition: bwauth.c:103
#define STATIC
Definition: testsupport.h:32
Types used to declare a subsystem.
int keypin_close_journal(void)
Definition: keypin.c:337
Master header file for Tor-specific functionality.
Header file for bwauth.c.
void dirvote_free_all(void)
Definition: dirvote.c:3684
Header file for process_descs.c.
const config_format_t dirauth_options_fmt
Header file for dirvote.c.
Header for feature/dirauth/dirauth_config.c.
#define DIRAUTH_SUBSYS_LEVEL
Definition: dirauth_sys.h:26