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"
34 t = s:option(ListValue, "target")
35 t:value("Priority", translate("priority"))
36 t:value("Express", translate("express"))
37 t:value("Normal", translate("normal"))
38 t:value("Bulk", translate("low"))
41 srch = s:option(Value, "srchost")
43 srch:value("", translate("all"))
44 wa.cbi_add_knownips(srch)
46 dsth = s:option(Value, "dsthost")
48 dsth:value("", translate("all"))
49 wa.cbi_add_knownips(dsth)
51 l7 = s:option(ListValue, "layer7", translate("Service"))
53 l7:value("", translate("all"))
55 local pats = io.popen("find /etc/l7-protocols/ -type f -name '*.pat'")
60 if not l then break end
62 l = l:match("([^/]+)%.pat$")
70 p = s:option(ListValue, "proto", translate("Protocol"))
71 p:value("", translate("all"))
74 p:value("icmp", "ICMP")
77 ports = s:option(Value, "ports", translate("Ports"))
79 ports:value("", translate("allf", translate("all")))
81 bytes = s:option(Value, "connbytes", translate("qos_connbytes"))