Bläddra i källkod

version updated to 1.4-2 (mwan3 1.6 compatible)

new mwan3 1.6 rule options added:
-sticky
-timeout
-ipset
Aedan Renner 9 år sedan
förälder
incheckning
2eaff113bd

+ 2
- 2
net/mwan3-luci/Makefile Visa fil

@@ -8,8 +8,8 @@
8 8
 include $(TOPDIR)/rules.mk
9 9
 
10 10
 PKG_NAME:=luci-app-mwan3
11
-PKG_VERSION:=1.3
12
-PKG_RELEASE:=5
11
+PKG_VERSION:=1.4
12
+PKG_RELEASE:=2
13 13
 PKG_MAINTAINER:=Aedan Renner <chipdankly@gmail.com>
14 14
 PKG_LICENSE:=GPLv2
15 15
 

+ 33
- 0
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/rule.lua Visa fil

@@ -88,6 +88,39 @@ proto = mwan_rule:option(DummyValue, "proto", translate("Protocol"))
88 88
 		return self.map:get(s, "proto") or "all"
89 89
 	end
90 90
 
91
+sticky = mwan_rule:option(DummyValue, "sticky", translate("Sticky"))
92
+	sticky.rawhtml = true
93
+	function sticky.cfgvalue(self, s)
94
+		if self.map:get(s, "sticky") == "1" then
95
+			stickied = 1
96
+			return "Yes"
97
+		else
98
+			stickied = nil
99
+			return "No"
100
+		end
101
+	end
102
+
103
+timeout = mwan_rule:option(DummyValue, "timeout", translate("Sticky timeout"))
104
+	timeout.rawhtml = true
105
+	function timeout.cfgvalue(self, s)
106
+		if stickied then
107
+			local timeoutValue = self.map:get(s, "timeout")
108
+			if timeoutValue then
109
+				return timeoutValue .. "s"
110
+			else
111
+				return "600s"
112
+			end
113
+		else
114
+			return "&#8212;"
115
+		end
116
+	end
117
+
118
+ipset = mwan_rule:option(DummyValue, "ipset", translate("IPset"))
119
+	ipset.rawhtml = true
120
+	function ipset.cfgvalue(self, s)
121
+		return self.map:get(s, "ipset") or "&#8212;"
122
+	end
123
+
91 124
 use_policy = mwan_rule:option(DummyValue, "use_policy", translate("Policy assigned"))
92 125
 	use_policy.rawhtml = true
93 126
 	function use_policy.cfgvalue(self, s)

+ 13
- 0
net/mwan3-luci/files/usr/lib/lua/luci/model/cbi/mwan/ruleconfig.lua Visa fil

@@ -81,6 +81,19 @@ proto = mwan_rule:option(Value, "proto", translate("Protocol"),
81 81
 	proto:value("esp")
82 82
 	cbiAddProtocol(proto)
83 83
 
84
+sticky = mwan_rule:option(ListValue, "sticky", translate("Sticky"),
85
+	translate("Traffic from the same source IP address that previously matched this rule within the sticky timeout period will use the same WAN interface"))
86
+	sticky.default = "0"
87
+	sticky:value("1", translate("Yes"))
88
+	sticky:value("0", translate("No"))
89
+
90
+timeout = mwan_rule:option(Value, "timeout", translate("Sticky timeout"),
91
+	translate("Seconds. Acceptable values: 1-1000000. Defaults to 600 if not set"))
92
+	timeout.datatype = "range(1, 1000000)"
93
+
94
+ipset = mwan_rule:option(Value, "ipset", translate("IPset"),
95
+	translate("Name of IPset rule. Requires IPset rule in /etc/dnsmasq.conf (eg \"ipset=/youtube.com/youtube\")"))
96
+
84 97
 use_policy = mwan_rule:option(Value, "use_policy", translate("Policy assigned"))
85 98
 	cbiAddPolicy(use_policy)
86 99
 	use_policy:value("unreachable", translate("unreachable (reject)"))