From 9385b7ec5f6effce97ae26aa6cda08df5b90309b Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 25 Sep 2018 15:18:19 -0400 Subject: Rename dirauth/mode.h to dirauth/authmode.h This is preparation for having a routermode.h as well --- src/feature/dirauth/authmode.h | 38 ++++++++++++++++++++++++++++++++++++ src/feature/dirauth/dirvote.c | 2 +- src/feature/dirauth/mode.h | 38 ------------------------------------ src/feature/dirauth/shared_random.c | 2 +- src/feature/dircache/dircache.c | 2 +- src/feature/dirclient/dirclient.c | 2 +- src/feature/nodelist/networkstatus.c | 2 +- src/feature/nodelist/nodelist.c | 2 +- src/feature/nodelist/routerlist.c | 2 +- src/feature/relay/router.c | 2 +- 10 files changed, 46 insertions(+), 46 deletions(-) create mode 100644 src/feature/dirauth/authmode.h delete mode 100644 src/feature/dirauth/mode.h (limited to 'src/feature') diff --git a/src/feature/dirauth/authmode.h b/src/feature/dirauth/authmode.h new file mode 100644 index 0000000000..8bb961dffb --- /dev/null +++ b/src/feature/dirauth/authmode.h @@ -0,0 +1,38 @@ +/* Copyright (c) 2018-2018, The Tor Project, Inc. */ +/* See LICENSE for licensing information */ + +/** + * \file mode.h + * \brief Standalone header file for directory authority mode. + **/ + +#ifndef TOR_DIRAUTH_MODE_H +#define TOR_DIRAUTH_MODE_H + +#ifdef HAVE_MODULE_DIRAUTH + +#include "feature/relay/router.h" + +/* 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 */ + +/* Without the dirauth module, we can't be a v3 directory authority, ever. */ + +static inline int +authdir_mode_v3(const or_options_t *options) +{ + (void) options; + return 0; +} + +#endif /* HAVE_MODULE_DIRAUTH */ + +#endif /* TOR_MODE_H */ + diff --git a/src/feature/dirauth/dirvote.c b/src/feature/dirauth/dirvote.c index a1fe0d4234..edb0ad2aea 100644 --- a/src/feature/dirauth/dirvote.c +++ b/src/feature/dirauth/dirvote.c @@ -34,7 +34,7 @@ #include "feature/dircommon/voting_schedule.h" #include "feature/dirauth/dirvote.h" -#include "feature/dirauth/mode.h" +#include "feature/dirauth/authmode.h" #include "feature/dirauth/shared_random_state.h" #include "feature/nodelist/authority_cert_st.h" diff --git a/src/feature/dirauth/mode.h b/src/feature/dirauth/mode.h deleted file mode 100644 index 8bb961dffb..0000000000 --- a/src/feature/dirauth/mode.h +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright (c) 2018-2018, The Tor Project, Inc. */ -/* See LICENSE for licensing information */ - -/** - * \file mode.h - * \brief Standalone header file for directory authority mode. - **/ - -#ifndef TOR_DIRAUTH_MODE_H -#define TOR_DIRAUTH_MODE_H - -#ifdef HAVE_MODULE_DIRAUTH - -#include "feature/relay/router.h" - -/* 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 */ - -/* Without the dirauth module, we can't be a v3 directory authority, ever. */ - -static inline int -authdir_mode_v3(const or_options_t *options) -{ - (void) options; - return 0; -} - -#endif /* HAVE_MODULE_DIRAUTH */ - -#endif /* TOR_MODE_H */ - diff --git a/src/feature/dirauth/shared_random.c b/src/feature/dirauth/shared_random.c index 85ec82ac00..db4f9d328c 100644 --- a/src/feature/dirauth/shared_random.c +++ b/src/feature/dirauth/shared_random.c @@ -102,7 +102,7 @@ #include "feature/dircommon/voting_schedule.h" #include "feature/dirauth/dirvote.h" -#include "feature/dirauth/mode.h" +#include "feature/dirauth/authmode.h" #include "feature/nodelist/authority_cert_st.h" #include "feature/nodelist/networkstatus_st.h" diff --git a/src/feature/dircache/dircache.c b/src/feature/dircache/dircache.c index 7bfc539829..c58512814e 100644 --- a/src/feature/dircache/dircache.c +++ b/src/feature/dircache/dircache.c @@ -11,7 +11,7 @@ #include "core/mainloop/connection.h" #include "core/or/relay.h" #include "feature/dirauth/dirvote.h" -#include "feature/dirauth/mode.h" +#include "feature/dirauth/authmode.h" #include "feature/dirauth/process_descs.h" #include "feature/dircache/conscache.h" #include "feature/dircache/consdiffmgr.h" diff --git a/src/feature/dirclient/dirclient.c b/src/feature/dirclient/dirclient.c index 89bc19f84b..bd6800c74f 100644 --- a/src/feature/dirclient/dirclient.c +++ b/src/feature/dirclient/dirclient.c @@ -16,7 +16,7 @@ #include "feature/client/entrynodes.h" #include "feature/control/control.h" #include "feature/dirauth/dirvote.h" -#include "feature/dirauth/mode.h" +#include "feature/dirauth/authmode.h" #include "feature/dirauth/shared_random.h" #include "feature/dircache/dirserv.h" #include "feature/dirclient/dirclient.h" diff --git a/src/feature/nodelist/networkstatus.c b/src/feature/nodelist/networkstatus.c index c6a51aefc7..2ce38e2046 100644 --- a/src/feature/nodelist/networkstatus.c +++ b/src/feature/nodelist/networkstatus.c @@ -79,7 +79,7 @@ #include "feature/nodelist/fmt_routerstatus.h" #include "feature/dirauth/dirvote.h" -#include "feature/dirauth/mode.h" +#include "feature/dirauth/authmode.h" #include "feature/dirauth/shared_random.h" #include "feature/dirauth/voteflags.h" diff --git a/src/feature/nodelist/nodelist.c b/src/feature/nodelist/nodelist.c index ce77d71c64..b5ded356ba 100644 --- a/src/feature/nodelist/nodelist.c +++ b/src/feature/nodelist/nodelist.c @@ -69,7 +69,7 @@ #include -#include "feature/dirauth/mode.h" +#include "feature/dirauth/authmode.h" #include "feature/dirclient/dir_server_st.h" #include "feature/nodelist/microdesc_st.h" diff --git a/src/feature/nodelist/routerlist.c b/src/feature/nodelist/routerlist.c index 5c6a104779..afecaa4fb5 100644 --- a/src/feature/nodelist/routerlist.c +++ b/src/feature/nodelist/routerlist.c @@ -68,7 +68,7 @@ #include "core/or/policies.h" #include "feature/client/bridges.h" #include "feature/control/control.h" -#include "feature/dirauth/mode.h" +#include "feature/dirauth/authmode.h" #include "feature/dircommon/directory.h" #include "feature/dirclient/dirclient.h" #include "feature/dircache/dirserv.h" diff --git a/src/feature/relay/router.c b/src/feature/relay/router.c index 480f23a107..3e19c7b619 100644 --- a/src/feature/relay/router.c +++ b/src/feature/relay/router.c @@ -44,7 +44,7 @@ #include "feature/client/transports.h" #include "feature/nodelist/routerset.h" -#include "feature/dirauth/mode.h" +#include "feature/dirauth/authmode.h" #include "feature/nodelist/authority_cert_st.h" #include "core/or/crypt_path_st.h" -- cgit v1.2.3-54-g00ecf