2 LuCI - Lua Configuration Interface
4 Copyright 2008 Steven Barth <steven@midlink.org>
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
14 require("luci.tools.webadmin")
17 s = m:section(TypedSection, "interface", translate("interfaces"))
20 s:option(Flag, "enabled", translate("enable"))
22 c = s:option(ListValue, "classgroup")
23 c:value("Default", "standard")
26 s:option(Flag, "overhead")
28 s:option(Flag, "halfduplex")
30 s:option(Value, "download", nil, "kb/s")
32 s:option(Value, "upload", nil, "kb/s")
34 s = m:section(TypedSection, "classify")
35 s.template = "cbi/tblsection"
39 t = s:option(ListValue, "target")
40 t:value("Priority", translate("qos_priority"))
41 t:value("Express", translate("qos_express"))
42 t:value("Normal", translate("qos_normal"))
43 t:value("Bulk", translate("qos_bulk"))
46 srch = s:option(Value, "srchost")
48 srch:value("", translate("all"))
49 luci.tools.webadmin.cbi_add_knownips(srch)
51 dsth = s:option(Value, "dsthost")
53 dsth:value("", translate("all"))
54 luci.tools.webadmin.cbi_add_knownips(dsth)
56 l7 = s:option(ListValue, "layer7", translate("service"))
58 l7:value("", translate("all"))
59 local pats = luci.fs.dir("/etc/l7-protocols")
61 for i,f in ipairs(pats) do
62 if f:sub(-4) == ".pat" then
63 l7:value(f:sub(1, #f-4))
68 p = s:option(Value, "proto", translate("protocol"))
69 p:value("", translate("all"))
72 p:value("icmp", "ICMP")
75 ports = s:option(Value, "ports", translate("ports"))
77 ports:value("", translate("allf", translate("all")))
79 bytes = s:option(Value, "connbytes", translate("qos_connbytes"))