1 /* Copyright (C) 2015 Wazuh Inc
\r
2 * All rights reserved.
\r
6 #ifndef __JSON_EXTENDED_H__
\r
7 #define __JSON_EXTENDED_H__
\r
9 #include "eventinfo.h"
\r
13 #define MAX_MATCHES 10
\r
15 // Main function, call the others parsers.
\r
16 void W_ParseJSON(cJSON *root, const Eventinfo *lf);
\r
18 void W_JSON_ParseHostname(cJSON *root, char *hostname);
\r
20 void W_JSON_ParseTimestamp(cJSON *root, const Eventinfo *lf);
\r
22 void W_JSON_ParseAgentIP(cJSON *root, const Eventinfo *lf);
\r
24 void W_JSON_ParseLocation(cJSON *root, const Eventinfo *lf, int archives);
\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
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