diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2009-07-17 20:27:05 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2009-07-17 20:27:05 +0000 |
commit | 820f11932f548182ebb32704e1df83b78e69b19e (patch) | |
tree | ce56e5183f28520ce6078aa5fd723d8bb3f2b310 /applications/luci-diag-devinfo/luasrc/model | |
parent | 768bf67b867df0fde2715308eef482cb677a8566 (diff) |
[PATCH] add tools to scan network for any device, or for sip devices, and output device information, thanks cshore
Diffstat (limited to 'applications/luci-diag-devinfo/luasrc/model')
9 files changed, 289 insertions, 0 deletions
diff --git a/applications/luci-diag-devinfo/luasrc/model/cbi/luci_diag/mactodevinfo.lua b/applications/luci-diag-devinfo/luasrc/model/cbi/luci_diag/mactodevinfo.lua new file mode 100644 index 0000000000..548ddbe2fa --- /dev/null +++ b/applications/luci-diag-devinfo/luasrc/model/cbi/luci_diag/mactodevinfo.lua @@ -0,0 +1,36 @@ +--[[ +LuCI - Lua Configuration Interface + +(c) 2009 Daniel Dickinson + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +$Id$ +]]-- + +m = Map("mactodevinfo", luci.i18n.translate("l_d_d_m_mac_to_devinfo_override"), translate("l_d_d_m_mac_to_devinfo_override_descr")) + +s = m:section(TypedSection, "mactodevinfo", translate("l_d_d_m_mac_to_devinfo_section"), translate("l_d_d_m_mac_to_devinfo_section_descr")) +s.addremove = true +s.anonymous = true + +v = s:option(Value, "name", translate("l_d_d_m_name")) +v.optional = true +v = s:option(Value, "maclow", translate("l_d_d_m_maclow")) +v.optional = false +v = s:option(Value, "machigh", translate("l_d_d_m_machigh")) +v.optional = false +v = s:option(Value, "vendor", translate("l_d_d_m_vendor")) +v.optional = false +v = s:option(Value, "devtype", translate("l_d_d_m_mactodevinfo_devtype")) +v.optional = false +v = s:option(Value, "model", translate("l_d_d_m_model")) +v.optional = false +v = s:option(Value, "ouiowneroverride", translate("l_d_d_m_ouiowneroverride")) +v.optional = true + +return m diff --git a/applications/luci-diag-devinfo/luasrc/model/cbi/luci_diag/netdiscover_devinfo.lua b/applications/luci-diag-devinfo/luasrc/model/cbi/luci_diag/netdiscover_devinfo.lua new file mode 100644 index 0000000000..34ce02aa16 --- /dev/null +++ b/applications/luci-diag-devinfo/luasrc/model/cbi/luci_diag/netdiscover_devinfo.lua @@ -0,0 +1,31 @@ +--[[ +netdiscover_devinfo - SIP Device Information + +(c) 2009 Daniel Dickinson + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +$Id$ +]]-- + +require("luci.i18n") +require("luci.util") +require("luci.sys") +require("luci.model.uci") + +local debug = false + +m = SimpleForm("luci_devinfo", translate("l_d_d_nd_netdiscover_to_devinfo"), translate("l_d_d_nd_netdiscover_to_devinfo_descr")) +m.reset = false +m.submit = false + +local outnets = luci.controller.luci_diag.netdiscover_common.get_params() +luci.controller.luci_diag.devinfo_common.run_processes(outnets, luci.controller.luci_diag.netdiscover_common.command_function) +luci.controller.luci_diag.devinfo_common.parse_output(m, outnets, false, "netdiscover", false, debug) +luci.controller.luci_diag.netdiscover_common.action_links(m, false) + +return m diff --git a/applications/luci-diag-devinfo/luasrc/model/cbi/luci_diag/netdiscover_devinfo_config.lua b/applications/luci-diag-devinfo/luasrc/model/cbi/luci_diag/netdiscover_devinfo_config.lua new file mode 100644 index 0000000000..7b5f0d4081 --- /dev/null +++ b/applications/luci-diag-devinfo/luasrc/model/cbi/luci_diag/netdiscover_devinfo_config.lua @@ -0,0 +1,30 @@ +--[[ +LuCI - Lua Configuration Interface + +(c) 2009 Daniel Dickinson + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +$Id$ +]]-- + +require("luci.controller.luci_diag.devinfo_common") + +m = Map("luci_devinfo", translate("l_d_d_ndc_netdiscover_to_devinfo_config"), translate("l_d_d_ndc_netdiscover_to_devinfo_config_descr")) + +s = m:section(SimpleSection, "", translate("l_d_d_ndc_use_config")) +b = s:option(DummyValue, "_scans", translate("l_d_d_ndc_do_scans")) +b.value = "" +b.titleref = luci.dispatcher.build_url("admin", "status", "netdiscover_devinfo") + +scannet = m:section(TypedSection, "netdiscover_scannet", translate("l_d_d_ndc_netdiscover_scannet"), translate("l_d_d_ndc_netdiscover_scannet_descr")) +scannet.addremove = true +scannet.anonymous = false + +luci.controller.luci_diag.devinfo_common.config_devinfo_scan(m, scannet) + +return m diff --git a/applications/luci-diag-devinfo/luasrc/model/cbi/luci_diag/netdiscover_devinfo_config_mini.lua b/applications/luci-diag-devinfo/luasrc/model/cbi/luci_diag/netdiscover_devinfo_config_mini.lua new file mode 100644 index 0000000000..9f0686404c --- /dev/null +++ b/applications/luci-diag-devinfo/luasrc/model/cbi/luci_diag/netdiscover_devinfo_config_mini.lua @@ -0,0 +1,30 @@ +--[[ +LuCI - Lua Configuration Interface + +(c) 2009 Daniel Dickinson + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +$Id$ +]]-- + +require("luci.controller.luci_diag.devinfo_common") + +m = Map("luci_devinfo", translate("l_d_d_ndc_netdiscover_to_devinfo_config_mini"), translate("l_d_d_ndc_mini_netdiscover_to_devinfo_config_descr")) + +s = m:section(SimpleSection, "", translate("l_d_d_ndc_mini_use_config")) +b = s:option(DummyValue, "_scans", translate("l_d_d_ndc_mini_do_scans")) +b.value = "" +b.titleref = luci.dispatcher.build_url("mini", "diag", "netdiscover_devinfo") + +scannet = m:section(TypedSection, "netdiscover_scannet", translate("l_d_d_ndc_mini_netdiscover_scannet"), translate("l_d_d_ndc_mini_netdiscover_scannet_descr")) +scannet.addremove = true +scannet.anonymous = false + +luci.controller.luci_diag.devinfo_common.config_devinfo_scan(m, scannet) + +return m diff --git a/applications/luci-diag-devinfo/luasrc/model/cbi/luci_diag/netdiscover_devinfo_mini.lua b/applications/luci-diag-devinfo/luasrc/model/cbi/luci_diag/netdiscover_devinfo_mini.lua new file mode 100644 index 0000000000..8bdc1e636c --- /dev/null +++ b/applications/luci-diag-devinfo/luasrc/model/cbi/luci_diag/netdiscover_devinfo_mini.lua @@ -0,0 +1,31 @@ +--[[ +netdiscover_devinfo - SIP Device Information + +(c) 2009 Daniel Dickinson + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +$Id$ +]]-- + +require("luci.i18n") +require("luci.util") +require("luci.sys") +require("luci.model.uci") + +local debug = false + +m = SimpleForm("luci_devinfo", translate("l_d_d_nd_mini_netdiscover_to_devinfo"), translate("l_d_d_nd_mini_netdiscover_to_devinfo_descr")) +m.reset = false +m.submit = false + +local outnets = luci.controller.luci_diag.netdiscover_common.get_params() +luci.controller.luci_diag.devinfo_common.run_processes(outnets, luci.controller.luci_diag.netdiscover_common.command_function) +luci.controller.luci_diag.devinfo_common.parse_output(m, outnets, false, "netdiscover", true, debug) +luci.controller.luci_diag.netdiscover_common.action_links(m, true) + +return m diff --git a/applications/luci-diag-devinfo/luasrc/model/cbi/luci_diag/smap_devinfo.lua b/applications/luci-diag-devinfo/luasrc/model/cbi/luci_diag/smap_devinfo.lua new file mode 100644 index 0000000000..99d3214869 --- /dev/null +++ b/applications/luci-diag-devinfo/luasrc/model/cbi/luci_diag/smap_devinfo.lua @@ -0,0 +1,31 @@ +--[[ +smap_devinfo - SIP Device Information + +(c) 2009 Daniel Dickinson + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +$Id$ +]]-- + +require("luci.i18n") +require("luci.util") +require("luci.sys") +require("luci.model.uci") + +local debug = false + +m = SimpleForm("luci-smap-to-devinfo", translate("l_d_d_sd_smap_to_devinfo"), translate("l_d_d_sd_smap_to_devinfo_descr")) +m.reset = false +m.submit = false + +local outnets = luci.controller.luci_diag.smap_common.get_params() +luci.controller.luci_diag.devinfo_common.run_processes(outnets, luci.controller.luci_diag.smap_common.command_function) +luci.controller.luci_diag.devinfo_common.parse_output(m, outnets, true, "smap", false, debug) +luci.controller.luci_diag.smap_common.action_links(m, false) + +return m diff --git a/applications/luci-diag-devinfo/luasrc/model/cbi/luci_diag/smap_devinfo_config.lua b/applications/luci-diag-devinfo/luasrc/model/cbi/luci_diag/smap_devinfo_config.lua new file mode 100644 index 0000000000..a50847521e --- /dev/null +++ b/applications/luci-diag-devinfo/luasrc/model/cbi/luci_diag/smap_devinfo_config.lua @@ -0,0 +1,35 @@ +--[[ +LuCI - Lua Configuration Interface + +(c) 2009 Daniel Dickinson + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +$Id$ +]]-- + +require("luci.controller.luci_diag.devinfo_common") + +m = Map("luci_devinfo", translate("l_d_d_sdc_smap_to_devinfo_config"), translate("l_d_d_sdc_smap_to_devinfo_config_descr")) + +s = m:section(SimpleSection, "", translate("l_d_d_sdc_use_config")) +b = s:option(DummyValue, "_scans", translate("l_d_d_sdc_do_scans")) +b.value = "" +b.titleref = luci.dispatcher.build_url("admin", "status", "smap_devinfo") + +scannet = m:section(TypedSection, "smap_scannet", translate("l_d_d_sdc_smap_scannet"), translate("smap_scannet_descr")) +scannet.addremove = true +scannet.anonymous = false + +local ports +ports = scannet:option(Value, "ports", translate("l_d_d_sdc_ports")) +ports.optional = true +ports.rmempty = true + +luci.controller.luci_diag.devinfo_common.config_devinfo_scan(m, scannet) + +return m diff --git a/applications/luci-diag-devinfo/luasrc/model/cbi/luci_diag/smap_devinfo_config_mini.lua b/applications/luci-diag-devinfo/luasrc/model/cbi/luci_diag/smap_devinfo_config_mini.lua new file mode 100644 index 0000000000..f68af90605 --- /dev/null +++ b/applications/luci-diag-devinfo/luasrc/model/cbi/luci_diag/smap_devinfo_config_mini.lua @@ -0,0 +1,34 @@ +--[[ +LuCI - Lua Configuration Interface + +(c) 2009 Daniel Dickinson + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +$Id$ +]]-- + +m = Map("luci_devinfo", translate("l_d_d_sdc_mini_smap_to_devinfo_config"), translate("l_d_d_sdc_mini_smap_to_devinfo_config_descr")) + +s = m:section(SimpleSection, "", translate("l_d_d_sdc_mini_use_config")) +b = s:option(DummyValue, "_scans", translate("l_d_d_sdc_mini_do_scans")) +b.value = "" +b.titleref = luci.dispatcher.build_url("mini", "diag", "phone_scan") + +scannet = m:section(TypedSection, "smap_scannet", translate("l_d_d_sdc_mini_smap_scannet"), translate("l_d_d_sdc_mini_smap_scannet_descr")) +scannet.addremove = true +scannet.anonymous = false + +local ports +ports = scannet:option(Value, "ports", translate("l_d_d_sdc_mini_ports")) +ports.optional = true +ports.rmempty = true + +luci.controller.luci_diag.devinfo_common.config_devinfo_scan(m, scannet) + + +return m diff --git a/applications/luci-diag-devinfo/luasrc/model/cbi/luci_diag/smap_devinfo_mini.lua b/applications/luci-diag-devinfo/luasrc/model/cbi/luci_diag/smap_devinfo_mini.lua new file mode 100644 index 0000000000..3f695a0a66 --- /dev/null +++ b/applications/luci-diag-devinfo/luasrc/model/cbi/luci_diag/smap_devinfo_mini.lua @@ -0,0 +1,31 @@ +--[[ +smap_devinfo - SIP Device Information + +(c) 2009 Daniel Dickinson + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +$Id$ +]]-- + +require("luci.i18n") +require("luci.util") +require("luci.sys") +require("luci.model.uci") + +local debug = false + +m = SimpleForm("luci-smap-to-devinfo", translate("l_d_d_sd_mini_smap_to_devinfo"), translate("l_d_d_sd_mini_smap_to_devinfo_descr")) +m.reset = false +m.submit = false + +local outnets = luci.controller.luci_diag.smap_common.get_params() +luci.controller.luci_diag.devinfo_common.run_processes(outnets, luci.controller.luci_diag.smap_common.command_function) +luci.controller.luci_diag.devinfo_common.parse_output(m, outnets, true, "smap", true, debug) +luci.controller.luci_diag.smap_common.action_links(m, true) + +return m |