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"
20 s = m:section(TypedSection, "interface", translate("interfaces"))
24 s:option(Flag, "enabled", translate("enable"))
26 c = s:option(ListValue, "classgroup")
27 c:value("Default", "standard")
30 s:option(Flag, "overhead")
32 s:option(Flag, "halfduplex")
34 s:option(Value, "download", nil, "kb/s")
36 s:option(Value, "upload", nil, "kb/s")
38 s = m:section(TypedSection, "classify")
39 s.template = "cbi/tblsection"
43 t = s:option(ListValue, "target")
44 t:value("Priority", translate("qos_priority"))
45 t:value("Express", translate("qos_express"))
46 t:value("Normal", translate("qos_normal"))
47 t:value("Bulk", translate("qos_bulk"))
50 srch = s:option(Value, "srchost")
52 srch:value("", translate("all"))
53 wa.cbi_add_knownips(srch)
55 dsth = s:option(Value, "dsthost")
57 dsth:value("", translate("all"))
58 wa.cbi_add_knownips(dsth)
60 l7 = s:option(ListValue, "layer7", translate("service"))
62 l7:value("", translate("all"))
63 local pats = fs.dir("/etc/l7-protocols")
66 if f:sub(-4) == ".pat" then
67 l7:value(f:sub(1, #f-4))
72 p = s:option(Value, "proto", translate("protocol"))
73 p:value("", translate("all"))
76 p:value("icmp", "ICMP")
79 ports = s:option(Value, "ports", translate("ports"))
81 ports:value("", translate("allf", translate("all")))
83 bytes = s:option(Value, "connbytes", translate("qos_connbytes"))