summaryrefslogtreecommitdiff
path: root/src/feature/dirauth/process_descs.h
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2019-09-16 15:20:25 +0300
committerGeorge Kadianakis <desnacked@riseup.net>2019-09-16 15:20:25 +0300
commita1192b6b4afd194043e2f80751ada9f6b30662cf (patch)
treef261ddf1d64b542139ad74916c6e7c24d01a87ed /src/feature/dirauth/process_descs.h
parentbdd17da9fdfbe9de0547f27c7a78255a56570aa4 (diff)
parentfb0e8966f00c4349602594f312dae60cad2ea11d (diff)
downloadtor-a1192b6b4afd194043e2f80751ada9f6b30662cf.tar.gz
tor-a1192b6b4afd194043e2f80751ada9f6b30662cf.zip
Merge branch 'tor-github/pr/1273'
Diffstat (limited to 'src/feature/dirauth/process_descs.h')
-rw-r--r--src/feature/dirauth/process_descs.h81
1 files changed, 77 insertions, 4 deletions
diff --git a/src/feature/dirauth/process_descs.h b/src/feature/dirauth/process_descs.h
index 1d4085b091..184caa18b8 100644
--- a/src/feature/dirauth/process_descs.h
+++ b/src/feature/dirauth/process_descs.h
@@ -12,10 +12,13 @@
#ifndef TOR_RECV_UPLOADS_H
#define TOR_RECV_UPLOADS_H
-int dirserv_load_fingerprint_file(void);
+// for was_router_added_t.
+#include "feature/nodelist/routerlist.h"
+
void dirserv_free_fingerprint_list(void);
-int dirserv_add_own_fingerprint(crypto_pk_t *pk);
+#ifdef HAVE_MODULE_DIRAUTH
+int dirserv_load_fingerprint_file(void);
enum was_router_added_t dirserv_add_multiple_descriptors(
const char *desc, size_t desclen,
uint8_t purpose,
@@ -25,16 +28,86 @@ enum was_router_added_t dirserv_add_descriptor(routerinfo_t *ri,
const char **msg,
const char *source);
+int dirserv_would_reject_router(const routerstatus_t *rs);
int authdir_wants_to_reject_router(routerinfo_t *ri, const char **msg,
int complain,
int *valid_out);
+int dirserv_add_own_fingerprint(crypto_pk_t *pk);
uint32_t dirserv_router_get_status(const routerinfo_t *router,
const char **msg,
int severity);
void dirserv_set_node_flags_from_authoritative_status(node_t *node,
uint32_t authstatus);
-
-int dirserv_would_reject_router(const routerstatus_t *rs);
+#else
+static inline int
+dirserv_load_fingerprint_file(void)
+{
+ return 0;
+}
+static inline enum was_router_added_t
+dirserv_add_multiple_descriptors(const char *desc, size_t desclen,
+ uint8_t purpose,
+ const char *source,
+ const char **msg)
+{
+ (void)desc;
+ (void)desclen;
+ (void)purpose;
+ (void)source;
+ (void)msg;
+ return (enum was_router_added_t)0;
+}
+static inline enum was_router_added_t
+dirserv_add_descriptor(routerinfo_t *ri,
+ const char **msg,
+ const char *source)
+{
+ (void)ri;
+ (void)msg;
+ (void)source;
+ return (enum was_router_added_t)0;
+}
+static inline int
+dirserv_would_reject_router(const routerstatus_t *rs)
+{
+ (void)rs;
+ return 0;
+}
+static inline int
+authdir_wants_to_reject_router(routerinfo_t *ri, const char **msg,
+ int complain,
+ int *valid_out)
+{
+ (void)ri;
+ (void)msg;
+ (void)complain;
+ (void)valid_out;
+ return 0;
+}
+static inline int
+dirserv_add_own_fingerprint(crypto_pk_t *pk)
+{
+ (void)pk;
+ return 0;
+}
+static inline uint32_t
+dirserv_router_get_status(const routerinfo_t *router,
+ const char **msg,
+ int severity)
+{
+ (void)router;
+ (void)msg;
+ (void)severity;
+ return 0;
+}
+static inline void
+dirserv_set_node_flags_from_authoritative_status(node_t *node,
+ uint32_t authstatus)
+{
+ (void)node;
+ (void)authstatus;
+}
+#endif
#ifdef TOR_UNIT_TESTS
STATIC int dirserv_router_has_valid_address(routerinfo_t *ri);