44 static const char* conf_str =
"config";
53 int cmdline_verbosity)
56 const char* rngfile = ODS_SE_RNGDIR
"/conf.rng";
59 if (!allocator || !cfgfile) {
64 ods_log_error(
"[%s] unable to create config: parse error in %s",
76 ods_log_error(
"[%s] unable to create config: allocator_alloc() " 99 if (cmdline_verbosity > 0) {
110 ods_log_error(
"[%s] unable to create config: failed to open file %s",
124 ods_log_error(
"[%s] config-check failed: no config", conf_str);
128 ods_log_error(
"[%s] config-check failed: no config filename",
133 ods_log_error(
"[%s] config-check failed: no zonelist filename",
138 ods_log_error(
"[%s] config-check failed: no socket filename",
162 fprintf(out,
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
164 fprintf(out,
"<Configuration>\n");
167 fprintf(out,
"\t<Common>\n");
169 fprintf(out,
"\t\t<Logging>\n");
170 fprintf(out,
"\t\t\t<Syslog>\n");
171 fprintf(out,
"\t\t\t\t<Facility>%s</Facility>\n",
173 fprintf(out,
"\t\t\t</Syslog>\n");
174 fprintf(out,
"\t\t</Logging>\n");
176 fprintf(out,
"\t\t<Logging>\n");
177 fprintf(out,
"\t\t\t<File>\n");
178 fprintf(out,
"\t\t\t\t<Filename>%s</Filename>\n",
180 fprintf(out,
"\t\t\t</File>\n");
181 fprintf(out,
"\t\t</Logging>\n");
183 fprintf(out,
"\t\t<ZoneListFile>%s</ZoneListFile>\n",
185 fprintf(out,
"\t</Common>\n");
188 fprintf(out,
"\t<Signer>\n");
190 fprintf(out,
"\t\t<Privileges>\n");
192 fprintf(out,
"\t\t<User>%s</User>\n", config->
username);
195 fprintf(out,
"\t\t<Group>%s</Group>\n", config->
group);
198 fprintf(out,
"\t\t<Directory>%s</Directory>\n",
201 fprintf(out,
"\t\t</Privileges>\n");
205 fprintf(out,
"\t\t<Listener>\n");
208 fprintf(out,
"\t\t\t<Interface>");
210 fprintf(out,
"<Address>%s</Address>",
214 fprintf(out,
"<Port>%s</Port>",
217 fprintf(out,
"<Interface>\n");
219 fprintf(out,
"\t\t</Listener>\n");
223 fprintf(out,
"\t\t<WorkingDirectory>%s</WorkingDirectory>\n",
225 fprintf(out,
"\t\t<WorkerThreads>%i</WorkerThreads>\n",
227 fprintf(out,
"\t\t<SignerThreads>%i</SignerThreads>\n",
230 fprintf(out,
"\t\t<NotifyCommand>%s</NotifyCommand>\n",
233 fprintf(out,
"\t</Signer>\n");
235 fprintf(out,
"</Configuration>\n");
void engine_config_cleanup(engineconfig_type *config)
void engine_config_print(FILE *out, engineconfig_type *config)
int parse_conf_worker_threads(const char *cfgfile)
void listener_cleanup(listener_type *listener)
const char * cfg_filename
void * allocator_alloc(allocator_type *allocator, size_t size)
const char * zonelist_filename
int parse_conf_use_syslog(const char *cfgfile)
const char * parse_conf_zonelist_filename(allocator_type *allocator, const char *cfgfile)
enum ods_enum_status ods_status
ods_status parse_file_check(const char *cfgfile, const char *rngfile)
const char * parse_conf_log_filename(allocator_type *allocator, const char *cfgfile)
void ods_log_error(const char *format,...)
FILE * ods_fopen(const char *file, const char *dir, const char *mode)
listener_type * parse_conf_listener(allocator_type *allocator, const char *cfgfile)
allocator_type * allocator
const char * log_filename
const char * clisock_filename
engineconfig_type * engine_config(allocator_type *allocator, const char *cfgfile, int cmdline_verbosity)
const char * parse_conf_group(allocator_type *allocator, const char *cfgfile)
int parse_conf_signer_threads(const char *cfgfile)
const char * parse_conf_chroot(allocator_type *allocator, const char *cfgfile)
const char * notify_command
const char * parse_conf_clisock_filename(allocator_type *allocator, const char *cfgfile)
char * allocator_strdup(allocator_type *allocator, const char *string)
void ods_log_verbose(const char *format,...)
ods_status engine_config_check(engineconfig_type *config)
void ods_fclose(FILE *fd)
const char * parse_conf_notify_command(allocator_type *allocator, const char *cfgfile)
listener_type * interfaces
interface_type * interfaces
const char * parse_conf_working_dir(allocator_type *allocator, const char *cfgfile)
int parse_conf_verbosity(const char *cfgfile)
void allocator_deallocate(allocator_type *allocator, void *data)
const char * parse_conf_username(allocator_type *allocator, const char *cfgfile)
const char * parse_conf_pid_filename(allocator_type *allocator, const char *cfgfile)
const char * pid_filename