1、更新SFH和GIE;2、支持相似性字符串匹配;
This commit is contained in:
@@ -99,6 +99,7 @@ int set_iris_descriptor(const char* json_file,cJSON *json,const char*compile_tn,
|
||||
map_register(iris_cfg->str2int_map, "expr_plus",TABLE_TYPE_EXPR_PLUS);
|
||||
map_register(iris_cfg->str2int_map, "intval",TABLE_TYPE_INTERVAL);
|
||||
map_register(iris_cfg->str2int_map, "digest",TABLE_TYPE_DIGEST);
|
||||
map_register(iris_cfg->str2int_map, "similar",TABLE_TYPE_SIMILARITY);
|
||||
|
||||
|
||||
map_register(iris_cfg->str2int_map, "ipv4",4);
|
||||
@@ -460,6 +461,35 @@ int write_digest_rule(cJSON *region_json,struct iris_description_t *p_iris,const
|
||||
|
||||
return direct_write_rule(region_json, p_iris->str2int_map,json_cmd, cmd_cnt,path,logger);
|
||||
|
||||
}
|
||||
int write_similar_rule(cJSON *region_json,struct iris_description_t *p_iris,const char* path,void * logger)
|
||||
{
|
||||
struct traslate_command_t json_cmd[MAX_COLUMN_NUM];
|
||||
int cmd_cnt=0;
|
||||
memset(json_cmd,0,sizeof(json_cmd));
|
||||
|
||||
json_cmd[cmd_cnt].json_string="region_id";
|
||||
json_cmd[cmd_cnt].json_type=cJSON_Number;
|
||||
cmd_cnt++;
|
||||
|
||||
json_cmd[cmd_cnt].json_string="group_id";
|
||||
json_cmd[cmd_cnt].json_type=cJSON_Number;
|
||||
cmd_cnt++;
|
||||
|
||||
json_cmd[cmd_cnt].json_string="target";
|
||||
json_cmd[cmd_cnt].json_type=cJSON_String;
|
||||
cmd_cnt++;
|
||||
|
||||
json_cmd[cmd_cnt].json_string="threshold";
|
||||
json_cmd[cmd_cnt].json_type=cJSON_Number;
|
||||
cmd_cnt++;
|
||||
|
||||
json_cmd[cmd_cnt].json_string="is_valid";
|
||||
json_cmd[cmd_cnt].json_type=cJSON_Number;
|
||||
cmd_cnt++;
|
||||
|
||||
return direct_write_rule(region_json, p_iris->str2int_map,json_cmd, cmd_cnt,path,logger);
|
||||
|
||||
}
|
||||
struct iris_table_t* query_table_info(iris_description_t* p_iris,const char* table_name)
|
||||
{
|
||||
@@ -604,7 +634,10 @@ int write_region_rule(cJSON* region_json,int compile_id,int group_id,iris_descri
|
||||
break;
|
||||
case TABLE_TYPE_DIGEST:
|
||||
ret=write_digest_rule(table_content, p_iris, table_info->table_path, logger);
|
||||
break;
|
||||
break;
|
||||
case TABLE_TYPE_SIMILARITY:
|
||||
write_similar_rule(table_content, p_iris,table_info->table_path, logger);
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user