diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-12-18 11:49:26 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-12-19 07:54:56 -0500 |
commit | 13df7449217cec5d4a9baf73adec850614b43633 (patch) | |
tree | d1188e02ff1ec5ee7ecaba3253fae1540d4ce945 /src/feature/dirauth | |
parent | 8d474e4dc5e4088eb26fc0dd665f22d0cfb06abf (diff) | |
download | tor-13df7449217cec5d4a9baf73adec850614b43633.tar.gz tor-13df7449217cec5d4a9baf73adec850614b43633.zip |
Declare relay/dirauth subsystem levels in a header.
This way, we can't get out of sync between the two declarations.
Diffstat (limited to 'src/feature/dirauth')
-rw-r--r-- | src/feature/dirauth/dirauth_stub.c | 2 | ||||
-rw-r--r-- | src/feature/dirauth/dirauth_sys.c | 2 | ||||
-rw-r--r-- | src/feature/dirauth/dirauth_sys.h | 8 |
3 files changed, 10 insertions, 2 deletions
diff --git a/src/feature/dirauth/dirauth_stub.c b/src/feature/dirauth/dirauth_stub.c index b0b4f987f2..d902d56d2b 100644 --- a/src/feature/dirauth/dirauth_stub.c +++ b/src/feature/dirauth/dirauth_stub.c @@ -27,7 +27,7 @@ static const config_format_t dirauth_options_stub_fmt = { const struct subsys_fns_t sys_dirauth = { .name = "dirauth", .supported = false, - .level = 70, + .level = DIRAUTH_SUBSYS_LEVEL, .options_format = &dirauth_options_stub_fmt }; diff --git a/src/feature/dirauth/dirauth_sys.c b/src/feature/dirauth/dirauth_sys.c index 8a4b1abaab..6ec25681e7 100644 --- a/src/feature/dirauth/dirauth_sys.c +++ b/src/feature/dirauth/dirauth_sys.c @@ -60,7 +60,7 @@ dirauth_set_options(void *arg) const struct subsys_fns_t sys_dirauth = { .name = "dirauth", .supported = true, - .level = 70, + .level = DIRAUTH_SUBSYS_LEVEL, .initialize = subsys_dirauth_initialize, .shutdown = subsys_dirauth_shutdown, diff --git a/src/feature/dirauth/dirauth_sys.h b/src/feature/dirauth/dirauth_sys.h index 4c09ff64f9..6f116855df 100644 --- a/src/feature/dirauth/dirauth_sys.h +++ b/src/feature/dirauth/dirauth_sys.h @@ -17,4 +17,12 @@ const struct dirauth_options_t *dirauth_get_options(void); extern const struct subsys_fns_t sys_dirauth; +/** + * Subsystem level for the directory-authority system. + * + * Defined here so that it can be shared between the real and stub + * definitions. + **/ +#define DIRAUTH_SUBSYS_LEVEL 70 + #endif /* !defined(DIRAUTH_SYS_H) */ |