Adds category id to the rest application consts getter

Implements #3944
This commit is contained in:
Simone Mainardi 2020-05-28 16:58:17 +02:00
parent 04945cc72f
commit 38067e4ef8
2 changed files with 6 additions and 3 deletions

View file

@ -23,8 +23,11 @@ local res = {}
local applications = interface.getnDPIProtocols()
for application, application_id in pairs(applications) do
res[application] = {application_id = tonumber(application_id)}
for application, appl_id in pairs(applications) do
appl_id = tonumber(appl_id)
local cat = ntop.getnDPIProtoCategory(appl_id)
res[application] = {appl_id = appl_id, cat_id = cat.id}
end
print(rest_utils.rc(rc, res))