TSG-11997 策略验证支持按Traffic Vsys验证流量

This commit is contained in:
fengweihao
2022-10-10 15:31:41 +08:00
parent 74b95d15dc
commit d47908eed0
3 changed files with 185 additions and 186 deletions

View File

@@ -360,6 +360,13 @@ cJSON *get_query_from_request(const char *data, int thread_id)
goto free;
}
}
item = cJSON_GetObjectItem(subitem, "vsysId");
if(item && item->type==cJSON_Number)
{
verify_policy->vsys_id = item->valueint;
}
item = cJSON_GetObjectItem(subitem,"verifySession");
if(item == NULL || item->type!=cJSON_Object)
{
@@ -370,23 +377,6 @@ cJSON *get_query_from_request(const char *data, int thread_id)
{
void *ctx = pangu_http_ctx_new(thread_id);
for (subchild = attributes->child; subchild != NULL; subchild = subchild->next)
{
item = cJSON_GetObjectItem(subchild, "attributeName");
if(item && item->type==cJSON_String)
{
if(0 == strcasecmp(item->valuestring, "tunnel_endpointa"))
{
verify_policy_tunnle_add(ctx);
}
if(0 == strcasecmp(item->valuestring, "tunnel_endpointb"))
{
verify_policy_tunnle_add(ctx);
}
}
}
for (subchild = attributes->child; subchild != NULL; subchild = subchild->next)
{
xret = get_attribute_from_json(i, subchild, verify_policy);
@@ -394,7 +384,7 @@ cJSON *get_query_from_request(const char *data, int thread_id)
{
goto free;
}
hit_cnt = verify_policy_scan(verify_policy->type, &verify_policy->verify_object[i], data_obj, ctx);
hit_cnt = verify_policy_scan(verify_policy->vsys_id, verify_policy->type, &verify_policy->verify_object[i], data_obj, ctx);
if(0 == strcasecmp(verify_policy->verify_object[i].attri_name, "source") ||
0 == strcasecmp(verify_policy->verify_object[i].attri_name, "destination"))
{