TSG-18009 PolicyVerify命中路径中展示Internal、External信息

This commit is contained in:
fengweihao
2023-12-20 16:37:43 +08:00
parent 50bf60cc3f
commit 4f89bd11f2

View File

@@ -1206,13 +1206,13 @@ int get_attributes_table_name(struct request_query_obj *query_obj, int num, int
/*ip location**/
if(ip_ctx->Nth_scan[0] == Nth_scan)
{
cJSON_AddStringToObject(topObject, "tableName", "TSG_SECURITY_SOURCE_ADDR");
cJSON_AddStringToObject(topObject, "tableName", "ATTR_SOURCE_ADDR");
return 0;
}
if(ip_ctx->Nth_scan[1] == Nth_scan)
{
cJSON_AddStringToObject(topObject, "tableName", "TSG_SECURITY_DESTINATION_ADDR");
cJSON_AddStringToObject(topObject, "tableName", "ATTR_DESTINATION_ADDR");
return 0;
}
@@ -1240,7 +1240,6 @@ int http_hit_policy_list(struct verify_policy_query *verify_policy, int num, siz
bool succeeded = false;
size_t rules=0, i=0,j=0;
int result_config[MAX_SCAN_RESULT] = {0};
int result_object_id[512] = {0};
int vsys_id = verify_policy->vsys_id;
int compile_table_id = verify_policy->compile_table_id;
@@ -1288,7 +1287,6 @@ int http_hit_policy_list(struct verify_policy_query *verify_policy, int num, siz
}
cJSON_AddItemToArray(hit_obj, policy_obj);
result_config[i] = ctx->hit_rules[i].config_id;
memset(result_object_id, 0, sizeof(result_object_id));
topObjectList=cJSON_CreateArray();
cJSON_AddItemToObject(policy_obj, "topObjectList", topObjectList);
@@ -1296,15 +1294,10 @@ int http_hit_policy_list(struct verify_policy_query *verify_policy, int num, siz
{
if(ctx->hit_path[j].compile_id > 0 && ctx->hit_path[j].compile_id == ctx->hit_rules[i].config_id)
{
if(http_hit_policy_match(result_object_id, j, ctx->hit_path[j].top_group_id))
{
continue;
}
topObject=cJSON_CreateObject();
cJSON_AddNumberToObject(topObject, "objectId", ctx->hit_path[j].top_group_id);
cJSON_AddNumberToObject(topObject, "notFlag", ctx->hit_path[j].NOT_flag);
cJSON_AddNumberToObject(topObject, "nthClause", ctx->hit_path[j].clause_index);
result_object_id[j] = ctx->hit_path[j].top_group_id;
get_attributes_table_name(verify_policy->verify_object, num, ctx->hit_path[j].Nth_scan, &ctx->ip_ctx, ctx->tunnel_endpoint_x, topObject);
cJSON_AddItemToArray(topObjectList, topObject);
}