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
15 local wa = require "luci.tools.webadmin"
16 local fs = require "nixio.fs"
18 m = Map("qos", translate("Quality of Service"),
19 translate("With <abbr title=\"Quality of Service\">QoS</abbr> you " ..
20 "can prioritize network traffic selected by addresses, " ..
21 "ports or services."))
23 s = m:section(TypedSection, "interface", translate("Interfaces"))
26 s.template = "cbi/tblsection"
28 e = s:option(Flag, "enabled", translate("Enable"))
31 c = s:option(ListValue, "classgroup", translate("Classification group"))
32 c:value("Default", translate("default"))
35 s:option(Flag, "overhead", translate("Calculate overhead"))
37 s:option(Flag, "halfduplex", translate("Half-duplex"))
39 s:option(Value, "download", translate("Download speed (kbit/s)"))
41 s:option(Value, "upload", translate("Upload speed (kbit/s)"))
43 s = m:section(TypedSection, "classify", translate("Classification Rules"))
44 s.template = "cbi/tblsection"
48 t = s:option(ListValue, "target", translate("Target"))
49 t:value("Priority", translate("priority"))
50 t:value("Express", translate("express"))
51 t:value("Normal", translate("normal"))
52 t:value("Bulk", translate("low"))
55 srch = s:option(Value, "srchost", translate("Source host"))
57 srch:value("", translate("all"))
58 wa.cbi_add_knownips(srch)
60 dsth = s:option(Value, "dsthost", translate("Destination host"))
62 dsth:value("", translate("all"))
63 wa.cbi_add_knownips(dsth)
65 l7 = s:option(ListValue, "layer7", translate("Service"))
67 l7:value("", translate("all"))
69 local pats = io.popen("find /etc/l7-protocols/ -type f -name '*.pat'")
74 if not l then break end
76 l = l:match("([^/]+)%.pat$")
84 p = s:option(Value, "proto", translate("Protocol"))
85 p:value("", translate("all"))
88 p:value("icmp", "ICMP")
91 ports = s:option(Value, "ports", translate("Ports"))
93 ports:value("", translate("all"))
95 bytes = s:option(Value, "connbytes", translate("Number of bytes"))