summaryrefslogtreecommitdiffhomepage
path: root/protocols
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2014-06-11 13:29:05 +0000
committerJo-Philipp Wich <jow@openwrt.org>2014-06-11 13:29:05 +0000
commit7043c30e0e55bbbfacdddf97619b6bae96d20ddb (patch)
treeece3254350b3ba01ba3135caed2364cc7ca7804c /protocols
parentbbb44cf245c11bc0c1d59e836007c9e8c3bfa209 (diff)
build: introduce luci-base
Merges libs/core, libs/ipkg, libs/web, libs/sys, libs/sgi-cgi, libs/sgi-uhttpd, modules/admin-core, themes/base and protcols/core into modules/base and renames luci-lib-core to luci-base.
Diffstat (limited to 'protocols')
-rw-r--r--protocols/core/Makefile2
-rw-r--r--protocols/core/luasrc/model/cbi/admin_network/proto_dhcp.lua76
-rw-r--r--protocols/core/luasrc/model/cbi/admin_network/proto_none.lua13
-rw-r--r--protocols/core/luasrc/model/cbi/admin_network/proto_static.lua90
-rw-r--r--protocols/core/luasrc/tools/proto.lua46
5 files changed, 0 insertions, 227 deletions
diff --git a/protocols/core/Makefile b/protocols/core/Makefile
deleted file mode 100644
index f7fac7740..000000000
--- a/protocols/core/Makefile
+++ /dev/null
@@ -1,2 +0,0 @@
-include ../../build/config.mk
-include ../../build/module.mk
diff --git a/protocols/core/luasrc/model/cbi/admin_network/proto_dhcp.lua b/protocols/core/luasrc/model/cbi/admin_network/proto_dhcp.lua
deleted file mode 100644
index fe3fec6fa..000000000
--- a/protocols/core/luasrc/model/cbi/admin_network/proto_dhcp.lua
+++ /dev/null
@@ -1,76 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2011-2012 Jo-Philipp Wich <xm@subsignal.org>
-
-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
-]]--
-
-local map, section, net = ...
-local ifc = net:get_interface()
-
-local hostname, accept_ra, send_rs
-local bcast, defaultroute, peerdns, dns, metric, clientid, vendorclass
-
-
-hostname = section:taboption("general", Value, "hostname",
- translate("Hostname to send when requesting DHCP"))
-
-hostname.placeholder = luci.sys.hostname()
-hostname.datatype = "hostname"
-
-
-bcast = section:taboption("advanced", Flag, "broadcast",
- translate("Use broadcast flag"),
- translate("Required for certain ISPs, e.g. Charter with DOCSIS 3"))
-
-bcast.default = bcast.disabled
-
-
-defaultroute = section:taboption("advanced", Flag, "defaultroute",
- translate("Use default gateway"),
- translate("If unchecked, no default route is configured"))
-
-defaultroute.default = defaultroute.enabled
-
-
-peerdns = section:taboption("advanced", Flag, "peerdns",
- translate("Use DNS servers advertised by peer"),
- translate("If unchecked, the advertised DNS server addresses are ignored"))
-
-peerdns.default = peerdns.enabled
-
-
-dns = section:taboption("advanced", DynamicList, "dns",
- translate("Use custom DNS servers"))
-
-dns:depends("peerdns", "")
-dns.datatype = "ipaddr"
-dns.cast = "string"
-
-
-metric = section:taboption("advanced", Value, "metric",
- translate("Use gateway metric"))
-
-metric.placeholder = "0"
-metric.datatype = "uinteger"
-
-
-clientid = section:taboption("advanced", Value, "clientid",
- translate("Client ID to send when requesting DHCP"))
-
-
-vendorclass = section:taboption("advanced", Value, "vendorid",
- translate("Vendor Class to send when requesting DHCP"))
-
-
-luci.tools.proto.opt_macaddr(section, ifc, translate("Override MAC address"))
-
-
-mtu = section:taboption("advanced", Value, "mtu", translate("Override MTU"))
-mtu.placeholder = "1500"
-mtu.datatype = "max(9200)"
diff --git a/protocols/core/luasrc/model/cbi/admin_network/proto_none.lua b/protocols/core/luasrc/model/cbi/admin_network/proto_none.lua
deleted file mode 100644
index 0e34b67de..000000000
--- a/protocols/core/luasrc/model/cbi/admin_network/proto_none.lua
+++ /dev/null
@@ -1,13 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2011 Jo-Philipp Wich <xm@subsignal.org>
-
-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
-]]--
-
-local map, section, net = ...
diff --git a/protocols/core/luasrc/model/cbi/admin_network/proto_static.lua b/protocols/core/luasrc/model/cbi/admin_network/proto_static.lua
deleted file mode 100644
index 338c0b7d8..000000000
--- a/protocols/core/luasrc/model/cbi/admin_network/proto_static.lua
+++ /dev/null
@@ -1,90 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2011 Jo-Philipp Wich <xm@subsignal.org>
-
-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
-]]--
-
-local map, section, net = ...
-local ifc = net:get_interface()
-
-local ipaddr, netmask, gateway, broadcast, dns, accept_ra, send_rs, ip6addr, ip6gw
-local mtu, metric
-
-
-ipaddr = section:taboption("general", Value, "ipaddr", translate("IPv4 address"))
-ipaddr.datatype = "ip4addr"
-
-
-netmask = section:taboption("general", Value, "netmask",
- translate("IPv4 netmask"))
-
-netmask.datatype = "ip4addr"
-netmask:value("255.255.255.0")
-netmask:value("255.255.0.0")
-netmask:value("255.0.0.0")
-
-
-gateway = section:taboption("general", Value, "gateway", translate("IPv4 gateway"))
-gateway.datatype = "ip4addr"
-
-
-broadcast = section:taboption("general", Value, "broadcast", translate("IPv4 broadcast"))
-broadcast.datatype = "ip4addr"
-
-
-dns = section:taboption("general", DynamicList, "dns",
- translate("Use custom DNS servers"))
-
-dns.datatype = "ipaddr"
-dns.cast = "string"
-
-
-if luci.model.network:has_ipv6() then
-
- local ip6assign = section:taboption("general", Value, "ip6assign", translate("IPv6 assignment length"),
- translate("Assign a part of given length of every public IPv6-prefix to this interface"))
- ip6assign:value("", translate("disabled"))
- ip6assign:value("64")
- ip6assign.datatype = "max(64)"
-
- local ip6hint = section:taboption("general", Value, "ip6hint", translate("IPv6 assignment hint"),
- translate("Assign prefix parts using this hexadecimal subprefix ID for this interface."))
- for i=33,64 do ip6hint:depends("ip6assign", i) end
-
- ip6addr = section:taboption("general", Value, "ip6addr", translate("IPv6 address"))
- ip6addr.datatype = "ip6addr"
- ip6addr:depends("ip6assign", "")
-
-
- ip6gw = section:taboption("general", Value, "ip6gw", translate("IPv6 gateway"))
- ip6gw.datatype = "ip6addr"
- ip6gw:depends("ip6assign", "")
-
-
- local ip6prefix = s:taboption("general", Value, "ip6prefix", translate("IPv6 routed prefix"),
- translate("Public prefix routed to this device for distribution to clients."))
- ip6prefix.datatype = "ip6addr"
- ip6prefix:depends("ip6assign", "")
-
-end
-
-
-luci.tools.proto.opt_macaddr(section, ifc, translate("Override MAC address"))
-
-
-mtu = section:taboption("advanced", Value, "mtu", translate("Override MTU"))
-mtu.placeholder = "1500"
-mtu.datatype = "max(9200)"
-
-
-metric = section:taboption("advanced", Value, "metric",
- translate("Use gateway metric"))
-
-metric.placeholder = "0"
-metric.datatype = "uinteger"
diff --git a/protocols/core/luasrc/tools/proto.lua b/protocols/core/luasrc/tools/proto.lua
deleted file mode 100644
index 4df02696b..000000000
--- a/protocols/core/luasrc/tools/proto.lua
+++ /dev/null
@@ -1,46 +0,0 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2012 Jo-Philipp Wich <xm@subsignal.org>
-
-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
-
-]]--
-
-module("luci.tools.proto", package.seeall)
-
-function opt_macaddr(s, ifc, ...)
- local v = luci.cbi.Value
- local o = s:taboption("advanced", v, "macaddr", ...)
-
- o.placeholder = ifc and ifc:mac()
- o.datatype = "macaddr"
-
- function o.cfgvalue(self, section)
- local w = ifc and ifc:get_wifinet()
- if w then
- return w:get("macaddr")
- else
- return v.cfgvalue(self, section)
- end
- end
-
- function o.write(self, section, value)
- local w = ifc and ifc:get_wifinet()
- if w then
- w:set("macaddr", value)
- elseif value then
- v.write(self, section, value)
- else
- v.remove(self, section)
- end
- end
-
- function o.remove(self, section)
- self:write(section, nil)
- end
-end