Add routing_policy to nedge configuration callback

This commit is contained in:
Alfredo Cardigliano 2022-10-21 17:02:03 +02:00
parent b357bcb626
commit 87a3ad8baa
2 changed files with 26 additions and 4 deletions

View file

@ -55,16 +55,16 @@ function http_bridge_conf_utils.configureBridge()
-- ["ConnectivityCheck"] = "pass"
-- }
-- },
-- ["maina"] = {
-- ["full_name"] = "Maina Fast",
-- ["guest"] = {
-- ["full_name"] = "Guest Users",
-- ["password"] = "ntop0101",
-- ["default_policy"] = "pass",
-- ["policies"] = {
-- [10] = "slow_pass", ["Facebook"] = "slower_pass", ["YouTube"] = "drop"
-- }
-- },
-- ["simon"] = {
-- ["full_name"] = "Simon Speed",
-- ["iot"] = {
-- ["full_name"] = "IoT Devices",
-- ["password"] = "ntop0202",
-- ["default_policy"] = "drop",
-- ["policies"] = {
@ -121,8 +121,14 @@ function http_bridge_conf_utils.configureBridge()
end
local pool_id = host_pools_nedge.usernameToPoolId(username) or host_pools_nedge.DEFAULT_POOL_ID
host_pools_nedge.traceHostPoolEvent(TRACE_NORMAL, ifname..": creating user: "..username.. " pool id: "..pool_id)
if not isEmptyString(user_config["routing_policy"]) then
local routing_policy_id = host_pools_nedge.routingPolicyNameToId(user_config["routing_policy"])
host_pools_nedge.setRoutingPolicyId(pool_id, routing_policy_id)
end
if not isEmptyString(user_config["default_policy"]) then
local default_policy = string.lower(user_config["default_policy"])