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