summaryrefslogtreecommitdiff
path: root/shaping/src/shaper_maat.cpp
diff options
context:
space:
mode:
authorliuchang <[email protected]>2023-04-27 06:37:04 +0000
committerliuchang <[email protected]>2023-04-27 06:37:04 +0000
commit044de7a592e7832de0bb6fa909aceddff4a60dab (patch)
treefd3c59cc1d4c649e139760969f1f2476e12343bb /shaping/src/shaper_maat.cpp
parent4a96185fb6ed2cfcad06dd599359cd4eca72ebf0 (diff)
TSG-14912: add vsys_id as one of tags for metric
Diffstat (limited to 'shaping/src/shaper_maat.cpp')
-rw-r--r--shaping/src/shaper_maat.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/shaping/src/shaper_maat.cpp b/shaping/src/shaper_maat.cpp
index 73f025e..67e2e34 100644
--- a/shaping/src/shaper_maat.cpp
+++ b/shaping/src/shaper_maat.cpp
@@ -63,6 +63,13 @@ void shaper_rule_ex_new(const char *table_name, int table_id, const char *key, c
goto END;
}
+ tmp_obj = cJSON_GetObjectItem(json, "vsys_id");
+ if (!tmp_obj) {
+ LOG_ERROR("%s: json parse vsys_id failed for table line %s", LOG_TAG_MAAT, table_line);
+ goto END;
+ }
+ s_rule->vsys_id = tmp_obj->valueint;
+
tmp_obj = cJSON_GetObjectItem(json, "priority");
if (!tmp_obj) {
LOG_ERROR("%s: json parse priority failed for table line %s", LOG_TAG_MAAT, table_line);
@@ -265,6 +272,7 @@ static void shaper_rule_update(struct shaping_thread_ctx *ctx, struct shaping_ru
goto END;
}
s_rule_info->id = s_rule->id;
+ s_rule_info->vsys_id = s_rule->vsys_id;
snprintf(pf_id_key, sizeof(pf_id_key), "%d", s_rule->primary_pf_id);
s_pf = (struct shaping_profile *)maat_plugin_table_get_ex_data(g_maat_instance, ctx->maat_info->profile_table_id, pf_id_key);