2 LuCI - Lua Configuration Interface
4 Copyright 2008 Steven Barth <steven@midlink.org>
5 Copyright 2008 Jo-Philipp Wich <xm@leipzig.freifunk.net>
7 Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
11 http://www.apache.org/licenses/LICENSE-2.0
16 local wa = require "luci.tools.webadmin"
17 local fs = require "nixio.fs"
21 s = m:section(NamedSection, "wan", "interface", translate("Internet Connection"))
23 s:option(Flag, "enabled", translate("Quality of Service"))
24 s:option(Value, "download", translate("Downlink"), "kbit/s")
25 s:option(Value, "upload", translate("Uplink"), "kbit/s")
27 s = m:section(TypedSection, "classify")
28 s.template = "cbi/tblsection"
33 t = s:option(ListValue, "target")
34 t:value("Priority", translate("priority"))
35 t:value("Express", translate("express"))
36 t:value("Normal", translate("normal"))
37 t:value("Bulk", translate("low"))
40 srch = s:option(Value, "srchost")
42 srch:value("", translate("all"))
43 wa.cbi_add_knownips(srch)
45 dsth = s:option(Value, "dsthost")
47 dsth:value("", translate("all"))
48 wa.cbi_add_knownips(dsth)
50 l7 = s:option(ListValue, "layer7", translate("Service"))
52 l7:value("", translate("all"))
54 local pats = io.popen("find /etc/l7-protocols/ -type f -name '*.pat'")
59 if not l then break end
61 l = l:match("([^/]+)%.pat$")
69 p = s:option(ListValue, "proto", translate("Protocol"))
70 p:value("", translate("all"))
73 p:value("icmp", "ICMP")
76 ports = s:option(Value, "ports", translate("Ports"))
78 ports:value("", translate("allf", translate("all")))
80 bytes = s:option(Value, "connbytes", translate("qos_connbytes"))