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"))
27 e = s:option(Flag, "enabled", translate("Enable"))
30 c = s:option(ListValue, "classgroup", translate("Classification group"))
31 c:value("Default", translate("default"))
34 s:option(Flag, "overhead", translate("Calculate overhead"))
36 s:option(Flag, "halfduplex", translate("Half-duplex"))
38 s:option(Value, "download", translate("Download speed (kbit/s)"))
40 s:option(Value, "upload", translate("Upload speed (kbit/s)"))
42 s = m:section(TypedSection, "classify", translate("Classification Rules"))
43 s.template = "cbi/tblsection"
47 t = s:option(ListValue, "target", translate("Target"))
48 t:value("Priority", translate("priority"))
49 t:value("Express", translate("express"))
50 t:value("Normal", translate("normal"))
51 t:value("Bulk", translate("low"))
54 srch = s:option(Value, "srchost", translate("Source host"))
56 srch:value("", translate("all"))
57 wa.cbi_add_knownips(srch)
59 dsth = s:option(Value, "dsthost", translate("Destination host"))
61 dsth:value("", translate("all"))
62 wa.cbi_add_knownips(dsth)
64 l7 = s:option(ListValue, "layer7", translate("Service"))
66 l7:value("", translate("all"))
67 local pats = fs.glob("/etc/l7-protocols/*/*.pat")
70 f = f:match("([^/]+)%.pat$")
77 p = s:option(Value, "proto", translate("Protocol"))
78 p:value("", translate("all"))
81 p:value("icmp", "ICMP")
84 ports = s:option(Value, "ports", translate("Ports"))
86 ports:value("", translate("all"))
88 bytes = s:option(Value, "connbytes", translate("Number of bytes"))