Tor  0.4.7.0-alpha-dev
relay_sys.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-2021, The Tor Project, Inc. */
5 /* See LICENSE for licensing information */
6 
7 /**
8  * @file relay_sys.c
9  * @brief Subsystem definitions for the relay module.
10  **/
11 
12 #include "orconfig.h"
13 #include "core/or/or.h"
14 
15 #include "feature/relay/dns.h"
22 #include "feature/relay/router.h"
23 
24 #include "lib/subsys/subsys.h"
25 
26 static int
27 subsys_relay_initialize(void)
28 {
30  relay_register_periodic_events();
31  return 0;
32 }
33 
34 static void
35 subsys_relay_shutdown(void)
36 {
37  dns_free_all();
40  routerkeys_free_all();
43 }
44 
45 const struct subsys_fns_t sys_relay = {
46  .name = "relay",
48  .supported = true,
49  .level = RELAY_SUBSYS_LEVEL,
50  .initialize = subsys_relay_initialize,
51  .shutdown = subsys_relay_shutdown,
52 
53  .get_metrics = relay_metrics_get_stores,
54 };
void dns_free_all(void)
Definition: dns.c:376
Header file for dns.c.
void ext_orport_free_all(void)
Definition: ext_orport.c:674
Header for ext_orport.c.
void clear_pending_onions(void)
Definition: onion_queue.c:359
Header file for onion_queue.c.
Master header file for Tor-specific functionality.
void relay_metrics_init(void)
const smartlist_t * relay_metrics_get_stores(void)
void relay_metrics_free(void)
Header for feature/relay/relay_metrics.c.
Header for feature/relay/relay_periodic.c.
Header for feature/relay/relay_sys.c.
#define RELAY_SUBSYS_LEVEL
Definition: relay_sys.h:23
void router_free_all(void)
Definition: router.c:3597
Header file for router.c.
Header for routerkeys.c.
const char * name
Definition: subsys.h:43
Types used to declare a subsystem.
#define SUBSYS_DECLARE_LOCATION()
Definition: subsys.h:211