aboutsummaryrefslogtreecommitdiff
path: root/src/feature
diff options
context:
space:
mode:
Diffstat (limited to 'src/feature')
-rw-r--r--src/feature/dirauth/dirauth_stub.c19
-rw-r--r--src/feature/dirauth/dirauth_sys.h4
-rw-r--r--src/feature/relay/relay_stub.c20
-rw-r--r--src/feature/relay/relay_sys.h4
4 files changed, 39 insertions, 8 deletions
diff --git a/src/feature/dirauth/dirauth_stub.c b/src/feature/dirauth/dirauth_stub.c
new file mode 100644
index 0000000000..fac68edd09
--- /dev/null
+++ b/src/feature/dirauth/dirauth_stub.c
@@ -0,0 +1,19 @@
+/* Copyright (c) 2001 Matej Pfajfar.
+ * Copyright (c) 2001-2004, Roger Dingledine.
+ * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
+ * Copyright (c) 2007-2019, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+/**
+ * @file dirauth_stub.c
+ * @brief Stub declarations for use when dirauth module is disabled.
+ **/
+
+#include "orconfig.h"
+#include "feature/dirauth/dirauth_sys.h"
+
+const struct subsys_fns_t sys_dirauth = {
+ .name = "dirauth",
+ .supported = false,
+ .level = 70,
+};
diff --git a/src/feature/dirauth/dirauth_sys.h b/src/feature/dirauth/dirauth_sys.h
index 86c8d8ba3e..2d5a0cb3e7 100644
--- a/src/feature/dirauth/dirauth_sys.h
+++ b/src/feature/dirauth/dirauth_sys.h
@@ -12,10 +12,6 @@
#ifndef DIRAUTH_SYS_H
#define DIRAUTH_SYS_H
-#ifdef HAVE_MODULE_DIRAUTH
-
extern const struct subsys_fns_t sys_dirauth;
-#endif
-
#endif /* !defined(DIRAUTH_SYS_H) */
diff --git a/src/feature/relay/relay_stub.c b/src/feature/relay/relay_stub.c
new file mode 100644
index 0000000000..a23b991862
--- /dev/null
+++ b/src/feature/relay/relay_stub.c
@@ -0,0 +1,20 @@
+/* Copyright (c) 2001 Matej Pfajfar.
+ * Copyright (c) 2001-2004, Roger Dingledine.
+ * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
+ * Copyright (c) 2007-2019, The Tor Project, Inc. */
+/* See LICENSE for licensing information */
+
+/**
+ * @file relay_stub.c
+ * @brief Stub declarations for use when relay module is disabled.
+ **/
+
+#include "orconfig.h"
+#include "feature/relay/relay_sys.h"
+#include "lib/subsys/subsys.h"
+
+const struct subsys_fns_t sys_relay = {
+ .name = "relay",
+ .supported = false,
+ .level = 50,
+};
diff --git a/src/feature/relay/relay_sys.h b/src/feature/relay/relay_sys.h
index aa387369b5..32e21d90d8 100644
--- a/src/feature/relay/relay_sys.h
+++ b/src/feature/relay/relay_sys.h
@@ -12,10 +12,6 @@
#ifndef TOR_FEATURE_RELAY_RELAY_SYS_H
#define TOR_FEATURE_RELAY_RELAY_SYS_H
-#ifdef HAVE_MODULE_RELAY
-
extern const struct subsys_fns_t sys_relay;
-#endif
-
#endif /* !defined(TOR_FEATURE_RELAY_RELAY_SYS_H) */