aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAedan Renner <chipdankly@gmail.com>2015-03-09 15:53:57 -0700
committerAedan Renner <chipdankly@gmail.com>2015-03-09 15:53:57 -0700
commit2eaff113bd511f7def4d077465132163a37e8b53 (patch)
treee3b9082114d7cb17b195d5437e5509b072e6d5d3
parent94e7fbdda1c4ea2b09128428d373c6fa0f14b76c (diff)
version updated to 1.4-2 (mwan3 1.6 compatible)
new mwan3 1.6 rule options added: -sticky -timeout -ipset
-rw-r--r--net/mwan3-luci/Makefile4
-rw-r--r--net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/rule.lua33
-rw-r--r--net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/ruleconfig.lua13
3 files changed, 48 insertions, 2 deletions
diff --git a/net/mwan3-luci/Makefile b/net/mwan3-luci/Makefile
index eed234875..6656806b5 100644
--- a/net/mwan3-luci/Makefile
+++ b/net/mwan3-luci/Makefile
@@ -8,8 +8,8 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-mwan3
-PKG_VERSION:=1.3
-PKG_RELEASE:=5
+PKG_VERSION:=1.4
+PKG_RELEASE:=2
PKG_MAINTAINER:=Aedan Renner <chipdankly@gmail.com>
PKG_LICENSE:=GPLv2
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/rule.lua b/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/rule.lua
index bf524d1df..cbd8bdd03 100644
--- a/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/rule.lua
+++ b/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/rule.lua
@@ -88,6 +88,39 @@ proto = mwan_rule:option(DummyValue, "proto", translate("Protocol"))
return self.map:get(s, "proto") or "all"
end
+sticky = mwan_rule:option(DummyValue, "sticky", translate("Sticky"))
+ sticky.rawhtml = true
+ function sticky.cfgvalue(self, s)
+ if self.map:get(s, "sticky") == "1" then
+ stickied = 1
+ return "Yes"
+ else
+ stickied = nil
+ return "No"
+ end
+ end
+
+timeout = mwan_rule:option(DummyValue, "timeout", translate("Sticky timeout"))
+ timeout.rawhtml = true
+ function timeout.cfgvalue(self, s)
+ if stickied then
+ local timeoutValue = self.map:get(s, "timeout")
+ if timeoutValue then
+ return timeoutValue .. "s"
+ else
+ return "600s"
+ end
+ else
+ return "&#8212;"
+ end
+ end
+
+ipset = mwan_rule:option(DummyValue, "ipset", translate("IPset"))
+ ipset.rawhtml = true
+ function ipset.cfgvalue(self, s)
+ return self.map:get(s, "ipset") or "&#8212;"
+ end
+
use_policy = mwan_rule:option(DummyValue, "use_policy", translate("Policy assigned"))
use_policy.rawhtml = true
function use_policy.cfgvalue(self, s)
diff --git a/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/ruleconfig.lua b/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/ruleconfig.lua
index 831ab35b9..d880a72e2 100644
--- a/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/ruleconfig.lua
+++ b/net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/ruleconfig.lua
@@ -81,6 +81,19 @@ proto = mwan_rule:option(Value, "proto", translate("Protocol"),
proto:value("esp")
cbiAddProtocol(proto)
+sticky = mwan_rule:option(ListValue, "sticky", translate("Sticky"),
+ translate("Traffic from the same source IP address that previously matched this rule within the sticky timeout period will use the same WAN interface"))
+ sticky.default = "0"
+ sticky:value("1", translate("Yes"))
+ sticky:value("0", translate("No"))
+
+timeout = mwan_rule:option(Value, "timeout", translate("Sticky timeout"),
+ translate("Seconds. Acceptable values: 1-1000000. Defaults to 600 if not set"))
+ timeout.datatype = "range(1, 1000000)"
+
+ipset = mwan_rule:option(Value, "ipset", translate("IPset"),
+ translate("Name of IPset rule. Requires IPset rule in /etc/dnsmasq.conf (eg \"ipset=/youtube.com/youtube\")"))
+
use_policy = mwan_rule:option(Value, "use_policy", translate("Policy assigned"))
cbiAddPolicy(use_policy)
use_policy:value("unreachable", translate("unreachable (reject)"))