change type of rule_id, object_id, item_id from (long long) to (uuid_t)
just compile libmaatframe.so, without modifing about test case
This commit is contained in:
@@ -144,10 +144,12 @@ static int expr_rule_pattern_count(struct expr_rule *rules, size_t n_rule,
|
||||
|
||||
for (size_t i = 0; i < n_rule; i++) {
|
||||
if (rules[i].n_patterns > MAX_EXPR_PATTERN_NUM) {
|
||||
char uuid_str[37];
|
||||
uuid_unparse(rules[i].expr_uuid, uuid_str);
|
||||
log_fatal(logger, MODULE_EXPR_MATCHER,
|
||||
"[%s:%d] the number of patterns in expr_rule(rule_id:%lld)"
|
||||
"[%s:%d] the number of patterns in expr_rule(rule_id:%s)"
|
||||
" should less than %d", __FUNCTION__, __LINE__,
|
||||
rules[i].expr_id, MAX_EXPR_PATTERN_NUM);
|
||||
uuid_str, MAX_EXPR_PATTERN_NUM);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -224,7 +226,7 @@ static struct bool_expr *bool_exprs_new(struct expr_rule *rules, size_t n_rule,
|
||||
bool_exprs[i].items[j].negate_option = 0;
|
||||
}
|
||||
|
||||
bool_exprs[i].expr_id = rules[i].expr_id;
|
||||
uuid_copy(bool_exprs[i].expr_uuid, rules[i].expr_uuid);
|
||||
bool_exprs[i].item_num = rules[i].n_patterns;
|
||||
bool_exprs[i].user_tag = rules[i].tag;
|
||||
}
|
||||
@@ -432,7 +434,7 @@ static int expr_matcher_bool_matcher_match(struct bool_matcher *bm, struct bool_
|
||||
}
|
||||
|
||||
for (int index = 0; index < bool_matcher_ret; index++) {
|
||||
result_array[index].rule_id = match_buff[index].expr_id;
|
||||
uuid_copy(result_array[index].rule_uuid, match_buff[index].expr_uuid);
|
||||
result_array[index].user_tag = match_buff[index].user_tag;
|
||||
}
|
||||
*n_hit_result = bool_matcher_ret;
|
||||
|
||||
@@ -17,6 +17,7 @@ extern "C"
|
||||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
#include <uuid/uuid.h>
|
||||
|
||||
#include "log/log.h"
|
||||
|
||||
@@ -65,13 +66,13 @@ struct expr_pattern {
|
||||
};
|
||||
|
||||
struct expr_scan_result {
|
||||
long long rule_id;
|
||||
uuid_t rule_uuid;
|
||||
void *user_tag;
|
||||
};
|
||||
|
||||
/* logic AND expression, such as (rule1 & rule2) */
|
||||
struct expr_rule {
|
||||
long long expr_id; /* AND expression ID */
|
||||
uuid_t expr_uuid; /* AND expression ID */
|
||||
size_t n_patterns;
|
||||
struct expr_pattern patterns[MAX_EXPR_PATTERN_NUM];
|
||||
void *tag; /* user defined data, return with hit result */
|
||||
|
||||
Reference in New Issue
Block a user