function index()
require("luci.i18n").loadc("luci-fw")
local i18n = luci.i18n.translate
+
+ local nodes = {}
- if registered("admin") then
- entry({"admin", "network", "portfw"}, cbi("luci_fw/portfw"), i18n("fw_portfw", "Portweiterleitung"), 70).i18n = "luci-fw"
- entry({"admin", "network", "routing"}, cbi("luci_fw/routing"), i18n("fw_routing", "Routing"), 73).i18n = "luci-fw"
- entry({"admin", "network", "firewall"}, cbi("luci_fw/firewall"), i18n("fw_fw", "Firewall"), 76).i18n = "luci-fw"
- end
+ table.insert(nodes, entry({"admin", "network", "portfw"}, cbi("luci_fw/portfw"), i18n("fw_portfw", "Portweiterleitung"), 70))
+ table.insert(nodes, entry({"admin", "network", "routing"}, cbi("luci_fw/routing"), i18n("fw_routing", "Routing"), 73))
+ table.insert(nodes, entry({"admin", "network", "firewall"}, cbi("luci_fw/firewall"), i18n("fw_fw", "Firewall"), 76))
+
+ table.insert(nodes, entry({"mini", "network", "portfw"}, cbi("luci_fw/miniportfw"), i18n("fw_portfw", "Portweiterleitung"), 70))
- if registered("mini") then
- entry({"mini", "network", "portfw"}, cbi("luci_fw/miniportfw"), i18n("fw_portfw", "Portweiterleitung"), 70).i18n = "luci-fw"
- end
+ for i,n in ipairs(nodes) do
+ n.i18n = "luci-fw"
+ n.dependent = true
+ end
end
\ No newline at end of file
return
end
- entry({"admin", "network", "qos"}, cbi("qos/qos"), "QoS").i18n = "qos"
+ local page = entry({"admin", "network", "qos"}, cbi("qos/qos"), "QoS")
+ page.i18n = "qos"
+ page.dependent = true
+
+
+ local page = entry({"mini", "network", "qos"}, cbi("qos/qosmini"), "QoS")
+ page.i18n = "qos"
+ page.dependent = true
end
\ No newline at end of file
qos_interface_overhead = "Overheadberechnung"
qos_interface_download = "Downlink"
qos_interface_upload = "Uplink"
-qos_classify = "Klassifizierung"
-qos_classify_target = "Klasse"
+qos_classify = "Priorisierung"
+qos_classify_target = "Priorität"
qos_classify_srchost = "Quelladresse"
qos_classify_srchost_dest = "Quellnetz / Quellhost"
qos_classify_dsthost = "Zieladresse"
qos_classify_dsthost_dest = "Zielnetz / Zielhost"
-qos_classify_portrange = "Portbereich"
\ No newline at end of file
+qos_classify_portrange = "Portbereich"
+qos_bulk = "niedrig"
+qos_normal = "normal"
+qos_express = "express"
+qos_priority = "priorisiert"
\ No newline at end of file
qos_interface_overhead = "Calculate Overhead"
qos_interface_download = "Downlink"
qos_interface_upload = "Uplink"
-qos_classify = "Classification"
-qos_classify_target = "Class"
+qos_classify = "Prioritization"
+qos_classify_target = "Priority"
qos_classify_srchost = "Source address"
qos_classify_srchost_dest = "source network / source host"
qos_classify_dsthost = "Target address"
qos_classify_dsthost_dest = "target network / target host"
-qos_classify_portrange = "portrange"
\ No newline at end of file
+qos_classify_portrange = "portrange"
+qos_bulk = "low"
+qos_normal = "normal"
+qos_express = "express"
+qos_priority = "priority"
\ No newline at end of file
s.addremove = true
t = s:option(ListValue, "target")
-t:value("Priority")
-t:value("Express")
-t:value("Normal")
-t:value("Bulk")
+t:value("Priority", translate("qos_priority"))
+t:value("Express", translate("qos_express"))
+t:value("Normal", translate("qos_normal"))
+t:value("Bulk", translate("qos_bulk"))
t.default = "Normal"
s:option(Value, "srchost").optional = true
s:option(Value, "dsthost").optional = true
-s:option(Value, "layer7", "Layer 7").optional = true
+
+l7 = s:option(ListValue, "layer7", translate("service"))
+l7.optional = true
+l7:value("")
+local pats = luci.fs.dir("/etc/l7-protocols")
+if pats then
+ for i,f in ipairs(pats) do
+ if f:sub(-4) == ".pat" then
+ l7:value(f:sub(1, #f-4))
+ end
+ end
+end
p2p = s:option(ListValue, "ipp2p", "P2P")
p2p:value("")
--- /dev/null
+--[[
+LuCI - Lua Configuration Interface
+
+Copyright 2008 Steven Barth <steven@midlink.org>
+Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
+
+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("qos")
+
+s = m:section(NamedSection, "wan", "interface", translate("m_n_inet"))
+
+s:option(Flag, "enabled", translate("qos"))
+s:option(Value, "download", translate("qos_interface_download"), "kb/s")
+s:option(Value, "upload", translate("qos_interface_upload"), "kb/s")
+
+s = m:section(TypedSection, "classify")
+
+s.anonymous = true
+s.addremove = true
+
+t = s:option(ListValue, "target")
+t:value("Priority", translate("qos_priority"))
+t:value("Express", translate("qos_express"))
+t:value("Normal", translate("qos_normal"))
+t:value("Bulk", translate("qos_bulk"))
+t.default = "Normal"
+
+s:option(Value, "srchost").optional = true
+s:option(Value, "dsthost").optional = true
+
+l7 = s:option(ListValue, "layer7", translate("service"))
+l7.optional = true
+l7:value("")
+local pats = luci.fs.dir("/etc/l7-protocols")
+if pats then
+ for i,f in ipairs(pats) do
+ if f:sub(-4) == ".pat" then
+ l7:value(f:sub(1, #f-4))
+ end
+ end
+end
+
+p2p = s:option(ListValue, "ipp2p", "P2P")
+p2p:value("")
+p2p:value("all", translate("all"))
+p2p:value("bit", "BitTorrent")
+p2p:value("dc", "DirectConnect")
+p2p:value("edk", "eDonkey")
+p2p:value("gnu", "Gnutella")
+p2p:value("kazaa", "Kazaa")
+p2p.optional = true
+
+p = s:option(ListValue, "proto", translate("protocol"))
+p:value("")
+p:value("tcp", "TCP")
+p:value("udp", "UDP")
+p:value("icmp", "ICMP")
+p.optional = true
+
+s:option(Value, "ports", translate("port")).optional = true
+s:option(Value, "portrange").optional = true
+
+return m
\ No newline at end of file
define Package/luci-app-firewall
$(call Package/luci/webtemplate)
- DEPENDS+=+luci-mod-admin-full
+ DEPENDS+=+luci-mod-admin-core
TITLE:=Firewall and Portforwarding application
endef
define Package/luci-app-qos
$(call Package/luci/webtemplate)
- DEPENDS+=+luci-mod-admin-full +qos-scripts
+ DEPENDS+=+luci-mod-admin-core +qos-scripts
TITLE:=Quality of Service configuration module
endef
revert = "Revert"
save = "Save"
+service = "Service"
services = "Services"
settings = "Settings"
start = "Start"
revert = "Verwerfen"
save = "Speichern"
+service = "Dienst"
services = "Dienste"
settings = "Einstellungen"
start = "Start"
viewns.resource = luci.config.main.resourcebase
viewns.REQUEST_URI = luci.http.getenv("SCRIPT_NAME") .. (luci.http.getenv("PATH_INFO") or "")
+ if track.dependent then
+ local stat, err = pcall(assert, not track.auto)
+ if not stat then
+ error500(err)
+ return
+ end
+ end
+
if track.sysauth then
require("luci.sauth")
local def = (type(track.sysauth) == "string") and track.sysauth
return c
end
--- Checks whether a node exists
-function registered(...)
- local c = context.tree
-
- for k,v in ipairs(arg) do
- if not c.nodes[v] then
- return false
- end
-
- c = c.nodes[v]
- end
- return true
-end
-
-- Fetch a dispatching node
function node(...)
local c = context.tree
for k,v in ipairs(arg) do
if not c.nodes[v] then
- c.nodes[v] = {nodes={}}
+ c.nodes[v] = {nodes={}, auto=true}
end
c = c.nodes[v]
c.module = getfenv(2)._NAME
c.path = arg
+ c.auto = nil
return c
end