novi upstream verzije 2.8.3
[ossec-hids.git] / src / analysisd / config.c
1 /* @(#) $Id: ./src/analysisd/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 /* Functions to handle the configuration files
18  */
19
20
21 #include "shared.h"
22
23 #include "os_xml/os_xml.h"
24 #include "os_regex/os_regex.h"
25
26 #include "analysisd.h"
27 #include "config.h"
28
29
30 /* GlobalConf vv0.2: 2005/03/03
31  * v0.2: Changing to support the new OS_XML
32  */
33 int GlobalConf(char * cfgfile)
34 {
35     int modules = 0;
36
37
38     /* Default values */
39     Config.logall = 0;
40     Config.stats = 4;
41     Config.integrity = 8;
42     Config.rootcheck = 8;
43     Config.hostinfo = 8;
44     Config.picviz = 0;
45     Config.prelude = 0;
46     Config.zeromq_output = 0;
47     Config.zeromq_output_uri = NULL; 
48     Config.memorysize = 1024;
49     Config.mailnotify = -1;
50     Config.keeplogdate = 0;
51     Config.syscheck_alert_new = 0;
52     Config.syscheck_auto_ignore = 1;
53     Config.ar = 0;
54
55     Config.syscheck_ignore = NULL;
56     Config.white_list = NULL;
57     Config.hostname_white_list = NULL;
58
59     /* Default actions -- only log above level 1 */
60     Config.mailbylevel = 7;
61     Config.logbylevel  = 1;
62
63     Config.custom_alert_output =0;
64     Config.custom_alert_output_format = NULL;
65
66     Config.includes = NULL;
67     Config.lists = NULL;
68     Config.decoders = NULL;
69
70     modules|= CGLOBAL;
71     modules|= CRULES;
72     modules|= CALERTS;
73
74
75     /* Reading config */
76     if(ReadConfig(modules, cfgfile, &Config, NULL)< 0)
77     {
78         return(OS_INVALID);
79     }
80
81     /* Minimum memory size */
82     if(Config.memorysize < 64)
83         Config.memorysize = 64;
84
85
86     return(0);
87 }
88
89
90
91 /* EOF */