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