46 static const char* conf_str =
"config";
55 int cmdline_verbosity)
58 const char* rngfile = ODS_SE_RNGDIR
"/conf.rng";
61 if (!allocator || !cfgfile) {
66 ods_log_error(
"[%s] unable to create config: parse error in %s",
78 ods_log_error(
"[%s] unable to create config: allocator_alloc() "
101 if (cmdline_verbosity > 0) {
112 ods_log_error(
"[%s] unable to create config: failed to open file %s",
126 ods_log_error(
"[%s] config-check failed: no config", conf_str);
130 ods_log_error(
"[%s] config-check failed: no config filename",
135 ods_log_error(
"[%s] config-check failed: no zonelist filename",
140 ods_log_error(
"[%s] config-check failed: no socket filename",
164 fprintf(out,
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
166 fprintf(out,
"<Configuration>\n");
169 fprintf(out,
"\t<Common>\n");
171 fprintf(out,
"\t\t<Logging>\n");
172 fprintf(out,
"\t\t\t<Syslog>\n");
173 fprintf(out,
"\t\t\t\t<Facility>%s</Facility>\n",
175 fprintf(out,
"\t\t\t</Syslog>\n");
176 fprintf(out,
"\t\t</Logging>\n");
178 fprintf(out,
"\t\t<Logging>\n");
179 fprintf(out,
"\t\t\t<File>\n");
180 fprintf(out,
"\t\t\t\t<Filename>%s</Filename>\n",
182 fprintf(out,
"\t\t\t</File>\n");
183 fprintf(out,
"\t\t</Logging>\n");
185 fprintf(out,
"\t\t<ZoneListFile>%s</ZoneListFile>\n",
187 fprintf(out,
"\t</Common>\n");
190 fprintf(out,
"\t<Signer>\n");
192 fprintf(out,
"\t\t<Privileges>\n");
194 fprintf(out,
"\t\t<User>%s</User>\n", config->
username);
197 fprintf(out,
"\t\t<Group>%s</Group>\n", config->
group);
200 fprintf(out,
"\t\t<Directory>%s</Directory>\n",
203 fprintf(out,
"\t\t</Privileges>\n");
207 fprintf(out,
"\t\t<Listener>\n");
210 fprintf(out,
"\t\t\t<Interface>");
212 fprintf(out,
"<Address>%s</Address>",
216 fprintf(out,
"<Port>%s</Port>",
219 fprintf(out,
"<Interface>\n");
221 fprintf(out,
"\t\t</Listener>\n");
225 fprintf(out,
"\t\t<WorkingDirectory>%s</WorkingDirectory>\n",
227 fprintf(out,
"\t\t<WorkerThreads>%i</WorkerThreads>\n",
229 fprintf(out,
"\t\t<SignerThreads>%i</SignerThreads>\n",
232 fprintf(out,
"\t\t<NotifyCommand>%s</NotifyCommand>\n",
235 fprintf(out,
"\t</Signer>\n");
237 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