diff options
| author | liuchang <[email protected]> | 2023-07-03 08:43:49 +0000 |
|---|---|---|
| committer | liuchang <[email protected]> | 2023-07-03 08:43:49 +0000 |
| commit | 96c628d2cda78c5952963d764b3f821951ff862c (patch) | |
| tree | 7ec928221fc9dce93626d071b83ba4392555b3d4 /shaping/src/shaper_maat.cpp | |
| parent | 301613cec7f20aa45f4f56c958a38458a7f8f545 (diff) | |
check if the rule is enabled before get token, check interval default 120s
Diffstat (limited to 'shaping/src/shaper_maat.cpp')
| -rw-r--r-- | shaping/src/shaper_maat.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/shaping/src/shaper_maat.cpp b/shaping/src/shaper_maat.cpp index e11538f..e6f6074 100644 --- a/shaping/src/shaper_maat.cpp +++ b/shaping/src/shaper_maat.cpp @@ -348,6 +348,18 @@ static void shaper_profiles_priority_update(struct shaping_flow *sf) return; } +int shaper_rule_is_enabled(struct shaping_thread_ctx *ctx, long long rule_id) +{ + struct shaping_rule *s_rule = (struct shaping_rule*)maat_plugin_table_get_ex_data(g_maat_instance, ctx->maat_info->rule_table_id, (char *)&rule_id, sizeof(rule_id)); + + if (s_rule) { + shaper_rule_ex_free(ctx->maat_info->rule_table_id, (void **)&s_rule, 0, NULL); + return 1; + } + + return 0; +} + void shaper_rules_update(struct shaping_thread_ctx *ctx, struct shaping_flow *sf, long long *rule_compile_ids, int rule_num) { int i, j; |
