2018-06-20 14:13:28 +02:00
|
|
|
/* Copyright (c) 2018-2018, The Tor Project, Inc. */
|
2018-05-02 19:42:24 +02:00
|
|
|
/* See LICENSE for licensing information */
|
|
|
|
|
|
|
|
/**
|
2018-09-25 21:39:24 +02:00
|
|
|
* \file authmode.h
|
|
|
|
* \brief Header file for directory authority mode.
|
2018-05-02 19:42:24 +02:00
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef TOR_DIRAUTH_MODE_H
|
|
|
|
#define TOR_DIRAUTH_MODE_H
|
|
|
|
|
2018-09-25 21:39:24 +02:00
|
|
|
#include "feature/relay/router.h"
|
|
|
|
|
2018-05-02 19:42:24 +02:00
|
|
|
#ifdef HAVE_MODULE_DIRAUTH
|
|
|
|
|
2018-09-25 21:39:24 +02:00
|
|
|
int authdir_mode(const or_options_t *options);
|
|
|
|
int authdir_mode_handles_descs(const or_options_t *options, int purpose);
|
|
|
|
int authdir_mode_publishes_statuses(const or_options_t *options);
|
|
|
|
int authdir_mode_tests_reachability(const or_options_t *options);
|
|
|
|
int authdir_mode_bridge(const or_options_t *options);
|
2018-05-02 19:42:24 +02:00
|
|
|
|
|
|
|
/* Return true iff we believe ourselves to be a v3 authoritative directory
|
|
|
|
* server. */
|
|
|
|
static inline int
|
|
|
|
authdir_mode_v3(const or_options_t *options)
|
|
|
|
{
|
|
|
|
return authdir_mode(options) && options->V3AuthoritativeDir != 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
#else /* HAVE_MODULE_DIRAUTH */
|
|
|
|
|
2018-09-25 21:39:24 +02:00
|
|
|
#define authdir_mode(options) (((void)(options)),0)
|
|
|
|
#define authdir_mode_handles_descs(options,purpose) \
|
|
|
|
(((void)(options)),((void)(purpose)),0)
|
|
|
|
#define authdir_mode_publishes_statuses(options) (((void)(options)),0)
|
|
|
|
#define authdir_mode_tests_reachability(options) (((void)(options)),0)
|
|
|
|
#define authdir_mode_bridge(options) (((void)(options)),0)
|
|
|
|
#define authdir_mode_v3(options) (((void)(options)),0)
|
2018-05-02 19:42:24 +02:00
|
|
|
|
|
|
|
#endif /* HAVE_MODULE_DIRAUTH */
|
|
|
|
|
|
|
|
#endif /* TOR_MODE_H */
|