cfg.h
Go to the documentation of this file.
/*
* Copyright (c) 2009 NLNet Labs. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef DAEMON_CONFIG_H
#define DAEMON_CONFIG_H
#include "config.h"
#include "status.h"
#include <stdio.h>
#include <time.h>
#include "libhsm.h"
typedef enum {
ENFORCER_DATABASE_TYPE_NONE,
ENFORCER_DATABASE_TYPE_SQLITE,
ENFORCER_DATABASE_TYPE_MYSQL
} engineconfig_database_type_t;
typedef struct engineconfig_struct engineconfig_type;
struct engineconfig_struct {
const char* cfg_filename;
const char* policy_filename;
const char* zonelist_filename;
const char* zonefetch_filename;
const char* log_filename;
const char* pid_filename;
const char* delegation_signer_submit_command;
const char* delegation_signer_retract_command;
const char* clisock_filename;
const char* working_dir;
const char* username;
const char* group;
const char* chroot;
const char* datastore; /* Datastore/SQLite or Datastore/MySQL/Database */
const char* db_host; /* Datastore/MySQL/Host */
const char* db_username; /* Datastore/MySQL/Username */
const char* db_password; /* Datastore/MySQL/Password */
int use_syslog;
int num_worker_threads;
int manual_keygen;
int verbosity;
int db_port; /* Datastore/MySQL/Host/@Port */
time_t automatic_keygen_duration;
time_t rollover_notification;
hsm_repository_t* repositories;
engineconfig_database_type_t db_type;
};
engineconfig_type* engine_config(const char* cfgfile,
int cmdline_verbosity, engineconfig_type* oldcfg);
ods_status engine_config_check(engineconfig_type* config);
void engine_config_print(FILE* out, engineconfig_type* config);
void engine_config_cleanup(engineconfig_type* config);
#endif /* DAEMON_CONFIG_H */
engineconfig_struct::delegation_signer_submit_command
const char * delegation_signer_submit_command
Definition: cfg.h:61
engineconfig_struct::cfg_filename
const char * cfg_filename
Definition: cfg.h:55
engineconfig_struct::datastore
const char * datastore
Definition: cfg.h:68
engineconfig_struct::zonelist_filename
const char * zonelist_filename
Definition: cfg.h:57
engineconfig_struct::policy_filename
const char * policy_filename
Definition: cfg.h:56
engineconfig_struct::db_host
const char * db_host
Definition: cfg.h:69
engineconfig_struct::rollover_notification
time_t rollover_notification
Definition: cfg.h:78
engineconfig_struct
Definition: cfg.h:54
engineconfig_struct::automatic_keygen_duration
time_t automatic_keygen_duration
Definition: cfg.h:77
engineconfig_struct::group
const char * group
Definition: cfg.h:66
engine_config_cleanup
void engine_config_cleanup(engineconfig_type *config)
Definition: cfg.c:278
engineconfig_struct::db_port
int db_port
Definition: cfg.h:76
engine_config_check
ods_status engine_config_check(engineconfig_type *config)
Definition: cfg.c:155
engineconfig_struct::delegation_signer_retract_command
const char * delegation_signer_retract_command
Definition: cfg.h:62
engineconfig_struct::db_password
const char * db_password
Definition: cfg.h:71
engineconfig_struct::log_filename
const char * log_filename
Definition: cfg.h:59
engineconfig_struct::clisock_filename
const char * clisock_filename
Definition: cfg.h:63
engineconfig_struct::num_worker_threads
int num_worker_threads
Definition: cfg.h:73
engineconfig_struct::repositories
hsm_repository_t * repositories
Definition: cfg.h:79
engineconfig_struct::zonefetch_filename
const char * zonefetch_filename
Definition: cfg.h:58
engineconfig_struct::db_username
const char * db_username
Definition: cfg.h:70
engineconfig_database_type_t
engineconfig_database_type_t
Definition: cfg.h:43
ENFORCER_DATABASE_TYPE_SQLITE
Definition: cfg.h:45
engineconfig_struct::manual_keygen
int manual_keygen
Definition: cfg.h:74
engineconfig_struct::working_dir
const char * working_dir
Definition: cfg.h:64
engineconfig_struct::use_syslog
int use_syslog
Definition: cfg.h:72
ENFORCER_DATABASE_TYPE_MYSQL
Definition: cfg.h:46
engineconfig_struct::username
const char * username
Definition: cfg.h:65
ENFORCER_DATABASE_TYPE_NONE
Definition: cfg.h:44
engine_config_print
void engine_config_print(FILE *out, engineconfig_type *config)
Definition: cfg.c:189
engineconfig_struct::verbosity
int verbosity
Definition: cfg.h:75
engineconfig_struct::db_type
engineconfig_database_type_t db_type
Definition: cfg.h:80
engine_config
engineconfig_type * engine_config(const char *cfgfile, int cmdline_verbosity, engineconfig_type *oldcfg)
Definition: cfg.c:59
engineconfig_struct::pid_filename
const char * pid_filename
Definition: cfg.h:60
engineconfig_struct::chroot
const char * chroot
Definition: cfg.h:67