2019-04-25 21:09:24 +02:00
|
|
|
/* Copyright (c) 2001 Matej Pfajfar.
|
|
|
|
* Copyright (c) 2001-2004, Roger Dingledine.
|
|
|
|
* Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
|
|
|
|
* Copyright (c) 2007-2019, The Tor Project, Inc. */
|
|
|
|
/* See LICENSE for licensing information */
|
|
|
|
|
|
|
|
#include "core/or/or.h"
|
|
|
|
|
2019-04-30 18:48:00 +02:00
|
|
|
#include "feature/dirauth/bwauth.h"
|
2019-04-25 21:09:24 +02:00
|
|
|
#include "feature/dirauth/dirauth_sys.h"
|
|
|
|
#include "feature/dirauth/dirvote.h"
|
|
|
|
#include "feature/dirauth/dirauth_periodic.h"
|
2019-04-30 18:52:00 +02:00
|
|
|
#include "feature/dirauth/keypin.h"
|
2019-04-30 17:31:03 +02:00
|
|
|
#include "feature/dirauth/process_descs.h"
|
|
|
|
|
2019-04-25 21:09:24 +02:00
|
|
|
#include "lib/subsys/subsys.h"
|
|
|
|
|
|
|
|
static int
|
|
|
|
subsys_dirauth_initialize(void)
|
|
|
|
{
|
2019-04-26 19:17:35 +02:00
|
|
|
dirauth_register_periodic_events();
|
2019-04-25 21:09:24 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
subsys_dirauth_shutdown(void)
|
|
|
|
{
|
2019-04-30 17:31:03 +02:00
|
|
|
dirserv_free_fingerprint_list();
|
2019-04-25 21:09:24 +02:00
|
|
|
dirvote_free_all();
|
2019-04-30 18:48:00 +02:00
|
|
|
dirserv_clear_measured_bw_cache();
|
2019-04-30 18:52:00 +02:00
|
|
|
keypin_close_journal();
|
2019-04-25 21:09:24 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
const struct subsys_fns_t sys_dirauth = {
|
|
|
|
.name = "dirauth",
|
|
|
|
.supported = true,
|
|
|
|
.level = 70,
|
|
|
|
.initialize = subsys_dirauth_initialize,
|
|
|
|
.shutdown = subsys_dirauth_shutdown,
|
|
|
|
};
|