mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 14:23:38 +00:00
add new ipk luci-app-flowoffload for kernel 4.14 fast path
This commit is contained in:
parent
1cc6ee0a6c
commit
2b808ba797
@ -17,7 +17,7 @@ DEFAULT_PACKAGES:=base-files libc libgcc busybox dropbear mtd uci opkg netifd fs
|
||||
iptables-mod-nat-extra kmod-nf-nathelper kmod-nf-nathelper-extra kmod-macvlan kmod-nft-offload block-mount automount \
|
||||
default-settings ipset-lists luci luci-app-ddns luci-app-sqm luci-app-upnp luci-app-adbyby-plus luci-app-autoreboot \
|
||||
luci-app-filetransfer luci-app-shadowsocksr-pro luci-app-usb-printer luci-app-vsftpd ddns-scripts_aliyun luci-app-xlnetacc \
|
||||
luci-app-pptp-server luci-app-ipsec-vpnd luci-app-vlmcsd luci-app-wifischedule luci-app-wol luci-app-sfe luci-app-nlbwmon
|
||||
luci-app-pptp-server luci-app-ipsec-vpnd luci-app-vlmcsd luci-app-wifischedule luci-app-wol luci-app-sfe luci-app-flowoffload luci-app-nlbwmon
|
||||
# For nas targets
|
||||
DEFAULT_PACKAGES.nas:=block-mount fdisk lsblk mdadm
|
||||
# For router targets
|
||||
|
17
package/lean/luci-app-flowoffload/Makefile
Normal file
17
package/lean/luci-app-flowoffload/Makefile
Normal file
@ -0,0 +1,17 @@
|
||||
# Copyright (C) 2016 Openwrt.org
|
||||
#
|
||||
# This is free software, licensed under the Apache License, Version 2.0 .
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
LUCI_TITLE:=LuCI support for Flow Offload
|
||||
LUCI_DEPENDS:=@LINUX_4_14
|
||||
LUCI_PKGARCH:=all
|
||||
PKG_VERSION:=1.0
|
||||
PKG_RELEASE:=1
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
# call BuildPackage - OpenWrt buildroot signature
|
||||
|
@ -0,0 +1,11 @@
|
||||
module("luci.controller.flowoffload", package.seeall)
|
||||
|
||||
function index()
|
||||
if not nixio.fs.access("/etc/config/flowoffload") then
|
||||
return
|
||||
end
|
||||
local page
|
||||
page = entry({"admin", "network", "flowoffload"}, cbi("flowoffload"), _(" Flow Offload ACC"), 101)
|
||||
page.i18n = "flowoffload"
|
||||
page.dependent = true
|
||||
end
|
@ -0,0 +1,25 @@
|
||||
local m,s,o
|
||||
local SYS = require "luci.sys"
|
||||
|
||||
|
||||
if SYS.call("iptables --list | grep FLOWOFFLOAD >/dev/null") == 0 then
|
||||
Status = translate("<strong><font color=\"green\">Linux Flow offload Forwarding Engine is Running</font></strong>")
|
||||
else
|
||||
Status = translate("<strong><font color=\"red\">Linux Flow offload Forwarding Engine is Not Running</font></strong>")
|
||||
end
|
||||
|
||||
m = Map("flowoffload")
|
||||
m.title = translate("Linux Flow Offload Forwarding Engine Settings")
|
||||
m.description = translate("Opensource Linux Flow Offload driver (Fast Path or HWNAT)")
|
||||
|
||||
s = m:section(TypedSection, "flowoffload", "")
|
||||
s.addremove = false
|
||||
s.anonymous = true
|
||||
s.description = translate(string.format("%s<br /><br />", Status))
|
||||
|
||||
enable = s:option(Flag, "enabled", translate("Enable"))
|
||||
enable.default = 0
|
||||
enable.rmempty = false
|
||||
|
||||
|
||||
return m
|
35
package/lean/luci-app-flowoffload/po/zh-cn/flowoffload.po
Normal file
35
package/lean/luci-app-flowoffload/po/zh-cn/flowoffload.po
Normal file
@ -0,0 +1,35 @@
|
||||
msgid "SFE Acceleration"
|
||||
msgstr "SFE 转发加速"
|
||||
|
||||
msgid "<strong><font color=\"green\">Shortcut Forwarding Engine is Running</font></strong>"
|
||||
msgstr "<strong><font color=\"green\">SFE 转发加速引擎正在运行</font></strong>"
|
||||
|
||||
msgid "<strong><font color=\"red\">Shortcut Forwarding Engine is Not Running</font></strong>"
|
||||
msgstr "<strong><font color=\"red\">SFE 转发加速引擎未运行</font></strong>"
|
||||
|
||||
msgid "Shortcut Forwarding Engine Acceleration Settings"
|
||||
msgstr "SFE 转发加速引擎设置"
|
||||
|
||||
msgid "Opensource Qualcomm Shortcut FE driver (Fast Path)"
|
||||
msgstr "来自高通开源的 Shortcut FE 转发加速引擎 (Fast Path)"
|
||||
|
||||
msgid "Enable"
|
||||
msgstr "启用"
|
||||
|
||||
msgid "Wireless Acceleration"
|
||||
msgstr "无线加速"
|
||||
|
||||
msgid "Enable Wireless Bridge Acceleration"
|
||||
msgstr "开启无线桥接加速"
|
||||
|
||||
msgid "IPv6 Acceleration"
|
||||
msgstr "IPv6 加速"
|
||||
|
||||
msgid "Enable IPv6 Acceleration"
|
||||
msgstr "开启IPv6加速"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,4 @@
|
||||
|
||||
config flowoffload 'config'
|
||||
option enabled '1'
|
||||
|
42
package/lean/luci-app-flowoffload/root/etc/init.d/flowoffload
Executable file
42
package/lean/luci-app-flowoffload/root/etc/init.d/flowoffload
Executable file
@ -0,0 +1,42 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (c) 2011-2015 OpenWrt.org
|
||||
|
||||
START=30
|
||||
|
||||
re=0
|
||||
|
||||
start(){
|
||||
enable=$(uci get flowoffload.config.enabled 2>/dev/null)
|
||||
if [ $enable -eq 1 ]; then
|
||||
echo "enable"
|
||||
sed -i '/FLOWOFFLOAD/d' /etc/firewall.user
|
||||
echo "iptables -I FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j FLOWOFFLOAD" >> /etc/firewall.user
|
||||
if [ $re -eq 0 ]; then
|
||||
echo $re
|
||||
/etc/init.d/firewall restart
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
stop(){
|
||||
echo "stop"
|
||||
iptables -D FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j FLOWOFFLOAD
|
||||
enable=$(uci get flowoffload.config.enabled 2>/dev/null)
|
||||
if [ $enable -ne 1 ]; then
|
||||
echo "disable"
|
||||
sed -i '/FLOWOFFLOAD/d' /etc/firewall.user
|
||||
if [ $re -ne 1 ]; then
|
||||
echo $re
|
||||
/etc/init.d/firewall restart
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
restart(){
|
||||
re=1
|
||||
stop
|
||||
start
|
||||
/etc/init.d/firewall restart
|
||||
}
|
||||
|
||||
|
13
package/lean/luci-app-flowoffload/root/etc/uci-defaults/flowoffload
Executable file
13
package/lean/luci-app-flowoffload/root/etc/uci-defaults/flowoffload
Executable file
@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete ucitrack.@flowoffload[-1]
|
||||
add ucitrack flowoffload
|
||||
set ucitrack.@flowoffload[-1].init=flowoffload
|
||||
commit ucitrack
|
||||
EOF
|
||||
|
||||
/etc/init.d/flowoffload enable
|
||||
|
||||
rm -f /tmp/luci-indexcache
|
||||
exit 0
|
Loading…
Reference in New Issue
Block a user