summaryrefslogtreecommitdiff
path: root/src/feature/relay
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-12-18 11:49:26 -0500
committerNick Mathewson <nickm@torproject.org>2019-12-19 07:54:56 -0500
commit13df7449217cec5d4a9baf73adec850614b43633 (patch)
treed1188e02ff1ec5ee7ecaba3253fae1540d4ce945 /src/feature/relay
parent8d474e4dc5e4088eb26fc0dd665f22d0cfb06abf (diff)
downloadtor-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/relay')
-rw-r--r--src/feature/relay/relay_stub.c2
-rw-r--r--src/feature/relay/relay_sys.c2
-rw-r--r--src/feature/relay/relay_sys.h8
3 files changed, 10 insertions, 2 deletions
diff --git a/src/feature/relay/relay_stub.c b/src/feature/relay/relay_stub.c
index a23b991862..36daaa7bd7 100644
--- a/src/feature/relay/relay_stub.c
+++ b/src/feature/relay/relay_stub.c
@@ -16,5 +16,5 @@
const struct subsys_fns_t sys_relay = {
.name = "relay",
.supported = false,
- .level = 50,
+ .level = RELAY_SUBSYS_LEVEL,
};
diff --git a/src/feature/relay/relay_sys.c b/src/feature/relay/relay_sys.c
index 106e88b2a5..dfddff27f2 100644
--- a/src/feature/relay/relay_sys.c
+++ b/src/feature/relay/relay_sys.c
@@ -42,7 +42,7 @@ subsys_relay_shutdown(void)
const struct subsys_fns_t sys_relay = {
.name = "relay",
.supported = true,
- .level = 50,
+ .level = RELAY_SUBSYS_LEVEL,
.initialize = subsys_relay_initialize,
.shutdown = subsys_relay_shutdown,
};
diff --git a/src/feature/relay/relay_sys.h b/src/feature/relay/relay_sys.h
index 32e21d90d8..ba3b5ccf4e 100644
--- a/src/feature/relay/relay_sys.h
+++ b/src/feature/relay/relay_sys.h
@@ -14,4 +14,12 @@
extern const struct subsys_fns_t sys_relay;
+/**
+ * Subsystem level for the relay system.
+ *
+ * Defined here so that it can be shared between the real and stub
+ * definitions.
+ **/
+#define RELAY_SUBSYS_LEVEL 50
+
#endif /* !defined(TOR_FEATURE_RELAY_RELAY_SYS_H) */