TSG-13822 tsg-service-chaining-engine最多支持32个Service Fuction

This commit is contained in:
luwenpeng
2023-03-02 11:33:49 +08:00
parent 8b265517bb
commit e35429008a
4 changed files with 11 additions and 1 deletions

View File

@@ -47,6 +47,7 @@ struct policy_config
int redis_db_idx;
char redis_server[2048];
char redis_port_range[2048];
int max_chaining_size;
};
struct policy_enforcer
@@ -312,6 +313,7 @@ static void policy_enforcer_config(const char *profile, struct policy_config *co
MESA_load_profile_int_def(profile, "MAAT", "redis_db_idx", &(config->redis_db_idx), 0);
MESA_load_profile_string_def(profile, "MAAT", "redis_server", config->redis_server, sizeof(config->redis_server), "127.0.0.1");
MESA_load_profile_string_def(profile, "MAAT", "redis_port_range", config->redis_port_range, sizeof(config->redis_server), "6379");
MESA_load_profile_int_def(profile, "MAAT", "max_chaining_size", &(config->max_chaining_size), 32);
if (strlen(config->accept_path))
{
@@ -339,6 +341,7 @@ static void policy_enforcer_config(const char *profile, struct policy_config *co
LOG_DEBUG("%s: MAAT->redis_db_idx : %d", LOG_TAG_POLICY, config->redis_db_idx);
LOG_DEBUG("%s: MAAT->redis_server : %s", LOG_TAG_POLICY, config->redis_server);
LOG_DEBUG("%s: MAAT->redis_port_range : %s", LOG_TAG_POLICY, config->redis_port_range);
LOG_DEBUG("%s: MAAT->max_chaining_size : %d", LOG_TAG_POLICY, config->max_chaining_size);
}
static void chaining_param_new_cb(int table_id, const char *key, const char *table_line, MAAT_PLUGIN_EX_DATA *ad, long argl, void *argp)
@@ -1253,6 +1256,11 @@ void policy_enforcer_destory(struct policy_enforcer *enforcer)
}
}
int policy_enforce_max_chaining_size(struct policy_enforcer *enforcer)
{
return enforcer->config.max_chaining_size;
}
// return 0 : success
// return -1 : error
int policy_enforcer_register(struct policy_enforcer *enforcer)