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