Imported Upstream version 2.5.1
[ossec-hids.git] / src / logcollector / config.c
1 /* @(#) $Id$ */
2
3 /* Copyright (C) 2009 Trend Micro Inc.
4  * All right 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
12 /* v0.3 (2005/08/23): Using the new OS_XML syntax and changing some usage 
13  * v0.2 (2005/01/17)
14  */
15  
16
17 #include "shared.h" 
18
19 #include "logcollector.h"
20
21
22 /* LogCollectorConfig v0.3, 2005/03/03
23  * Read the config file (the localfiles)
24  * v0.3: Changed for the new OS_XML
25  */
26 int LogCollectorConfig(char * cfgfile)
27 {
28     int modules = 0;
29
30     logreader_config log_config;
31
32     modules|= CLOCALFILE;
33
34     log_config.config = NULL;
35
36     if(ReadConfig(modules, cfgfile, &log_config, NULL) < 0)
37         return(OS_INVALID);
38     
39     #ifdef CLIENT
40     modules|= CAGENT_CONFIG;
41     ReadConfig(modules, AGENTCONFIG, &log_config, NULL);
42     #endif
43
44     logff = log_config.config;       
45
46     return(1);
47
48
49 }
50
51 /* EOF */