Commit 2115a54b authored by David Goulet's avatar David Goulet 🔆
Browse files

mod: Move dirauth specific files to its own module



This is a pretty big commit but it only moves these files to src/or/dirauth:

  dircollate.c dirvote.c shared_random.c shared_random_state.c
  dircollate.h dirvote.h shared_random.h shared_random_state.h

Then many files are modified to change the include line for those header files
that have moved into a new directory.

Without using --disable-module-dirauth, everything builds fine. When using the
flag to disable the module, tor doesn't build due to linking errors. This will
be addressed in the next commit(s).

No code behavior change.
Signed-off-by: David Goulet's avatarDavid Goulet <dgoulet@torproject.org>
parent 35d86b08
......@@ -79,7 +79,6 @@
#include "confparse.h"
#include "cpuworker.h"
#include "dirserv.h"
#include "dirvote.h"
#include "dns.h"
#include "dos.h"
#include "entrynodes.h"
......@@ -110,6 +109,8 @@
#include "procmon.h"
#include "dirauth/dirvote.h"
#ifdef HAVE_SYSTEMD
# if defined(__COVERITY__) && !defined(__INCLUDE_LEVEL__)
/* Systemd's use of gcc's __INCLUDE_LEVEL__ extension macro appears to confuse
......
......@@ -76,7 +76,7 @@
#include "router.h"
#include "routerlist.h"
#include "routerparse.h"
#include "shared_random.h"
#include "dirauth/shared_random.h"
#ifndef _WIN32
#include <pwd.h>
......
......@@ -91,7 +91,6 @@
#include "shared_random.h"
#include "config.h"
#include "confparse.h"
#include "dirvote.h"
#include "networkstatus.h"
#include "routerkeys.h"
#include "router.h"
......@@ -99,6 +98,8 @@
#include "shared_random_state.h"
#include "util.h"
#include "dirauth/dirvote.h"
/* String prefix of shared random values in votes/consensuses. */
static const char previous_srv_str[] = "shared-rand-previous-value";
static const char current_srv_str[] = "shared-rand-current-value";
......
......@@ -14,11 +14,12 @@
#include "shared_random.h"
#include "config.h"
#include "confparse.h"
#include "dirvote.h"
#include "networkstatus.h"
#include "router.h"
#include "shared_random_state.h"
#include "dirauth/dirvote.h"
/* Default filename of the shared random state on disk. */
static const char default_fname[] = "sr-state";
......
......@@ -20,7 +20,6 @@
#include "compat.h"
#include "directory.h"
#include "dirserv.h"
#include "dirvote.h"
#include "entrynodes.h"
#include "geoip.h"
#include "hs_cache.h"
......@@ -41,7 +40,7 @@
#include "routerlist.h"
#include "routerparse.h"
#include "routerset.h"
#include "shared_random.h"
#include "dirauth/shared_random.h"
#if defined(EXPORTMALLINFO) && defined(HAVE_MALLOC_H) && defined(HAVE_MALLINFO)
#if !defined(OpenBSD)
......@@ -49,6 +48,8 @@
#endif
#endif
#include "dirauth/dirvote.h"
/**
* \file directory.c
* \brief Code to send and fetch information from directory authorities and
......
......@@ -18,7 +18,6 @@
#include "control.h"
#include "directory.h"
#include "dirserv.h"
#include "dirvote.h"
#include "hibernate.h"
#include "keypin.h"
#include "main.h"
......@@ -34,6 +33,8 @@
#include "routerset.h"
#include "torcert.h"
#include "dirauth/dirvote.h"
/**
* \file dirserv.c
* \brief Directory server core implementation. Manages directory
......
......@@ -28,8 +28,8 @@
#include "rendservice.h"
#include "routerset.h"
#include "router.h"
#include "shared_random.h"
#include "shared_random_state.h"
#include "dirauth/shared_random.h"
#include "dirauth/shared_random_state.h"
/* Trunnel */
#include "ed25519_cert.h"
......
......@@ -24,7 +24,7 @@
#include "router.h"
#include "routerkeys.h"
#include "routerlist.h"
#include "shared_random_state.h"
#include "dirauth/shared_random_state.h"
#include "statefile.h"
#include "hs_circuit.h"
......
......@@ -41,10 +41,8 @@ LIBTOR_A_SOURCES = \
src/or/consdiffmgr.c \
src/or/control.c \
src/or/cpuworker.c \
src/or/dircollate.c \
src/or/directory.c \
src/or/dirserv.c \
src/or/dirvote.c \
src/or/dns.c \
src/or/dnsserv.c \
src/or/dos.c \
......@@ -76,8 +74,6 @@ LIBTOR_A_SOURCES = \
src/or/onion.c \
src/or/onion_fast.c \
src/or/onion_tap.c \
src/or/shared_random.c \
src/or/shared_random_state.c \
src/or/transports.c \
src/or/parsecommon.c \
src/or/periodic.c \
......@@ -121,7 +117,11 @@ LIBTOR_A_SOURCES = \
# The Directory Authority module.
if BUILD_MODULE_DIRAUTH
#LIBTOR_A_SOURCES +=
LIBTOR_A_SOURCES += \
src/or/dirauth/dircollate.c \
src/or/dirauth/dirvote.c \
src/or/dirauth/shared_random.c \
src/or/dirauth/shared_random_state.c
endif
src_or_libtor_a_SOURCES = $(LIBTOR_A_SOURCES)
......@@ -195,10 +195,8 @@ ORHEADERS = \
src/or/consdiffmgr.h \
src/or/control.h \
src/or/cpuworker.h \
src/or/dircollate.h \
src/or/directory.h \
src/or/dirserv.h \
src/or/dirvote.h \
src/or/dns.h \
src/or/dns_structs.h \
src/or/dnsserv.h \
......@@ -235,8 +233,6 @@ ORHEADERS = \
src/or/onion_ntor.h \
src/or/onion_tap.h \
src/or/or.h \
src/or/shared_random.h \
src/or/shared_random_state.h \
src/or/transports.h \
src/or/parsecommon.h \
src/or/periodic.h \
......@@ -273,7 +269,11 @@ ORHEADERS = \
# properly compiled the entry points stub.
# The Directory Authority module headers.
#ORHEADERS +=
ORHEADERS += \
src/or/dirauth/dircollate.h \
src/or/dirauth/dirvote.h \
src/or/dirauth/shared_random.h \
src/or/dirauth/shared_random_state.h
# This may someday want to be an installed file?
noinst_HEADERS += src/or/tor_api.h
......
......@@ -72,7 +72,6 @@
#include "crypto_s2k.h"
#include "directory.h"
#include "dirserv.h"
#include "dirvote.h"
#include "dns.h"
#include "dnsserv.h"
#include "dos.h"
......@@ -103,7 +102,7 @@
#include "routerlist.h"
#include "routerparse.h"
#include "scheduler.h"
#include "shared_random.h"
#include "dirauth/shared_random.h"
#include "statefile.h"
#include "status.h"
#include "tor_api.h"
......@@ -118,6 +117,8 @@
#include <event2/event.h>
#include "dirauth/dirvote.h"
#ifdef HAVE_SYSTEMD
# if defined(__COVERITY__) && !defined(__INCLUDE_LEVEL__)
/* Systemd's use of gcc's __INCLUDE_LEVEL__ extension macro appears to confuse
......
......@@ -50,7 +50,6 @@
#include "control.h"
#include "directory.h"
#include "dirserv.h"
#include "dirvote.h"
#include "dos.h"
#include "entrynodes.h"
#include "hibernate.h"
......@@ -64,11 +63,13 @@
#include "routerlist.h"
#include "routerparse.h"
#include "scheduler.h"
#include "shared_random.h"
#include "dirauth/shared_random.h"
#include "transports.h"
#include "torcert.h"
#include "channelpadding.h"
#include "dirauth/dirvote.h"
/** Most recently received and validated v3 "ns"-flavored consensus network
* status. */
STATIC networkstatus_t *current_ns_consensus = NULL;
......
......@@ -101,7 +101,6 @@
#include "control.h"
#include "directory.h"
#include "dirserv.h"
#include "dirvote.h"
#include "entrynodes.h"
#include "fp_pair.h"
#include "geoip.h"
......@@ -122,6 +121,8 @@
#include "sandbox.h"
#include "torcert.h"
#include "dirauth/dirvote.h"
// #define DEBUG_ROUTERLIST
/****************************************************************************/
......
......@@ -59,7 +59,6 @@
#include "config.h"
#include "circuitstats.h"
#include "dirserv.h"
#include "dirvote.h"
#include "parsecommon.h"
#include "policies.h"
#include "protover.h"
......@@ -75,11 +74,13 @@
#include "entrynodes.h"
#include "torcert.h"
#include "sandbox.h"
#include "shared_random.h"
#include "dirauth/shared_random.h"
#undef log
#include <math.h>
#include "dirauth/dirvote.h"
/****************************************************************************/
/** List of tokens recognized in router descriptors */
......
......@@ -24,7 +24,7 @@
#include "control.h"
#include "cpuworker.h"
#include "dirserv.h"
#include "dirvote.h"
#include "dirauth/dirvote.h"
#include "dns.h"
#include "entrynodes.h"
#include "transports.h"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment