Tor  0.4.3.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 
4 /**
5  * \file authmode.h
6  * \brief Header file for directory authority mode.
7  **/
8 
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 /* Is the dirauth module enabled? */
31 #define have_module_dirauth() (1)
32 
33 #else /* !defined(HAVE_MODULE_DIRAUTH) */
34 
35 #define authdir_mode(options) (((void)(options)),0)
36 #define authdir_mode_handles_descs(options,purpose) \
37  (((void)(options)),((void)(purpose)),0)
38 #define authdir_mode_publishes_statuses(options) (((void)(options)),0)
39 #define authdir_mode_tests_reachability(options) (((void)(options)),0)
40 #define authdir_mode_bridge(options) (((void)(options)),0)
41 #define authdir_mode_v3(options) (((void)(options)),0)
42 
43 #define have_module_dirauth() (0)
44 
45 #endif /* defined(HAVE_MODULE_DIRAUTH) */
46 
47 #endif /* !defined(TOR_DIRAUTH_MODE_H) */
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.
int V3AuthoritativeDir