mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-29 07:29:32 +00:00
function to check if a protocol is allowed
This commit is contained in:
parent
129c1fabc1
commit
537cf0e746
1 changed files with 13 additions and 1 deletions
|
|
@ -259,10 +259,22 @@ function presets_utils.getDevicePoliciesByDir(device_type, client_or_server)
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
return device_policies
|
||||
end
|
||||
|
||||
-- Check if a protocol is allowed
|
||||
function presets_utils.isProtoAllowed(device_type, client_or_server, proto_id)
|
||||
local device_type_name = discover.id2devtype(tonumber(device_type))
|
||||
|
||||
local device_policies = presets_utils.getDevicePoliciesByDir(device_type, client_or_server)
|
||||
local policy = device_policies[tonumber(proto_id)]
|
||||
if policy ~= nil and policy.actionId == presets_utils.ALLOW then
|
||||
return true
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
-- Reload client or server device policies in the datapath
|
||||
function presets_utils.reloadDevicePoliciesByDir(device_type, client_or_server)
|
||||
local device_type_name = discover.id2devtype(tonumber(device_type))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue