new upstream release (3.3.0); modify package compatibility for Stretch
[ossec-hids.git] / src / os_csyslogd / config.c
1 /* Copyright (C) 2009 Trend Micro Inc.
2  * All rights reserved.
3  *
4  * This program is a free software; you can redistribute it
5  * and/or modify it under the terms of the GNU General Public
6  * License (version 2) as published by the FSF - Free Software
7  * Foundation.
8  */
9
10 #include "csyslogd.h"
11 #include "config/global-config.h"
12 #include "config/config.h"
13
14
15 /* Read configuration */
16 SyslogConfig **OS_ReadSyslogConf(__attribute__((unused)) int test_config, const char *cfgfile)
17 {
18     int modules = 0;
19     struct SyslogConfig_holder config;
20     SyslogConfig **syslog_config = NULL;
21
22     /* Modules for the configuration */
23     modules |= CSYSLOGD;
24     config.data = syslog_config;
25
26     /* Read configuration */
27     if (ReadConfig(modules, cfgfile, &config, NULL) < 0) {
28         ErrorExit(CONFIG_ERROR, ARGV0, cfgfile);
29         return (NULL);
30     }
31
32     syslog_config = config.data;
33
34     return (syslog_config);
35 }
36