Flow dissection code cleanup.

The Flow API is now composed of the following methods:
  - Flow::setDetectedProtocol to manually set a protocol on the flow
    and terminate the dissection
  - Flow::processPacket to run the nDPI dissection on the raw packets
  - Flow::endProtocolDissection to terminate or give up the dissection

Also fixes the flow sampling rate preference, which was never used.
This commit is contained in:
emanuele-f 2020-02-14 20:03:22 +01:00
parent 14202b7c9b
commit 15898e8dad
10 changed files with 181 additions and 154 deletions

View file

@ -1918,10 +1918,6 @@ function getRedisPrefix(str)
end
end
function getRedisIfacePrefix(ifid)
return "ntopng.prefs.ifid_"..tostring(ifid)
end
----- End of Redis Utils ------
@ -2012,7 +2008,7 @@ function getInterfaceSpeed(ifid)
end
function getInterfaceRefreshRate(ifid)
local key = getRedisIfacePrefix(ifid)..".refresh_rate"
local key = "ntopng.prefs.ifid_"..tostring(ifid)..".refresh_rate"
local refreshrate = ntop.getCache(key)
if isEmptyString(refreshrate) or tonumber(refreshrate) == nil then
@ -2025,7 +2021,7 @@ function getInterfaceRefreshRate(ifid)
end
function setInterfaceRegreshRate(ifid, refreshrate)
local key = getRedisIfacePrefix(ifid)..".refresh_rate"
local key = "ntopng.prefs.ifid_"..tostring(ifid)..".refresh_rate"
if isEmptyString(refreshrate) then
ntop.delCache(key)