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(Value, "download", nil, "kb/s")
30 s:option(Value, "upload", nil, "kb/s")
32 s = m:section(TypedSection, "classify")
33 s.template = "cbi/tblsection"
37 t = s:option(ListValue, "target")
38 t:value("Priority", translate("qos_priority"))
39 t:value("Express", translate("qos_express"))
40 t:value("Normal", translate("qos_normal"))
41 t:value("Bulk", translate("qos_bulk"))
44 srch = s:option(Value, "srchost")
46 srch:value("", translate("all"))
47 luci.tools.webadmin.cbi_add_knownips(srch)
49 dsth = s:option(Value, "dsthost")
51 dsth:value("", translate("all"))
52 luci.tools.webadmin.cbi_add_knownips(dsth)
54 l7 = s:option(ListValue, "layer7", translate("service"))
56 l7:value("", translate("all"))
57 local pats = luci.fs.dir("/etc/l7-protocols")
59 for i,f in ipairs(pats) do
60 if f:sub(-4) == ".pat" then
61 l7:value(f:sub(1, #f-4))
66 p2p = s:option(ListValue, "ipp2p", "P2P")
68 p2p:value("all", translate("all"))
69 p2p:value("bit", "BitTorrent")
70 p2p:value("dc", "DirectConnect")
71 p2p:value("edk", "eDonkey")
72 p2p:value("gnu", "Gnutella")
73 p2p:value("kazaa", "Kazaa")
76 p = s:option(ListValue, "proto", translate("protocol"))
77 p:value("", translate("all"))
80 p:value("icmp", "ICMP")
83 ports = s:option(Value, "ports", translate("ports"))
85 ports:value("", translate("allf", translate("all")))