Tor  0.4.6.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-2020, 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"
21 #include "feature/relay/router.h"
22 
23 #include "lib/subsys/subsys.h"
24 
25 static int
26 subsys_relay_initialize(void)
27 {
28  relay_register_periodic_events();
29  return 0;
30 }
31 
32 static void
33 subsys_relay_shutdown(void)
34 {
35  dns_free_all();
38  routerkeys_free_all();
40 }
41 
42 const struct subsys_fns_t sys_relay = {
43  .name = "relay",
45  .supported = true,
46  .level = RELAY_SUBSYS_LEVEL,
47  .initialize = subsys_relay_initialize,
48  .shutdown = subsys_relay_shutdown,
49 };
SUBSYS_DECLARE_LOCATION
#define SUBSYS_DECLARE_LOCATION()
Definition: subsys.h:211
routerkeys.h
Header for routerkeys.c.
router.h
Header file for router.c.
onion_queue.h
Header file for onion_queue.c.
RELAY_SUBSYS_LEVEL
#define RELAY_SUBSYS_LEVEL
Definition: relay_sys.h:23
subsys.h
Types used to declare a subsystem.
dns_free_all
void dns_free_all(void)
Definition: dns.c:384
clear_pending_onions
void clear_pending_onions(void)
Definition: onion_queue.c:353
subsys_fns_t::name
const char * name
Definition: subsys.h:43
ext_orport_free_all
void ext_orport_free_all(void)
Definition: ext_orport.c:732
relay_sys.h
Header for feature/relay/relay_sys.c.
ext_orport.h
Header for ext_orport.c.
relay_periodic.h
Header for feature/relay/relay_periodic.c.
router_free_all
void router_free_all(void)
Definition: router.c:3546
dns.h
Header file for dns.c.
subsys_fns_t
Definition: subsys.h:38
or.h
Master header file for Tor-specific functionality.