Fixed flow statistics in host_get_json.lua

Fixed TCP flags
Smaller cosmetic fixes
This commit is contained in:
Luca Deri 2016-05-30 22:58:08 +02:00
parent 1013df7db9
commit 79022c7238
6 changed files with 56 additions and 27 deletions

View file

@ -1134,6 +1134,11 @@ function flowinfo2hostname(flow_info, host_type, vlan)
local name
local orig_name
if(host_type == "srv") then
if(flow_info["host_server_name"] ~= nil) then return(flow_info["host_server_name"]) end
if(flow_info["ssl.certificate"] ~= nil) then return(flow_info["ssl.certificate"]) end
end
name = flow_info[host_type..".host"]
if((name == "") or (name == nil)) then
@ -2020,3 +2025,13 @@ end
function purgedErrorString()
return 'Very likely it is expired and ntopng has purged it from memory. You can set purge idle timeout settings from the <A HREF="'..ntop.getHttpPrefix()..'/lua/admin/prefs.lua?subpage_active=data_purge"><i class="fa fa-flask"></i> Preferences</A>.'
end
-- print TCP flags
function printTCPFlags(flags)
if(hasbit(flags,0x01)) then print('<span class="label label-info">FIN</span> ') end
if(hasbit(flags,0x02)) then print('<span class="label label-info">SYN</span> ') end
if(hasbit(flags,0x04)) then print('<span class="label label-danger">RST</span> ') end
if(hasbit(flags,0x08)) then print('<span class="label label-info">PUSH</span> ') end
if(hasbit(flags,0x10)) then print('<span class="label label-info">ACK</span> ') end
if(hasbit(flags,0x20)) then print('<span class="label label-info">URG</span> ') end
end