mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-03 01:10:10 +00:00
Implements custom nDPI proto categories changes
This commit is contained in:
parent
7ba223bdac
commit
4ac6c92b9c
10 changed files with 390 additions and 0 deletions
27
scripts/lua/admin/change_ndpi_category.lua
Normal file
27
scripts/lua/admin/change_ndpi_category.lua
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
--
|
||||
-- (C) 2013-17 - ntop.org
|
||||
--
|
||||
|
||||
local dirs = ntop.getDirs()
|
||||
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
|
||||
require "lua_utils"
|
||||
local json = require "dkjson"
|
||||
|
||||
sendHTTPContentTypeHeader('application/json')
|
||||
|
||||
interface.select(ifname)
|
||||
|
||||
if(haveAdminPrivileges()) then
|
||||
local app_id = tonumber(_GET["l7proto"])
|
||||
local new_cat_id = tonumber(_GET["ndpi_new_cat_id"])
|
||||
local old_cat_id = tonumber(_GET["ndpi_old_cat_id"])
|
||||
|
||||
if new_cat_id ~= nil and old_cat_id ~= nil and new_cat_id ~= old_cat_id then
|
||||
setCustomnDPIProtoCategory(ifname, app_id, new_cat_id)
|
||||
end
|
||||
|
||||
local res = {status = "OK"}
|
||||
print(json.encode(res))
|
||||
else
|
||||
print({status = "ERROR"})
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue