1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
--
-- (C) 2013-22 - ntop.org
--
dirs = ntop.getDirs()
package.path = dirs.installdir .. "/scripts/lua/modules/?.lua;" .. package.path
require "lua_utils"
require "mac_utils" -- needed for the function mac2record
local json = require("dkjson")
sendHTTPContentTypeHeader('text/html')
-- sendHTTPHeader('application/json')
interface.select(ifname)
local host_info = url2hostinfo(_GET)
interface.select(ifname)
local host = interface.getMacInfo(host_info["host"])
print(json.encode(host or {}, nil))
|