-- -- (C) 2013-17 - ntop.org -- dirs = ntop.getDirs() package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path require "lua_utils" sendHTTPHeader('text/html; charset=iso-8859-1') ntop.dumpFile(dirs.installdir .. "/httpdocs/inc/header.inc") protocol = _GET["protocol"] net = _GET["net"] asn = _GET["asn"] vlan = _GET["vlan"] network = _GET["network"] country = _GET["country"] mac = _GET["mac"] os_ = _GET["os"] community = _GET["community"] mode = _GET["mode"] if(mode == nil) then mode = "all" end active_page = "hosts" dofile(dirs.installdir .. "/scripts/lua/inc/menu.lua") prefs = ntop.getPrefs() ifstats = interface.getStats() print [[
]] if(asn ~= nil) then print [[
") if(asn ~= nil) then print [[
]] end -- build the current filter url local filter_base_url = ntop.getHttpPrefix() .. "/lua/hosts_stats.lua" local filter_url_params = {} filter_url_params["mode"] = mode filter_url_params["os"] = os_ filter_url_params["net"] = net filter_url_params["asn"] = asn filter_url_params["community"] = community filter_url_params["vlan"] = vlan filter_url_params["country"] = country filter_url_params["mac"] = mac if(protocol ~= nil) then -- Example HTTP.Facebook dot = string.find(protocol, '%.') if(dot ~= nil) then protocol = string.sub(protocol, dot+1) end filter_url_params["protocol"] = protocol end if(network ~= nil) then filter_url_params["network"] = network network_name = ntop.getNetworkNameById(tonumber(network)) else network_name = "" end function getPageUrl(params, base_url) local base_url = base_url or filter_base_url return base_url .. "?" .. table.tconcat(params, "=", "&") end print [[
]] if(asn ~= "0") then print (" More Information about AS"..asn.." ") end end dofile(dirs.installdir .. "/scripts/lua/inc/footer.lua")