Tor  0.4.7.0-alpha-dev
Functions | Variables
subsysmgr.h File Reference

Header for subsysmgr.c. More...

#include "lib/subsys/subsys.h"

Go to the source code of this file.

Functions

int subsystems_init (void)
 
int subsystems_init_upto (int level)
 
int subsystems_add_pubsub_upto (struct pubsub_builder_t *builder, int target_level)
 
int subsystems_add_pubsub (struct pubsub_builder_t *builder)
 
void subsystems_shutdown (void)
 
void subsystems_shutdown_downto (int level)
 
void subsystems_prefork (void)
 
void subsystems_postfork (void)
 
void subsystems_thread_cleanup (void)
 
void subsystems_dump_list (void)
 
int subsystems_register_options_formats (struct config_mgr_t *mgr)
 
int subsystems_register_state_formats (struct config_mgr_t *mgr)
 
int subsystems_set_options (const struct config_mgr_t *mgr, struct or_options_t *options)
 
int subsystems_set_state (const struct config_mgr_t *mgr, struct or_state_t *state)
 
int subsystems_flush_state (const struct config_mgr_t *mgr, struct or_state_t *state)
 

Variables

const struct subsys_fns_ttor_subsystems []
 
const unsigned n_tor_subsystems
 

Detailed Description

Header for subsysmgr.c.

Definition in file subsysmgr.h.

Function Documentation

◆ subsystems_add_pubsub()

int subsystems_add_pubsub ( pubsub_builder_t builder)

Add publish/subscribe relationships to builder for all initialized subsystems.

Definition at line 195 of file subsysmgr.c.

Referenced by pubsub_install().

◆ subsystems_add_pubsub_upto()

int subsystems_add_pubsub_upto ( pubsub_builder_t builder,
int  target_level 
)

Add publish/subscribe relationships to builder for all initialized subsystems of level no more than target_level.

Definition at line 160 of file subsysmgr.c.

Referenced by subsystems_add_pubsub().

◆ subsystems_dump_list()

void subsystems_dump_list ( void  )

Dump a human- and machine-readable list of all the subsystems to stdout, in their initialization order, prefixed with their level.

Definition at line 301 of file subsysmgr.c.

Referenced by options_init_from_torrc().

◆ subsystems_init()

int subsystems_init ( void  )

Initialize all the subsystems; exit on failure.

Definition at line 114 of file subsysmgr.c.

Referenced by tor_run_main().

◆ subsystems_init_upto()

int subsystems_init_upto ( int  target_level)

Initialize all the subsystems whose level is less than or equal to target_level; exit on failure.

Definition at line 124 of file subsysmgr.c.

Referenced by subsystems_init().

◆ subsystems_postfork()

void subsystems_postfork ( void  )

Run post-fork code on all subsystems that declare any

Definition at line 258 of file subsysmgr.c.

Referenced by options_act_once_on_startup().

◆ subsystems_prefork()

void subsystems_prefork ( void  )

Run pre-fork code on all subsystems that declare any

Definition at line 237 of file subsysmgr.c.

Referenced by options_act_once_on_startup().

◆ subsystems_register_options_formats()

int subsystems_register_options_formats ( config_mgr_t mgr)

Register all subsystem-declared options formats in mgr.

Return 0 on success, -1 on failure.

Definition at line 316 of file subsysmgr.c.

◆ subsystems_register_state_formats()

int subsystems_register_state_formats ( config_mgr_t mgr)

Register all subsystem-declared state formats in mgr.

Return 0 on success, -1 on failure.

Definition at line 339 of file subsysmgr.c.

◆ subsystems_shutdown()

void subsystems_shutdown ( void  )

Shut down all the subsystems.

Definition at line 204 of file subsysmgr.c.

◆ subsystems_shutdown_downto()

void subsystems_shutdown_downto ( int  target_level)

Shut down all the subsystems whose level is above target_level.

Definition at line 213 of file subsysmgr.c.

Referenced by subsystems_shutdown().

◆ subsystems_thread_cleanup()

void subsystems_thread_cleanup ( void  )

Run thread-cleanup code on all subsystems that declare any

Definition at line 279 of file subsysmgr.c.

Variable Documentation

◆ tor_subsystems

const struct subsys_fns_t* tor_subsystems[]
extern

Global list of the subsystems in Tor, in the order of their initialization. Want to know the exact level numbers? We'll implement a level dump command in #31614.

Definition at line 46 of file subsystem_list.c.