diff options
author | David Goulet <dgoulet@torproject.org> | 2020-10-20 12:48:54 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2020-10-27 10:43:42 -0400 |
commit | 50f44afeb4e2222518b64f022ca74f3fa31f8819 (patch) | |
tree | 25d321a2f876d760798323fa09fdf15fde0eaa22 /src/feature/hs/hs_sys.c | |
parent | 4f5cea1f592d9e9e6c69fc0e772dd46a0fa43799 (diff) | |
download | tor-50f44afeb4e2222518b64f022ca74f3fa31f8819.tar.gz tor-50f44afeb4e2222518b64f022ca74f3fa31f8819.zip |
hs: New metrics module
At this commit, a new service registers to the module and a store is created.
It also remove itself from the metrics module if it goes away.
In order to hook into the metrics subsystem, this commit attaches the HS
subsystem into the subsystem global list so its get_metrics() call can be
accessible.
HS initialization is still _not_ done through the subsys module as it is
likely require much more testing.
Related to #40063
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/feature/hs/hs_sys.c')
-rw-r--r-- | src/feature/hs/hs_sys.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/feature/hs/hs_sys.c b/src/feature/hs/hs_sys.c new file mode 100644 index 0000000000..6524dc3e4e --- /dev/null +++ b/src/feature/hs/hs_sys.c @@ -0,0 +1,36 @@ +/* Copyright (c) 2020, The Tor Project, Inc. */ +/* See LICENSE for licensing information */ + +/** + * @file hs_sys.c + * @brief Setup and tear down the HS subsystem. + **/ + +#include "lib/subsys/subsys.h" + +#include "feature/hs/hs_metrics.h" +#include "feature/hs/hs_sys.h" + +static int +subsys_hs_initialize(void) +{ + return 0; +} + +static void +subsys_hs_shutdown(void) +{ +} + +const subsys_fns_t sys_hs = { + SUBSYS_DECLARE_LOCATION(), + + .name = "hs", + .supported = true, + .level = HS_SUBSYS_LEVEL, + + .initialize = subsys_hs_initialize, + .shutdown = subsys_hs_shutdown, + + .get_metrics = hs_metrics_get_stores, +}; |