tor  0.4.2.0-alpha-dev
authmode.h
Go to the documentation of this file.
1 /* Copyright (c) 2018-2019, The Tor Project, Inc. */
2 /* See LICENSE for licensing information */
3 
9 #ifndef TOR_DIRAUTH_MODE_H
10 #define TOR_DIRAUTH_MODE_H
11 
12 #include "feature/relay/router.h"
13 
14 #ifdef HAVE_MODULE_DIRAUTH
15 
16 int authdir_mode(const or_options_t *options);
17 int authdir_mode_handles_descs(const or_options_t *options, int purpose);
20 int authdir_mode_bridge(const or_options_t *options);
21 
22 /* Return true iff we believe ourselves to be a v3 authoritative directory
23  * server. */
24 static inline int
25 authdir_mode_v3(const or_options_t *options)
26 {
27  return authdir_mode(options) && options->V3AuthoritativeDir != 0;
28 }
29 
30 #define have_module_dirauth() (1)
31 
32 #else /* !(defined(HAVE_MODULE_DIRAUTH)) */
33 
34 #define authdir_mode(options) (((void)(options)),0)
35 #define authdir_mode_handles_descs(options,purpose) \
36  (((void)(options)),((void)(purpose)),0)
37 #define authdir_mode_publishes_statuses(options) (((void)(options)),0)
38 #define authdir_mode_tests_reachability(options) (((void)(options)),0)
39 #define authdir_mode_bridge(options) (((void)(options)),0)
40 #define authdir_mode_v3(options) (((void)(options)),0)
41 
42 #define have_module_dirauth() (0)
43 
44 #endif /* defined(HAVE_MODULE_DIRAUTH) */
45 
46 #endif /* !defined(TOR_DIRAUTH_MODE_H) */
int V3AuthoritativeDir
int authdir_mode_tests_reachability(const or_options_t *options)
Definition: authmode.c:59
int authdir_mode(const or_options_t *options)
Definition: authmode.c:25
int authdir_mode_publishes_statuses(const or_options_t *options)
Definition: authmode.c:49
int authdir_mode_bridge(const or_options_t *options)
Definition: authmode.c:67
int authdir_mode_handles_descs(const or_options_t *options, int purpose)
Definition: authmode.c:34
Header file for router.c.