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"))
23 s:option(Flag, "enabled", translate("enable"))
25 c = s:option(ListValue, "classgroup")
26 c:value("Default", "standard")
29 s:option(Flag, "overhead")
31 s:option(Flag, "halfduplex")
33 s:option(Value, "download", nil, "kb/s")
35 s:option(Value, "upload", nil, "kb/s")
37 s = m:section(TypedSection, "classify")
38 s.template = "cbi/tblsection"
42 t = s:option(ListValue, "target")
43 t:value("Priority", translate("priority"))
44 t:value("Express", translate("express"))
45 t:value("Normal", translate("normal"))
46 t:value("Bulk", translate("low"))
49 srch = s:option(Value, "srchost")
51 srch:value("", translate("all"))
52 wa.cbi_add_knownips(srch)
54 dsth = s:option(Value, "dsthost")
56 dsth:value("", translate("all"))
57 wa.cbi_add_knownips(dsth)
59 l7 = s:option(ListValue, "layer7", translate("Service"))
61 l7:value("", translate("all"))
62 local pats = fs.dir("/etc/l7-protocols")
65 if f:sub(-4) == ".pat" then
66 l7:value(f:sub(1, #f-4))
71 p = s:option(Value, "proto", translate("Protocol"))
72 p:value("", translate("all"))
75 p:value("icmp", "ICMP")
78 ports = s:option(Value, "ports", translate("Ports"))
80 ports:value("", translate("allf", translate("all")))
82 bytes = s:option(Value, "connbytes", translate("qos_connbytes"))