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"))
25 dl = s:option(Value, "download", translate("Downlink"), "kbit/s")
26 dl.datatype = "and(uinteger,min(1))"
28 ul = s:option(Value, "upload", translate("Uplink"), "kbit/s")
29 ul.datatype = "and(uinteger,min(1))"
31 s = m:section(TypedSection, "classify")
32 s.template = "cbi/tblsection"
38 t = s:option(ListValue, "target")
39 t:value("Priority", translate("priority"))
40 t:value("Express", translate("express"))
41 t:value("Normal", translate("normal"))
42 t:value("Bulk", translate("low"))
45 srch = s:option(Value, "srchost")
47 srch:value("", translate("all"))
48 wa.cbi_add_knownips(srch)
50 dsth = s:option(Value, "dsthost")
52 dsth:value("", translate("all"))
53 wa.cbi_add_knownips(dsth)
55 l7 = s:option(ListValue, "layer7", translate("Service"))
57 l7:value("", translate("all"))
59 local pats = io.popen("find /etc/l7-protocols/ -type f -name '*.pat'")
64 if not l then break end
66 l = l:match("([^/]+)%.pat$")
74 p = s:option(ListValue, "proto", translate("Protocol"))
75 p:value("", translate("all"))
78 p:value("icmp", "ICMP")
81 ports = s:option(Value, "ports", translate("Ports"))
83 ports:value("", translate("allf", translate("all")))
85 bytes = s:option(Value, "connbytes", translate("qos_connbytes"))