new upstream release (3.3.0); modify package compatibility for Stretch
[ossec-hids.git] / src / analysisd / format / json_extended.h
1 /* Copyright (C) 2015 Wazuh Inc\r
2  * All rights reserved.\r
3  * \r
4  */\r
5  \r
6 #ifndef __JSON_EXTENDED_H__\r
7 #define __JSON_EXTENDED_H__\r
8 \r
9 #include "eventinfo.h"\r
10 #include "cJSON.h"\r
11 #include <regex.h>\r
12 \r
13 #define MAX_MATCHES 10\r
14 \r
15 // Main function, call the others parsers.\r
16 void W_ParseJSON(cJSON *root, const Eventinfo *lf);\r
17 // Parse hostname\r
18 void W_JSON_ParseHostname(cJSON *root, char *hostname);\r
19 // Parse Timestamp\r
20 void W_JSON_ParseTimestamp(cJSON *root, const Eventinfo *lf);\r
21 // Parse AgentIP\r
22 void W_JSON_ParseAgentIP(cJSON *root, const Eventinfo *lf);\r
23 // Parse Location\r
24 void W_JSON_ParseLocation(cJSON *root, const Eventinfo *lf, int archives);\r
25 // Parse Groups\r
26 void W_JSON_ParseGroups(cJSON *root, const Eventinfo *lf, int nested);\r
27 // Parse Groups Compliance \r
28 void W_JSON_ParseGroupsCompliance(cJSON *root, int nested);\r
29 // Parse Rootcheck compliance\r
30 void W_JSON_ParseRootcheck(cJSON *root, const Eventinfo *lf, int nested);\r
31 // Detecting if an alert comes from rootcheck\r
32 int W_isRootcheck(cJSON *root, int nested);\r
33 // Parsing PCI Compliance groups^M\r
34 int add_groupPCI(cJSON *rule, char * group, int firstPCI);\r
35 // Parsing CIS Compliance groups^M\r
36 int add_groupCIS(cJSON *rule, char * group, int firstCIS);\r
37 // Aux functions\r
38 int str_cut(char *str, int begin, int len);\r
39 int compile_regex (regex_t * r, const char * regex_text);\r
40 int match_regex (regex_t * r, const char * to_match, char * results[MAX_MATCHES]);\r
41 void trim(char * s);\r
42 void removeChar( char * string, char letter );\r
43 int startsWith(const char *pre, const char *str);\r
44 \r
45 #endif\r