2018-03-21 16:30:44 +00:00
|
|
|
local net = require "luci.model.network".init()
|
|
|
|
local sys = require "luci.sys"
|
|
|
|
local ifaces = sys.net:devices()
|
|
|
|
local m, s, o
|
|
|
|
|
2018-07-10 15:36:28 +00:00
|
|
|
m = Map("network", translate("MPTCP"), translate("Networks MPTCP settings. Visit <a href='http://multipath-tcp.org/pmwiki.php/Users/ConfigureMPTCP'>http://multipath-tcp.org/pmwiki.php/Users/ConfigureMPTCP</a> for help."))
|
2018-03-21 16:30:44 +00:00
|
|
|
|
2019-04-22 19:49:26 +00:00
|
|
|
local unameinfo = nixio.uname() or { }
|
|
|
|
|
2018-03-21 16:30:44 +00:00
|
|
|
s = m:section(TypedSection, "globals")
|
|
|
|
local mtcpg = s:option(ListValue, "multipath", translate("Multipath TCP"))
|
|
|
|
mtcpg:value("enable", translate("enable"))
|
|
|
|
mtcpg:value("disable", translate("disable"))
|
|
|
|
local mtcpck = s:option(ListValue, "mptcp_checksum", translate("Multipath TCP checksum"))
|
2018-06-08 17:07:53 +00:00
|
|
|
mtcpck:value(1, translate("enable"))
|
|
|
|
mtcpck:value(0, translate("disable"))
|
2018-12-28 12:18:34 +00:00
|
|
|
local mtcpck = s:option(ListValue, "mptcp_debug", translate("Multipath Debug"))
|
|
|
|
mtcpck:value(1, translate("enable"))
|
|
|
|
mtcpck:value(0, translate("disable"))
|
2018-03-21 16:30:44 +00:00
|
|
|
local mtcppm = s:option(ListValue, "mptcp_path_manager", translate("Multipath TCP path-manager"))
|
|
|
|
mtcppm:value("default", translate("default"))
|
|
|
|
mtcppm:value("fullmesh", translate("fullmesh"))
|
|
|
|
mtcppm:value("ndiffports", translate("ndiffports"))
|
2018-07-01 15:46:23 +00:00
|
|
|
mtcppm:value("binder", translate("binder"))
|
2019-04-22 19:49:26 +00:00
|
|
|
if uname.release:sub(1,4) == "4.19" then
|
|
|
|
mtcppm:value("netlink", translate("Netlink"))
|
|
|
|
end
|
2018-03-21 16:30:44 +00:00
|
|
|
local mtcpsch = s:option(ListValue, "mptcp_scheduler", translate("Multipath TCP scheduler"))
|
|
|
|
mtcpsch:value("default", translate("default"))
|
|
|
|
mtcpsch:value("roundrobin", translate("round-robin"))
|
|
|
|
mtcpsch:value("redundant", translate("redundant"))
|
2019-04-22 19:49:26 +00:00
|
|
|
if uname.release:sub(1,4) == "4.19" then
|
|
|
|
mtcpsch:value("blest", translate("BLEST"))
|
|
|
|
end
|
2018-03-21 16:30:44 +00:00
|
|
|
local mtcpsyn = s:option(Value, "mptcp_syn_retries", translate("Multipath TCP SYN retries"))
|
|
|
|
mtcpsyn.datatype = "uinteger"
|
|
|
|
mtcpsyn.rmempty = false
|
2019-01-15 20:44:07 +00:00
|
|
|
local congestion = s:option(ListValue, "congestion", translate("Congestion Control"),translate("Default is bbr"))
|
2018-03-21 16:30:44 +00:00
|
|
|
local availablecong = sys.exec("sysctl net.ipv4.tcp_available_congestion_control | awk -F'= ' '{print $NF}'")
|
|
|
|
for cong in string.gmatch(availablecong, "[^%s]+") do
|
|
|
|
congestion:value(cong, translate(cong))
|
|
|
|
end
|
2018-06-08 17:07:53 +00:00
|
|
|
local mtcpfm_subflows = s:option(Value, "mptcp_fullmesh_num_subflows", translate("Fullmesh subflows for each pair of IP addresses"))
|
|
|
|
mtcpfm_subflows.datatype = "uinteger"
|
|
|
|
mtcpfm_subflows.rmempty = false
|
2018-06-16 19:35:17 +00:00
|
|
|
local mtcpfm_createonerr = s:option(ListValue, "mptcp_fullmesh_create_on_err", translate("Re-create fullmesh subflows after a timeout"))
|
2018-06-08 17:07:53 +00:00
|
|
|
mtcpfm_createonerr:value(1, translate("enable"))
|
|
|
|
mtcpfm_createonerr:value(0, translate("disable"))
|
|
|
|
|
|
|
|
local mtcpnd_subflows = s:option(Value, "mptcp_ndiffports_num_subflows", translate("ndiffports subflows number"))
|
|
|
|
mtcpnd_subflows.datatype = "uinteger"
|
|
|
|
mtcpnd_subflows.rmempty = false
|
2018-03-21 16:30:44 +00:00
|
|
|
|
|
|
|
s = m:section(TypedSection, "interface", translate("Interfaces Settings"))
|
|
|
|
mptcp = s:option(ListValue, "multipath", translate("Multipath TCP"), translate("One interface must be set as master"))
|
|
|
|
mptcp:value("on", translate("enabled"))
|
|
|
|
mptcp:value("off", translate("disabled"))
|
|
|
|
mptcp:value("master", translate("master"))
|
|
|
|
mptcp:value("backup", translate("backup"))
|
|
|
|
mptcp:value("handover", translate("handover"))
|
|
|
|
mptcp.default = "off"
|
|
|
|
|
|
|
|
|
|
|
|
return m
|