|
OpenDNSSEC-enforcer 2.1.13
|
#include "config.h"#include <pthread.h>#include "daemon/cfg.h"#include "daemon/enforcercommands.h"#include "clientpipe.h"#include "cmdhandler.h"#include "locks.h"#include "daemon/engine.h"#include "scheduler/schedule.h"#include "scheduler/task.h"#include "file.h"#include "log.h"#include "privdrop.h"#include "status.h"#include "util.h"#include "db/db_configuration.h"#include "db/db_connection.h"#include "db/database_version.h"#include "hsmkey/hsm_key_factory.h"#include "libhsm.h"#include <errno.h>#include <libxml/parser.h>#include <signal.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <strings.h>#include <sys/socket.h>#include <sys/types.h>#include <sys/un.h>#include <time.h>#include <unistd.h>#include <fcntl.h>Go to the source code of this file.
Functions | |
| engine_type * | engine_alloc (void) |
| void | engine_dealloc (engine_type *engine) |
| void | engine_start_workers (engine_type *engine) |
| void | engine_stop_workers (engine_type *engine) |
| void | engine_wakeup_workers (engine_type *engine) |
| db_connection_t * | get_database_connection (engine_type *engine) |
| ods_status | engine_setup () |
| void | engine_teardown (engine_type *engine) |
| void | engine_init (engine_type *engine, int daemonize) |
| int | engine_run (engine_type *engine, start_cb_t start, int single_run) |
| engine_type * engine_alloc | ( | void | ) |
Create engine.
Definition at line 79 of file engine.c.
References engine_struct::dbcfg_list, engine_struct::signal_cond, engine_struct::signal_lock, and engine_struct::taskq.
Referenced by main().
| void engine_dealloc | ( | engine_type * | engine | ) |
Definition at line 97 of file engine.c.
References db_configuration_list_free(), engine_struct::dbcfg_list, hsm_key_factory_deinit(), engine_struct::signal_cond, engine_struct::signal_lock, and engine_struct::taskq.
Referenced by main().
| void engine_init | ( | engine_type * | engine, |
| int | daemonize | ||
| ) |
Definition at line 612 of file engine.c.
References engine_struct::cmdhandler, engine_struct::config, engine_struct::daemonize, engine_struct::dbcfg_list, engine_struct::gid, engine_struct::init_setup_done, engine_struct::need_to_exit, engine_struct::need_to_reload, engine_struct::pid, engine_struct::uid, and engine_struct::workers.
Referenced by main().
| int engine_run | ( | engine_type * | engine, |
| start_cb_t | start, | ||
| int | single_run | ||
| ) |
Run engine, run!.
Definition at line 643 of file engine.c.
References engine_struct::cmdhandler, engine_start_workers(), engine_stop_workers(), engine_struct::need_to_exit, engine_struct::need_to_reload, engine_struct::signal_cond, engine_struct::signal_lock, and engine_struct::taskq.
Referenced by main().
| ods_status engine_setup | ( | void | ) |
Set up engine and return the setup status.
Definition at line 432 of file engine.c.
References engineconfig_struct::clisock_filename, engine_struct::cmdhandler, engine_struct::config, engine_struct::daemonize, db_connection_free(), enforcercommands, get_database_connection(), engine_struct::gid, engineconfig_struct::group, engine_struct::init_setup_done, engineconfig_struct::log_filename, engine_struct::need_to_reload, engine_struct::pid, engineconfig_struct::pid_filename, engineconfig_struct::repositories, engine_struct::uid, engineconfig_struct::use_syslog, engineconfig_struct::username, and engineconfig_struct::working_dir.
Referenced by main().
| void engine_start_workers | ( | engine_type * | engine | ) |
start all workers.
| [in] | engine | engine |
Definition at line 174 of file engine.c.
References engine_struct::config, get_database_connection(), engineconfig_struct::num_worker_threads, and engine_struct::workers.
Referenced by engine_run().
| void engine_stop_workers | ( | engine_type * | engine | ) |
signal all workers to stop. Blocks until all workers are joined.
| [in] | engine | engine |
Definition at line 193 of file engine.c.
References engine_struct::config, db_connection_free(), engine_wakeup_workers(), engineconfig_struct::num_worker_threads, and engine_struct::workers.
Referenced by engine_run().
| void engine_teardown | ( | engine_type * | engine | ) |
Clean up engine.
Definition at line 584 of file engine.c.
References engineconfig_struct::clisock_filename, engine_struct::cmdhandler, engine_struct::config, engineconfig_struct::num_worker_threads, engineconfig_struct::pid_filename, and engine_struct::workers.
Referenced by main().
| void engine_wakeup_workers | ( | engine_type * | engine | ) |
Wake up all workers.
Definition at line 218 of file engine.c.
References engine_struct::taskq.
Referenced by engine_stop_workers().
| db_connection_t * get_database_connection | ( | engine_type * | engine | ) |
Try to open a connection to the database.
| engine,the | engine containing database configuration |
Definition at line 226 of file engine.c.
References db_connection_connect(), db_connection_free(), db_connection_new(), db_connection_set_configuration_list(), db_connection_setup(), and engine_struct::dbcfg_list.
Referenced by autostart(), engine_setup(), and engine_start_workers().