TSG-14908 tsg-service-chaining-engine的service_chaining_rule_hits metrics适配vsys_id的变更
This commit is contained in:
@@ -68,6 +68,7 @@ struct chaining_param
|
||||
{
|
||||
uint64_t rule_id;
|
||||
int ref_cnt;
|
||||
int vsys_id;
|
||||
|
||||
enum traffic_type traffic_type;
|
||||
int *sff_profile_ids;
|
||||
@@ -301,6 +302,16 @@ static void chaining_param_new_cb(const char *table_name, int table_id, const ch
|
||||
param->rule_id = atoll(key);
|
||||
param->ref_cnt = 1;
|
||||
|
||||
// vsys_id
|
||||
item = cJSON_GetObjectItem(json, "vsys_id");
|
||||
if (!item || !cJSON_IsNumber(item))
|
||||
{
|
||||
LOG_ERROR("%s: unexpected chaining rule: (invalid vsys_id param) %s", LOG_TAG_POLICY, table_line);
|
||||
goto error_out;
|
||||
}
|
||||
param->vsys_id = item->valueint;
|
||||
LOG_DEBUG("%s: parse chaining rule: %lu, vsys_id: %d", LOG_TAG_POLICY, param->rule_id, param->vsys_id);
|
||||
|
||||
// targeted_traffic
|
||||
item = cJSON_GetObjectItem(json, "targeted_traffic");
|
||||
if (!item || !cJSON_IsString(item))
|
||||
@@ -1046,6 +1057,7 @@ static void selected_sf_init(struct selected_sf *item)
|
||||
if (item)
|
||||
{
|
||||
memset(item, 0, sizeof(struct selected_sf));
|
||||
item->rule_vsys_id = 0;
|
||||
item->rule_id = 0;
|
||||
item->traffic_type = TRAFFIC_TYPE_NONE;
|
||||
item->sff_profile_id = -1;
|
||||
@@ -1513,6 +1525,7 @@ void policy_enforce_select_chainings(struct policy_enforcer *enforcer, struct se
|
||||
selected_sf_init(item);
|
||||
|
||||
item->rule_id = rule_id;
|
||||
item->rule_vsys_id = chaining_param->vsys_id;
|
||||
item->traffic_type = chaining_param->traffic_type;
|
||||
item->sff_profile_id = chaining_param->sff_profile_ids[i];
|
||||
item->sf_index = chaining->chaining_used;
|
||||
|
||||
Reference in New Issue
Block a user