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 e = s:option(Flag, "enabled", translate("enable"))
27 c = s:option(ListValue, "classgroup")
28 c:value("Default", "standard")
31 s:option(Flag, "overhead")
33 s:option(Flag, "halfduplex")
35 s:option(Value, "download", nil, "kb/s")
37 s:option(Value, "upload", nil, "kb/s")
39 s = m:section(TypedSection, "classify")
40 s.template = "cbi/tblsection"
44 t = s:option(ListValue, "target")
45 t:value("Priority", translate("qos_priority"))
46 t:value("Express", translate("qos_express"))
47 t:value("Normal", translate("qos_normal"))
48 t:value("Bulk", translate("qos_bulk"))
51 srch = s:option(Value, "srchost")
53 srch:value("", translate("all"))
54 wa.cbi_add_knownips(srch)
56 dsth = s:option(Value, "dsthost")
58 dsth:value("", translate("all"))
59 wa.cbi_add_knownips(dsth)
61 l7 = s:option(ListValue, "layer7", translate("service"))
63 l7:value("", translate("all"))
64 local pats = fs.dir("/etc/l7-protocols")
67 if f:sub(-4) == ".pat" then
68 l7:value(f:sub(1, #f-4))
73 p = s:option(Value, "proto", translate("protocol"))
74 p:value("", translate("all"))
77 p:value("icmp", "ICMP")
80 ports = s:option(Value, "ports", translate("ports"))
82 ports:value("", translate("allf", translate("all")))
84 bytes = s:option(Value, "connbytes", translate("qos_connbytes"))