diff options
author | Nick Mathewson <nickm@torproject.org> | 2019-05-01 15:36:18 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2019-05-06 16:25:09 -0400 |
commit | b394b5b2af7f38a5e66c9875d3a55be5af840933 (patch) | |
tree | 766acfa070d5d8af409e458bcb561189473e022a /src/feature/relay/relay_sys.c | |
parent | 2aa441b88e089c9aa650f25dd1b109bf14bc451d (diff) | |
download | tor-b394b5b2af7f38a5e66c9875d3a55be5af840933.tar.gz tor-b394b5b2af7f38a5e66c9875d3a55be5af840933.zip |
Create a relay subsystem and move the shutdown functions there
Diffstat (limited to 'src/feature/relay/relay_sys.c')
-rw-r--r-- | src/feature/relay/relay_sys.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/feature/relay/relay_sys.c b/src/feature/relay/relay_sys.c new file mode 100644 index 0000000000..4fdd3d3584 --- /dev/null +++ b/src/feature/relay/relay_sys.c @@ -0,0 +1,46 @@ +/* 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 */ + +/** + * @file relay_sys.c + * @brief Subsystem definitions for the relay module. + **/ + +#include "orconfig.h" +#include "core/or/or.h" + +#include "feature/relay/dns.h" +#include "feature/relay/ext_orport.h" +#include "feature/relay/onion_queue.h" +#include "feature/relay/relay_sys.h" +#include "feature/relay/routerkeys.h" +#include "feature/relay/router.h" + +#include "lib/subsys/subsys.h" + +static int +subsys_relay_initialize(void) +{ + return 0; +} + +static void +subsys_relay_shutdown(void) +{ + dns_free_all(); + ext_orport_free_all(); + clear_pending_onions(); + routerkeys_free_all(); + router_free_all(); +} + +const struct subsys_fns_t sys_relay = { + .name = "relay", + .supported = true, + .level = 50, + .initialize = subsys_relay_initialize, + .shutdown = subsys_relay_shutdown, +}; |