[nEdge] Add configuration for Block Blacklisted Flows and Max Flow Size. Provide host->doBlockBlacklistedFlows() and host->getMaxFlowSize()

This commit is contained in:
Alfredo Cardigliano 2025-08-12 15:37:28 +02:00
parent a234658669
commit af94a60dd6
7 changed files with 82 additions and 9 deletions

View file

@ -301,6 +301,22 @@ function host_pools_nedge.setChildrenSafe(pool_id, value)
host_pools_nedge.setPoolDetail(pool_id, "children_safe", ternary(value, "true", "false"))
end
function host_pools_nedge.getBlockBlacklistedFlows(pool_id)
return toboolean(host_pools_nedge.getPoolDetail(pool_id, "block_blacklisted_flows"))
end
function host_pools_nedge.setBlockBlacklistedFlows(pool_id, value)
host_pools_nedge.setPoolDetail(pool_id, "block_blacklisted_flows", ternary(value, "true", "false"))
end
function host_pools_nedge.getMaxFlowSize(pool_id)
return tonumber(host_pools_nedge.getPoolDetail(pool_id, "max_flow_size") or "0")
end
function host_pools_nedge.setMaxFlowSize(pool_id, value)
host_pools_nedge.setPoolDetail(pool_id, "max_flow_size", value)
end
function host_pools_nedge.routingPolicyNameToId(policy_name)
package.path = dirs.installdir .. "/pro/scripts/lua/nedge/modules/system_config/?.lua;" .. package.path
local nf_config = require("nf_config"):create()

View file

@ -2610,6 +2610,8 @@ local known_parameters = {
["unassigned_devices"] = validateUnassignedDevicesMode, -- unknown_device.lua
["delete_all_policies"] = validateEmpty, -- traffic policies
["safe_search"] = validateBool, -- users
["block_blacklisted"] = validateBool, -- users
["max_flow_size"] = validateNumber,
["device_protocols_policing"] = validateBool, -- users
["forge_global_dns"] = validateBool, -- users
["asset_family"] = validateAssetFamily, -- network_maps.lua