Imported Upstream version 2.7
[ossec-hids.git] / src / os_csyslogd / config.c
1 /* @(#) $Id: ./src/os_csyslogd/config.c, 2011/09/08 dcid Exp $
2  */
3
4 /* Copyright (C) 2009 Trend Micro Inc.
5  * All rights reserved.
6  *
7  * This program is a free software; you can redistribute it
8  * and/or modify it under the terms of the GNU General Public
9  * License (version 2) as published by the FSF - Free Software
10  * Foundation.
11  *
12  * License details at the LICENSE file included with OSSEC or
13  * online at: http://www.ossec.net/en/licensing.html
14  */
15
16
17 #include "csyslogd.h"
18 #include "config/global-config.h"
19 #include "config/config.h"
20
21
22 /** void *OS_SyslogConf(int test_config, char *cfgfile,
23                         SyslogConfig **syslog_config)
24  * Reads configuration.
25  */
26 void *OS_ReadSyslogConf(int test_config, char *cfgfile,
27                         SyslogConfig **syslog_config)
28 {
29     int modules = 0;
30     GeneralConfig gen_config;
31
32
33     /* Modules for the configuration */
34     modules|= CSYSLOGD;
35     gen_config.data = syslog_config;
36
37
38     /* Reading configuration */
39     if(ReadConfig(modules, cfgfile, &gen_config, NULL) < 0)
40     {
41         ErrorExit(CONFIG_ERROR, ARGV0, cfgfile);
42         return(NULL);
43     }
44
45
46     syslog_config = gen_config.data;
47
48     return(syslog_config);
49 }
50
51 /* EOF */