LCOV - code coverage report
Current view: top level - core/or - dos_sys.c (source / functions) Hit Total Coverage
Test: lcov.info Lines: 12 12 100.0 %
Date: 2021-11-24 03:28:48 Functions: 4 4 100.0 %

          Line data    Source code
       1             : /* Copyright (c) 2021-2021, The Tor Project, Inc. */
       2             : /* See LICENSE for licensing information */
       3             : 
       4             : /**
       5             :  * @file dos_sys.c
       6             :  * @brief Subsystem definitions for DOS module.
       7             :  **/
       8             : 
       9             : #include "core/or/or.h"
      10             : 
      11             : #include "lib/subsys/subsys.h"
      12             : 
      13             : #include "core/or/dos_config.h"
      14             : #include "core/or/dos_sys.h"
      15             : 
      16             : #include "core/or/dos_options_st.h"
      17             : 
      18             : static const dos_options_t *global_dos_options;
      19             : 
      20             : static int
      21         244 : subsys_dos_initialize(void)
      22             : {
      23         244 :   return 0;
      24             : }
      25             : 
      26             : static void
      27         235 : subsys_dos_shutdown(void)
      28             : {
      29         235 :   global_dos_options = NULL;
      30         235 : }
      31             : 
      32             : const dos_options_t *
      33         105 : dos_get_options(void)
      34             : {
      35         105 :   tor_assert(global_dos_options);
      36         105 :   return global_dos_options;
      37             : }
      38             : 
      39             : static int
      40         215 : dos_set_options(void *arg)
      41             : {
      42         215 :   dos_options_t *opts = arg;
      43         215 :   global_dos_options = opts;
      44         215 :   return 0;
      45             : }
      46             : 
      47             : const struct subsys_fns_t sys_dos = {
      48             :   SUBSYS_DECLARE_LOCATION(),
      49             : 
      50             :   .name = "dos",
      51             :   .supported = true,
      52             :   .level = DOS_SUBSYS_LEVEL,
      53             : 
      54             :   .initialize = subsys_dos_initialize,
      55             :   .shutdown = subsys_dos_shutdown,
      56             : 
      57             :   /* Configuration Options. */
      58             :   .options_format = &dos_options_fmt,
      59             :   .set_options = dos_set_options,
      60             : };

Generated by: LCOV version 1.14