tor  0.4.0.1-alpha
authmode.c
Go to the documentation of this file.
1 /* Copyright (c) 2001 Matej Pfajfar.
2  * Copyright (c) 2001-2004, Roger Dingledine.
3  * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
4  * Copyright (c) 2007-2019, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
6 
15 #include "core/or/or.h"
16 #include "app/config/config.h"
18 
19 #include "feature/nodelist/routerinfo_st.h"
20 
24 int
25 authdir_mode(const or_options_t *options)
26 {
27  return options->AuthoritativeDir != 0;
28 }
33 int
34 authdir_mode_handles_descs(const or_options_t *options, int purpose)
35 {
36  if (BUG(purpose < 0)) /* Deprecated. */
37  return authdir_mode(options);
38  else if (purpose == ROUTER_PURPOSE_GENERAL)
39  return authdir_mode_v3(options);
40  else if (purpose == ROUTER_PURPOSE_BRIDGE)
41  return authdir_mode_bridge(options);
42  else
43  return 0;
44 }
48 int
50 {
51  if (authdir_mode_bridge(options))
52  return 0;
53  return authdir_mode(options);
54 }
58 int
60 {
61  return authdir_mode(options);
62 }
66 int
68 {
69  return authdir_mode(options) && options->BridgeAuthoritativeDir != 0;
70 }
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
Header file for config.c.
Header file for directory authority mode.
int authdir_mode_handles_descs(const or_options_t *options, int purpose)
Definition: authmode.c:34
Master header file for Tor-specific functionality.
int BridgeAuthoritativeDir