mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Add a LuCI interface for MPTCP
This commit is contained in:
parent
c2312ec7fe
commit
cb6610f6bc
5 changed files with 66 additions and 1 deletions
14
luci-app-mptcp/Makefile
Normal file
14
luci-app-mptcp/Makefile
Normal file
|
@ -0,0 +1,14 @@
|
|||
#
|
||||
# Copyright (C) 2018 Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
|
||||
#
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=LuCI Support for MPTCP
|
||||
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
|
||||
include ../luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
7
luci-app-mptcp/luasrc/controller/mptcp.lua
Normal file
7
luci-app-mptcp/luasrc/controller/mptcp.lua
Normal file
|
@ -0,0 +1,7 @@
|
|||
module("luci.controller.mptcp", package.seeall)
|
||||
|
||||
function index()
|
||||
entry(
|
||||
{"admin", "network", "mptcp"},
|
||||
cbi("mptcp"), _("MPTCP"), 55)
|
||||
end
|
43
luci-app-mptcp/luasrc/model/cbi/mptcp.lua
Normal file
43
luci-app-mptcp/luasrc/model/cbi/mptcp.lua
Normal file
|
@ -0,0 +1,43 @@
|
|||
local net = require "luci.model.network".init()
|
||||
local sys = require "luci.sys"
|
||||
local ifaces = sys.net:devices()
|
||||
local m, s, o
|
||||
|
||||
m = Map("network", translate("MPTCP"), translate("Networks MPTCP settings"))
|
||||
|
||||
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"))
|
||||
mtcpck:value("enable", translate("enable"))
|
||||
mtcpck:value("disable", translate("disable"))
|
||||
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"))
|
||||
mtcppm:value("blinder", translate("blinder"))
|
||||
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"))
|
||||
local mtcpsyn = s:option(Value, "mptcp_syn_retries", translate("Multipath TCP SYN retries"))
|
||||
mtcpsyn.datatype = "uinteger"
|
||||
mtcpsyn.rmempty = false
|
||||
local congestion = s:option(ListValue, "congestion", translate("Congestion Control"))
|
||||
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
|
||||
|
||||
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
|
Loading…
Add table
Add a link
Reference in a new issue