summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-diag-devinfo/luasrc/model
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2009-07-17 20:27:05 +0000
committerJo-Philipp Wich <jow@openwrt.org>2009-07-17 20:27:05 +0000
commit820f11932f548182ebb32704e1df83b78e69b19e (patch)
treece56e5183f28520ce6078aa5fd723d8bb3f2b310 /applications/luci-diag-devinfo/luasrc/model
parent768bf67b867df0fde2715308eef482cb677a8566 (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')
-rw-r--r--applications/luci-diag-devinfo/luasrc/model/cbi/luci_diag/mactodevinfo.lua36
-rw-r--r--applications/luci-diag-devinfo/luasrc/model/cbi/luci_diag/netdiscover_devinfo.lua31
-rw-r--r--applications/luci-diag-devinfo/luasrc/model/cbi/luci_diag/netdiscover_devinfo_config.lua30
-rw-r--r--applications/luci-diag-devinfo/luasrc/model/cbi/luci_diag/netdiscover_devinfo_config_mini.lua30
-rw-r--r--applications/luci-diag-devinfo/luasrc/model/cbi/luci_diag/netdiscover_devinfo_mini.lua31
-rw-r--r--applications/luci-diag-devinfo/luasrc/model/cbi/luci_diag/smap_devinfo.lua31
-rw-r--r--applications/luci-diag-devinfo/luasrc/model/cbi/luci_diag/smap_devinfo_config.lua35
-rw-r--r--applications/luci-diag-devinfo/luasrc/model/cbi/luci_diag/smap_devinfo_config_mini.lua34
-rw-r--r--applications/luci-diag-devinfo/luasrc/model/cbi/luci_diag/smap_devinfo_mini.lua31
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 000000000..548ddbe2f
--- /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 000000000..34ce02aa1
--- /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 000000000..7b5f0d408
--- /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 000000000..9f0686404
--- /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 000000000..8bdc1e636
--- /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 000000000..99d321486
--- /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 000000000..a50847521
--- /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 000000000..f68af9060
--- /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 000000000..3f695a0a6
--- /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