mirror of
https://github.com/ntop/ntopng.git
synced 2026-04-30 07:59:35 +00:00
Reworks mac address lists
This commit is contained in:
parent
d3f0945449
commit
5e4488a448
17 changed files with 215 additions and 185 deletions
27
scripts/lua/get_mac_data.lua
Normal file
27
scripts/lua/get_mac_data.lua
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
--
|
||||
-- (C) 2013-16 - 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")
|
||||
|
||||
sendHTTPHeader('text/html; charset=iso-8859-1')
|
||||
|
||||
-- sendHTTPHeader('application/json')
|
||||
interface.select(ifname)
|
||||
|
||||
local host_info = url2hostinfo(_GET)
|
||||
|
||||
interface.select(ifname)
|
||||
|
||||
local host = interface.getMacInfo(host_info["host"], host_info["vlan"])
|
||||
|
||||
local res = {}
|
||||
if host ~= nil then
|
||||
res = mac2record(host)
|
||||
end
|
||||
|
||||
print(json.encode(res, nil))
|
||||
Loading…
Add table
Add a link
Reference in a new issue