update 2023-06-21 23:38:59
This commit is contained in:
parent
8942b31aca
commit
53383276e6
|
@ -8,14 +8,14 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ddnsgo
|
||||
PKG_VERSION:=5.3.5
|
||||
PKG_VERSION:=5.3.6
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://github.com/jeessy2/ddns-go.git
|
||||
PKG_MIRROR_HASH:=deaa225aa4f0f5e329520a97632f38f6389d0abf27f1e3adcf249beddd1a5d74
|
||||
PKG_SOURCE_VERSION:=e283f7a9c84e3ebf61637d05150dc612ca489bb4
|
||||
PKG_MIRROR_HASH:=7b865a8b9618147514c4bb6220f02d2404ab5f6586e27797b717b4d7b61b81b6
|
||||
PKG_SOURCE_VERSION:=4d33865890bffebeebb1fe49f079d67c1d8c4625
|
||||
|
||||
PKG_LICENSE:=AGPL-3.0-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
msgid ""
|
||||
msgstr ""
|
||||
"PO-Revision-Date: 2023-02-20 15:36+0000\n"
|
||||
"Last-Translator: Nguyễn văn tuyên <admin@tuyen.vn>\n"
|
||||
"PO-Revision-Date: 2023-06-21 04:37+0000\n"
|
||||
"Last-Translator: Quy <haonguyen93056@gmail.com>\n"
|
||||
"Language-Team: Vietnamese <https://hosted.weblate.org/projects/openwrt/"
|
||||
"luciapplicationsnft-qos/vi/>\n"
|
||||
"Language: vi\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=1; plural=0;\n"
|
||||
"X-Generator: Weblate 4.16-dev\n"
|
||||
"X-Generator: Weblate 4.18.1\n"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:136
|
||||
#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:155
|
||||
|
@ -26,156 +26,157 @@ msgstr "Bình luận"
|
|||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:50
|
||||
msgid "Default Download Rate"
|
||||
msgstr ""
|
||||
msgstr "Tốc độ tải xuống mặc định"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:55
|
||||
msgid "Default Download Unit"
|
||||
msgstr ""
|
||||
msgstr "Đơn vị tải xuống mặc định"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:116
|
||||
msgid "Default Network Interface"
|
||||
msgstr ""
|
||||
msgstr "Giao diện mạng mặc định"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:62
|
||||
msgid "Default Upload Rate"
|
||||
msgstr ""
|
||||
msgstr "Tốc độ tải lên mặc định"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:67
|
||||
msgid "Default Upload Unit"
|
||||
msgstr ""
|
||||
msgstr "Đơn vị tải lên mặc định"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:55
|
||||
msgid "Default unit for download rate"
|
||||
msgstr ""
|
||||
msgstr "Đơn vị mặc định cho tốc độ tải xuống"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:67
|
||||
msgid "Default unit for upload rate"
|
||||
msgstr ""
|
||||
msgstr "Đơn vị mặc định cho tốc độ tải lên"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:77
|
||||
msgid "Default value for download bandwidth"
|
||||
msgstr ""
|
||||
msgstr "Giá trị mặc định cho băng thông tải xuống"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:50
|
||||
msgid "Default value for download rate"
|
||||
msgstr ""
|
||||
msgstr "Giá trị mặc định cho tốc độ tải xuống"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:82
|
||||
msgid "Default value for upload bandwidth"
|
||||
msgstr ""
|
||||
msgstr "Giá trị mặc định cho băng thông tải lên"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:62
|
||||
msgid "Default value for upload rate"
|
||||
msgstr ""
|
||||
msgstr "Giá trị mặc định cho tốc độ tải lên"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:77
|
||||
msgid "Download Bandwidth (Mbps)"
|
||||
msgstr ""
|
||||
msgstr "Băng thông tải xuống (Mbps)"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:252
|
||||
#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:135
|
||||
msgid "Download Rate"
|
||||
msgstr ""
|
||||
msgstr "Tỷ lệ tải xuống"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:40
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:105
|
||||
msgid "Enable Limit Rate Feature"
|
||||
msgstr ""
|
||||
msgstr "Kích hoạt tính năng tỷ lệ giới hạn"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:112
|
||||
msgid "Enable Traffic Priority"
|
||||
msgstr ""
|
||||
msgstr "Bật ưu tiên lưu lượng truy cập"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:112
|
||||
msgid "Enable this feature"
|
||||
msgstr ""
|
||||
msgstr "Kích hoạt tính năng này"
|
||||
|
||||
#: applications/luci-app-nft-qos/root/usr/share/rpcd/acl.d/luci-app-nft-qos.json:3
|
||||
msgid "Grant UCI access for luci-app-nft-qos"
|
||||
msgstr ""
|
||||
msgstr "Cấp quyền truy cập UCI cho luci-app-nft-qos"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:130
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:163
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:244
|
||||
msgid "Hostname"
|
||||
msgstr ""
|
||||
msgstr "Tên máy chủ (hostname)"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:134
|
||||
#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:153
|
||||
msgid "IP Address"
|
||||
msgstr ""
|
||||
msgstr "Địa chỉ IP"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:135
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:168
|
||||
msgid "IP Address (v4 / v6)"
|
||||
msgstr ""
|
||||
msgstr "Địa chỉ IP (v4 / v6)"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:137
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:170
|
||||
msgid "IP Address (v4 Only)"
|
||||
msgstr ""
|
||||
msgstr "Địa chỉ IP (Chỉ v4)"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:40
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:105
|
||||
msgid "Limit Enable"
|
||||
msgstr ""
|
||||
msgstr "Kích hoạt giới hạn"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:33
|
||||
msgid "Limit Rate by IP Address"
|
||||
msgstr ""
|
||||
msgstr "Tỷ lệ giới hạn theo địa chỉ IP"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:34
|
||||
msgid "Limit Rate by Mac Address"
|
||||
msgstr ""
|
||||
msgstr "Tỷ lệ giới hạn theo địa chỉ Mac"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:239
|
||||
msgid "Limit Traffic Rate By Mac Address"
|
||||
msgstr ""
|
||||
msgstr "Giới hạn tỷ lệ lưu lượng truy cập theo địa chỉ Mac"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:44
|
||||
msgid "Limit Type"
|
||||
msgstr ""
|
||||
msgstr "Loại giới hạn"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:177
|
||||
msgid "MAC (optional)"
|
||||
msgstr ""
|
||||
msgstr "MAC (tùy chọn)"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:248
|
||||
msgid "MAC Address"
|
||||
msgstr ""
|
||||
msgstr "Địa chỉ MAC"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:48
|
||||
msgid "MB"
|
||||
msgstr ""
|
||||
msgstr "MB"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:29
|
||||
msgid "NFT-QoS Settings"
|
||||
msgstr ""
|
||||
msgstr "Cài đặt NFT-QoS"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:116
|
||||
msgid "Network Interface for Traffic Shaping, e.g. br-lan, eth0.1, eth0, etc."
|
||||
msgstr ""
|
||||
"Giao diện mạng để định hình lưu lượng, ví dụ: br-lan, eth0.1, eth0, v.v."
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:87
|
||||
msgid "Network to be applied, e.g. 192.168.1.0/24, 10.2.0.0/16, etc."
|
||||
msgstr ""
|
||||
msgstr "Mạng được áp dụng, ví dụ: 192.168.1.0/24, 10.2.0.0/16, v.v."
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:93
|
||||
msgid "Network to be applied, e.g. AAAA::BBBB/64, CCCC::1/128, etc."
|
||||
msgstr ""
|
||||
msgstr "Mạng được áp dụng, ví dụ: AAAA::BBBB/64, CCCC::1/128, v.v."
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:65
|
||||
msgid "No information available"
|
||||
msgstr ""
|
||||
msgstr "Không có thông tin có sẵn"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:137
|
||||
#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:156
|
||||
msgid "Packets Total"
|
||||
msgstr ""
|
||||
msgstr "Tổng Packets"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:212
|
||||
msgid "Priority"
|
||||
msgstr ""
|
||||
msgstr "Ưu tiên"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:204
|
||||
msgid "Protocol"
|
||||
|
@ -184,86 +185,87 @@ msgstr "Giao thức"
|
|||
#: applications/luci-app-nft-qos/luasrc/controller/nft-qos.lua:21
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:24
|
||||
msgid "QoS over Nftables"
|
||||
msgstr ""
|
||||
msgstr "QoS over Nftables"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/controller/nft-qos.lua:13
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:144
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:181
|
||||
msgid "Rate"
|
||||
msgstr ""
|
||||
msgstr "Rate"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:130
|
||||
msgid "Realtime Download Rate"
|
||||
msgstr ""
|
||||
msgstr "Tỷ lệ tải xuống thời gian thực"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:125
|
||||
msgid "Realtime Rate"
|
||||
msgstr ""
|
||||
msgstr "Tỷ lệ thời gian thực"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:149
|
||||
msgid "Realtime Upload Rate"
|
||||
msgstr ""
|
||||
msgstr "Tỷ lệ tải lên theo thời gian thực"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:226
|
||||
msgid "Service"
|
||||
msgstr ""
|
||||
msgstr "Dịch vụ"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:125
|
||||
msgid "Static QoS-Download Rate"
|
||||
msgstr ""
|
||||
msgstr "Tốc độ tải xuống QoS tĩnh"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:158
|
||||
msgid "Static QoS-Upload Rate"
|
||||
msgstr ""
|
||||
msgstr "Tốc độ tải lên QoS tĩnh"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:87
|
||||
msgid "Target Network (IPv4/MASK)"
|
||||
msgstr ""
|
||||
msgstr "Target Network (IPv4/MASK)"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:93
|
||||
msgid "Target Network6 (IPv6/MASK)"
|
||||
msgstr ""
|
||||
msgstr "Target Network6 (IPv6/MASK)"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:127
|
||||
msgid "This page gives an overview over currently download/upload rate."
|
||||
msgstr ""
|
||||
"Trang này cung cấp thông tin tổng quan về tốc độ tải xuống/tải lên hiện tại."
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:35
|
||||
msgid "Traffic Priority"
|
||||
msgstr ""
|
||||
msgstr "Ưu tiên lưu lượng"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:199
|
||||
msgid "Traffic Priority Settings"
|
||||
msgstr ""
|
||||
msgstr "Cài đặt ưu tiên lưu lượng"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:44
|
||||
msgid "Type of Limit Rate"
|
||||
msgstr ""
|
||||
msgstr "Loại tỷ lệ giới hạn"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:149
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:186
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:257
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:268
|
||||
msgid "Unit"
|
||||
msgstr ""
|
||||
msgstr "Đơn vị"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:82
|
||||
msgid "Upload Bandwidth (Mbps)"
|
||||
msgstr ""
|
||||
msgstr "Băng thông tải lên (Mbps)"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:263
|
||||
#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:154
|
||||
msgid "Upload Rate"
|
||||
msgstr ""
|
||||
msgstr "Tỷ lệ tải lên"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:98
|
||||
msgid "White List for Limit Rate"
|
||||
msgstr ""
|
||||
msgstr "Danh sách trắng cho tỷ lệ giới hạn"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/model/cbi/nft-qos/nft-qos.lua:226
|
||||
msgid "e.g. https, 23, (separator is comma)"
|
||||
msgstr ""
|
||||
msgstr "e.g. https, 23, (separator is comma)"
|
||||
|
||||
#: applications/luci-app-nft-qos/luasrc/view/nft-qos/rate.htm:44
|
||||
msgid "kB"
|
||||
msgstr ""
|
||||
msgstr "kB"
|
||||
|
|
|
@ -3,7 +3,7 @@ module("luci.controller.poweroffdevice", package.seeall)
|
|||
|
||||
|
||||
function index()
|
||||
entry({"admin","system","poweroffdevice"},, template("poweroffdevice/poweroffdevice"), _("PowerOff"), 92)
|
||||
entry({"admin","system","poweroffdevice"},template("poweroffdevice/poweroffdevice"), _("PowerOff"), 92)
|
||||
entry({"admin","system","poweroffdevice","call"},post("action_poweroff"))
|
||||
end
|
||||
|
||||
|
|
|
@ -1,59 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2018 rosysong@rosinson.com
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=nft-qos
|
||||
PKG_VERSION:=1.0.6
|
||||
PKG_RELEASE:=4
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
PKG_MAINTAINER:=Rosy Song <rosysong@rosinson.com>
|
||||
|
||||
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/nft-qos
|
||||
SECTION:=utils
|
||||
CATEGORY:=Base system
|
||||
DEPENDS:=+kmod-nft-netdev +kmod-nft-bridge +nftables
|
||||
TITLE:=QoS scripts over nftables
|
||||
PKGARCH:=all
|
||||
endef
|
||||
|
||||
define Package/nft-qos/description
|
||||
This package provides implementation for qos over nftables.
|
||||
Currently, static/dynamic qos and traffic shaping are supported.
|
||||
endef
|
||||
|
||||
define Package/nft-qos/conffiles
|
||||
/etc/config/nft-qos
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/nft-qos/install
|
||||
$(INSTALL_DIR) $(1)/lib/nft-qos
|
||||
$(INSTALL_DATA) ./files/lib/* $(1)/lib/nft-qos/
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_CONF) ./files/nft-qos.config $(1)/etc/config/nft-qos
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) ./files/nft-qos.init $(1)/etc/init.d/nft-qos
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/dhcp
|
||||
$(INSTALL_BIN) ./files/nft-qos-monitor.hotplug $(1)/etc/hotplug.d/dhcp/00-nft-qos-monitor
|
||||
$(INSTALL_BIN) ./files/nft-qos-dynamic.hotplug $(1)/etc/hotplug.d/dhcp/01-nft-qos-dynamic
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,nft-qos))
|
|
@ -1,104 +0,0 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2018 rosysong@rosinson.com
|
||||
#
|
||||
|
||||
# for uci_validate_section()
|
||||
. /lib/functions/procd.sh
|
||||
|
||||
NFT_QOS_HAS_BRIDGE=
|
||||
NFT_QOS_INET_FAMILY=ip
|
||||
NFT_QOS_SCRIPT_TEXT=
|
||||
NFT_QOS_SCRIPT_FILE=/tmp/qos.nft
|
||||
|
||||
qosdef_appendx() { # <string to be appended>
|
||||
NFT_QOS_SCRIPT_TEXT="$NFT_QOS_SCRIPT_TEXT""$1"
|
||||
}
|
||||
|
||||
qosdef_append_chain_def() { # <type> <hook> <priority> <policy>
|
||||
qosdef_appendx "\t\ttype $1 hook $2 priority $3; policy $4;\n"
|
||||
}
|
||||
|
||||
qosdef_append_chain_ingress() { # <type> <device> <priority> <policy>
|
||||
qosdef_appendx "\t\ttype $1 hook ingress device $2 priority $3; policy $4;\n"
|
||||
}
|
||||
|
||||
# qosdef_append_rule_{MATCH}_{STATEMENT}
|
||||
qosdef_append_rule_ip_limit() { # <ipaddr> <operator> <unit> <rate>
|
||||
local ipaddr=$1
|
||||
local operator=$2
|
||||
local unit=$3
|
||||
local rate=$4
|
||||
|
||||
qosdef_appendx \
|
||||
"\t\tip $operator $ipaddr limit rate over $rate $unit/second drop\n"
|
||||
}
|
||||
|
||||
# qosdef_append_rule_{MATCH}_{STATEMENT}
|
||||
qosdef_append_rule_mac_limit() { # <macaddr> <operator> <unit> <rate>
|
||||
local macaddr=$1
|
||||
local operator=$2
|
||||
local unit=$3
|
||||
local rate=$4
|
||||
|
||||
qosdef_appendx \
|
||||
"\t\tether $operator $macaddr limit rate over $rate $unit/second drop\n"
|
||||
}
|
||||
|
||||
# qosdef_append_rule_{MATCH}_{POLICY}
|
||||
qosdef_append_rule_ip_policy() { # <operator> <ipaddr> <policy>
|
||||
qosdef_appendx "\t\tip $1 $2 $3\n"
|
||||
}
|
||||
|
||||
_handle_limit_whitelist() { # <value> <chain>
|
||||
local ipaddr=$1
|
||||
local operator
|
||||
|
||||
[ -z "$ipaddr" ] && return
|
||||
|
||||
case "$2" in
|
||||
download) operator="daddr";;
|
||||
upload) operator="saddr";;
|
||||
esac
|
||||
|
||||
qosdef_append_rule_ip_policy $operator $ipaddr accept
|
||||
}
|
||||
|
||||
qosdef_append_rule_limit_whitelist() { # <chain>
|
||||
config_list_foreach default limit_whitelist _handle_limit_whitelist $1
|
||||
}
|
||||
|
||||
qosdef_flush_table() { # <family> <table>
|
||||
nft flush table $1 $2 2>/dev/null
|
||||
}
|
||||
|
||||
qosdef_remove_table() { # <family> <table>
|
||||
nft delete table $1 $2 2>/dev/null
|
||||
}
|
||||
|
||||
qosdef_init_header() { # add header for nft script
|
||||
qosdef_appendx "#!/usr/sbin/nft -f\n"
|
||||
qosdef_appendx "# Copyright (C) 2018 rosysong@rosinson.com\n"
|
||||
qosdef_appendx "#\n\n"
|
||||
}
|
||||
|
||||
qosdef_init_env() {
|
||||
# check interface type of lan
|
||||
local lt="$(uci_get "network.lan.type")"
|
||||
[ "$lt" = "bridge" ] && export NFT_QOS_HAS_BRIDGE="y"
|
||||
|
||||
# check if ipv6 support
|
||||
[ -e /proc/sys/net/ipv6 ] && export NFT_QOS_INET_FAMILY="inet"
|
||||
}
|
||||
|
||||
qosdef_clean_cache() {
|
||||
rm -f $NFT_QOS_SCRIPT_FILE
|
||||
}
|
||||
|
||||
qosdef_init_done() {
|
||||
echo -e $NFT_QOS_SCRIPT_TEXT > $NFT_QOS_SCRIPT_FILE 2>/dev/null
|
||||
}
|
||||
|
||||
qosdef_start() {
|
||||
nft -f $NFT_QOS_SCRIPT_FILE 2>/dev/null
|
||||
}
|
|
@ -1,90 +0,0 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2018 rosysong@rosinson.com
|
||||
#
|
||||
|
||||
. /lib/nft-qos/core.sh
|
||||
|
||||
qosdef_validate_dynamic() {
|
||||
uci_load_validate nft-qos default "$1" "$2" \
|
||||
'limit_enable:bool:0' \
|
||||
'limit_type:maxlength(8)' \
|
||||
'dynamic_bw_up:uinteger:100' \
|
||||
'dynamic_bw_down:uinteger:100'
|
||||
}
|
||||
|
||||
# return average rate for dhcp leases
|
||||
qosdef_dynamic_rate() { # <bandwidth>
|
||||
local c=0 c6=0
|
||||
|
||||
[ ! -e /tmp/dhcp.leases -a \
|
||||
! -e /var/dhcp6.leases ] && return
|
||||
|
||||
[ -e /tmp/dhcp.leases ] && \
|
||||
c=$(wc -l < /tmp/dhcp.leases 2>/dev/null)
|
||||
[ -e /var/dhcp6.leases ] && \
|
||||
c6=$(wc -l < /var/dhcp6.leases 2>/dev/null)
|
||||
[ $c -eq 0 -a $c6 -eq 0 ] && \
|
||||
{ echo 12500; return; }
|
||||
|
||||
echo $(($1 / ($c + $c6)))
|
||||
}
|
||||
|
||||
qosdef_append_chain_dym() { # <hook> <name> <bandwidth>
|
||||
local cidr cidr6
|
||||
local operator rate
|
||||
local hook=$1 name=$2 bandwidth=$3
|
||||
|
||||
config_get cidr default 'dynamic_cidr'
|
||||
config_get cidr6 default 'dynamic_cidr6'
|
||||
|
||||
[ -z "$cidr" -a -z "$cidr6" ] && return
|
||||
|
||||
case "$2" in
|
||||
download) operator=daddr;;
|
||||
upload) operator=saddr;;
|
||||
esac
|
||||
|
||||
rate=$(qosdef_dynamic_rate $bandwidth)
|
||||
|
||||
qosdef_appendx "\tchain $name {\n"
|
||||
qosdef_append_chain_def filter $hook 0 accept
|
||||
qosdef_append_rule_limit_whitelist $name
|
||||
[ -n "$cidr" ] && \
|
||||
qosdef_append_rule_ip_limit $cidr $operator kbytes $rate
|
||||
[ -n "$cidr6" ] && \
|
||||
qosdef_append_rule_ip_limit $cidr6 $operator kbytes $rate
|
||||
qosdef_appendx "\t}\n"
|
||||
}
|
||||
|
||||
qosdef_flush_dynamic() {
|
||||
qosdef_flush_table "$NFT_QOS_INET_FAMILY" nft-qos-dynamic
|
||||
}
|
||||
|
||||
# init dynamic qos
|
||||
qosdef_init_dynamic() {
|
||||
local hook_ul="prerouting" hook_dl="postrouting"
|
||||
|
||||
[ "$2" = 0 ] || {
|
||||
logger -t nft-qos-dynamic "validation failed"
|
||||
return 1
|
||||
}
|
||||
|
||||
[ $limit_enable -eq 0 -o \
|
||||
"$limit_type" = "static" ] && return 1
|
||||
|
||||
# Transfer mbits/s to mbytes/s
|
||||
# e.g. 100,000 kbits == 12,500 kbytes
|
||||
dynamic_bw_up=$(($dynamic_bw_up * 1000 / 8))
|
||||
dynamic_bw_down=$(($dynamic_bw_down * 1000 / 8))
|
||||
|
||||
[ -z "$NFT_QOS_HAS_BRIDGE" ] && {
|
||||
hook_ul="postrouting"
|
||||
hook_dl="prerouting"
|
||||
}
|
||||
|
||||
qosdef_appendx "table $NFT_QOS_INET_FAMILY nft-qos-dynamic {\n"
|
||||
qosdef_append_chain_dym $hook_ul upload $dynamic_bw_up
|
||||
qosdef_append_chain_dym $hook_dl download $dynamic_bw_down
|
||||
qosdef_appendx "}\n"
|
||||
}
|
|
@ -1,79 +0,0 @@
|
|||
#!/bin/sh
|
||||
# based on static.sh
|
||||
# Copyright (C) 2020 Tong Zhang<ztong0001@gmail.com>
|
||||
#
|
||||
|
||||
. /lib/nft-qos/core.sh
|
||||
|
||||
qosdef_validate_mac() {
|
||||
uci_load_validate nft-qos default "$1" "$2" \
|
||||
'limit_mac_enable:bool:0'
|
||||
}
|
||||
|
||||
# append rule for mac qos
|
||||
qosdef_append_rule_mac() { # <section> <operator>
|
||||
local macaddr unit rate
|
||||
local operator=$2
|
||||
|
||||
config_get macaddr $1 macaddr
|
||||
if [ "$operator" = "saddr" ]; then
|
||||
config_get unit $1 urunit
|
||||
config_get rate $1 urate
|
||||
else
|
||||
config_get unit $1 drunit
|
||||
config_get rate $1 drate
|
||||
fi
|
||||
|
||||
[ -z "$macaddr" ] && return
|
||||
|
||||
qosdef_append_rule_mac_limit $macaddr $operator $unit $rate
|
||||
}
|
||||
|
||||
# append chain for mac qos
|
||||
qosdef_append_chain_mac() { # <hook> <name> <section>
|
||||
local hook=$1 name=$2
|
||||
local config=$3 operator
|
||||
|
||||
case "$name" in
|
||||
download) operator="daddr";;
|
||||
upload) operator="saddr";;
|
||||
esac
|
||||
|
||||
qosdef_appendx "\tchain $name {\n"
|
||||
qosdef_append_chain_def filter $hook 0 accept
|
||||
config_foreach qosdef_append_rule_mac $config $operator
|
||||
qosdef_appendx "\t}\n"
|
||||
}
|
||||
|
||||
qosdef_flush_mac() {
|
||||
if [ -n "$NFT_QOS_HAS_BRIDGE" ]; then
|
||||
qosdef_flush_table bridge nft-qos-mac
|
||||
else
|
||||
qosdef_flush_table "$NFT_QOS_INET_FAMILY" nft-qos-mac
|
||||
fi
|
||||
}
|
||||
|
||||
# limit rate by mac address init
|
||||
qosdef_init_mac() {
|
||||
local hook_ul="prerouting" hook_dl="postrouting"
|
||||
|
||||
[ "$2" = 0 ] || {
|
||||
logger -t nft-qos-mac "validation failed"
|
||||
return 1
|
||||
}
|
||||
|
||||
[ $limit_mac_enable -eq 0 ] && return 1
|
||||
|
||||
table_name=$NFT_QOS_INET_FAMILY
|
||||
if [ -z "$NFT_QOS_HAS_BRIDGE" ]; then
|
||||
hook_ul="postrouting"
|
||||
hook_dl="prerouting"
|
||||
else
|
||||
table_name="bridge"
|
||||
fi
|
||||
|
||||
qosdef_appendx "table $table_name nft-qos-mac {\n"
|
||||
qosdef_append_chain_mac $hook_ul upload client
|
||||
qosdef_append_chain_mac $hook_dl download client
|
||||
qosdef_appendx "}\n"
|
||||
}
|
|
@ -1,39 +0,0 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2018 rosysong@rosinson.com
|
||||
#
|
||||
|
||||
. /lib/nft-qos/core.sh
|
||||
|
||||
qosdef_monitor_get_ip_handle() { # <family> <chain> <ip>
|
||||
echo $(nft -a list chain $1 nft-qos-monitor $2 2>/dev/null | grep $3 | awk '{print $11}')
|
||||
}
|
||||
|
||||
qosdef_monitor_add() { # <mac> <ip> <hostname>
|
||||
handle_dl=$(qosdef_monitor_get_ip_handle $NFT_QOS_INET_FAMILY download $2)
|
||||
[ -z "$handle_dl" ] && nft add rule $NFT_QOS_INET_FAMILY nft-qos-monitor download ip daddr $2 counter
|
||||
handle_ul=$(qosdef_monitor_get_ip_handle $NFT_QOS_INET_FAMILY upload $2)
|
||||
[ -z "$handle_ul" ] && nft add rule $NFT_QOS_INET_FAMILY nft-qos-monitor upload ip saddr $2 counter
|
||||
}
|
||||
|
||||
qosdef_monitor_del() { # <mac> <ip> <hostname>
|
||||
local handle_dl handle_ul
|
||||
handle_dl=$(qosdef_monitor_get_ip_handle $NFT_QOS_INET_FAMILY download $2)
|
||||
handle_ul=$(qosdef_monitor_get_ip_handle $NFT_QOS_INET_FAMILY upload $2)
|
||||
[ -n "$handle_dl" ] && nft delete handle $handle_dl
|
||||
[ -n "$handle_ul" ] && nft delete handle $handle_ul
|
||||
}
|
||||
|
||||
# init qos monitor
|
||||
qosdef_init_monitor() {
|
||||
local hook_ul="prerouting" hook_dl="postrouting"
|
||||
|
||||
[ -z "$NFT_QOS_HAS_BRIDGE" ] && {
|
||||
hook_ul="postrouting"
|
||||
hook_dl="prerouting"
|
||||
}
|
||||
|
||||
nft add table $NFT_QOS_INET_FAMILY nft-qos-monitor
|
||||
nft add chain $NFT_QOS_INET_FAMILY nft-qos-monitor upload { type filter hook $hook_ul priority 0\; }
|
||||
nft add chain $NFT_QOS_INET_FAMILY nft-qos-monitor download { type filter hook $hook_dl priority 0\; }
|
||||
}
|
|
@ -1,87 +0,0 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2018 rosysong@rosinson.com
|
||||
#
|
||||
|
||||
. /lib/functions/network.sh
|
||||
. /lib/nft-qos/core.sh
|
||||
|
||||
P1=""; P2=""; P3=""; P4=""; P5=""; P6="";
|
||||
P7=""; P8=""; P9=""; P10=""; P11="";
|
||||
|
||||
qosdef_validate_priority() {
|
||||
uci_load_validate nft-qos default "$1" "$2" \
|
||||
'priority_enable:bool:0' \
|
||||
'priority_netdev:maxlength(8)'
|
||||
}
|
||||
|
||||
_qosdef_handle_protox() { # <priority> <rule>
|
||||
case "$1" in
|
||||
-400) P1="$P1""$2";;
|
||||
-300) P2="$P2""$2";;
|
||||
-225) P3="$P3""$2";;
|
||||
-200) P4="$P4""$2";;
|
||||
-150) P5="$P5""$2";;
|
||||
-100) P6="$P6""$2";;
|
||||
0) P7="$P7""$2";;
|
||||
50) P8="$P8""$2";;
|
||||
100) P9="$P9""$2";;
|
||||
225) P10="$P10""$2";;
|
||||
300) P11="$P11""$2";;
|
||||
esac
|
||||
}
|
||||
|
||||
qosdef_handle_protox() { # <section>
|
||||
local proto prio srv
|
||||
|
||||
config_get proto $1 'protocol'
|
||||
config_get prio $1 'priority'
|
||||
config_get srv $1 'service'
|
||||
|
||||
[ -z "$proto" -o \
|
||||
-z "$prio" -o \
|
||||
-z "$srv" ] && return
|
||||
|
||||
_qosdef_handle_protox $prio \
|
||||
"\t\t$proto dport { $srv } accept\n"
|
||||
}
|
||||
|
||||
qosdef_append_rule_protox() { # <section>
|
||||
config_foreach qosdef_handle_protox $1
|
||||
qosdef_appendx \
|
||||
"${P1}${P2}${P3}${P4}${P5}${P6}${P7}${P8}${P9}${P10}${P11}"
|
||||
}
|
||||
|
||||
qosdef_append_chain_priority() { # <name> <section> <device>
|
||||
local name=$1 device=$3
|
||||
|
||||
qosdef_appendx "\tchain $name {\n"
|
||||
qosdef_append_chain_ingress filter $device 0 accept
|
||||
qosdef_append_rule_protox $2
|
||||
qosdef_appendx "\t}\n"
|
||||
}
|
||||
|
||||
qosdef_remove_priority() {
|
||||
qosdef_remove_table netdev nft-qos-priority
|
||||
}
|
||||
|
||||
# init traffic priority
|
||||
qosdef_init_priority() {
|
||||
[ "$2" = 0 ] || {
|
||||
logger -t nft-qos-priority "validation failed"
|
||||
return 1
|
||||
}
|
||||
|
||||
[ $priority_enable -eq 0 ] && return 1
|
||||
|
||||
local ifname
|
||||
network_get_device ifname "$priority_netdev"
|
||||
[ -n "$ifname" ] || {
|
||||
logger -t nft-qos-priority "unable to get ifname for $priority_netdev"
|
||||
return 1
|
||||
}
|
||||
|
||||
qosdef_appendx "table netdev nft-qos-priority {\n"
|
||||
qosdef_append_chain_priority filter priority $ifname
|
||||
qosdef_appendx "}\n"
|
||||
}
|
|
@ -1,74 +0,0 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Copyright (C) 2018 rosysong@rosinson.com
|
||||
#
|
||||
|
||||
. /lib/nft-qos/core.sh
|
||||
|
||||
qosdef_validate_static() {
|
||||
uci_load_validate nft-qos default "$1" "$2" \
|
||||
'limit_enable:bool:0' \
|
||||
'limit_type:maxlength(8)' \
|
||||
'static_unit_dl:string:kbytes' \
|
||||
'static_unit_ul:string:kbytes' \
|
||||
'static_rate_dl:uinteger:50' \
|
||||
'static_rate_ul:uinteger:50'
|
||||
}
|
||||
|
||||
# append rule for static qos
|
||||
qosdef_append_rule_sta() { # <section> <operator> <default-unit> <default-rate>
|
||||
local ipaddr unit rate
|
||||
local operator=$2
|
||||
|
||||
config_get ipaddr $1 ipaddr
|
||||
config_get unit $1 unit $3
|
||||
config_get rate $1 rate $4
|
||||
|
||||
[ -z "$ipaddr" ] && return
|
||||
|
||||
qosdef_append_rule_ip_limit $ipaddr $operator $unit $rate
|
||||
}
|
||||
|
||||
# append chain for static qos
|
||||
qosdef_append_chain_sta() { # <hook> <name> <section> <unit> <rate>
|
||||
local hook=$1 name=$2
|
||||
local config=$3 operator
|
||||
|
||||
case "$name" in
|
||||
download) operator="daddr";;
|
||||
upload) operator="saddr";;
|
||||
esac
|
||||
|
||||
qosdef_appendx "\tchain $name {\n"
|
||||
qosdef_append_chain_def filter $hook 0 accept
|
||||
qosdef_append_rule_limit_whitelist $name
|
||||
config_foreach qosdef_append_rule_sta $config $operator $4 $5
|
||||
qosdef_appendx "\t}\n"
|
||||
}
|
||||
|
||||
qosdef_flush_static() {
|
||||
qosdef_flush_table "$NFT_QOS_INET_FAMILY" nft-qos-static
|
||||
}
|
||||
|
||||
# static limit rate init
|
||||
qosdef_init_static() {
|
||||
local hook_ul="prerouting" hook_dl="postrouting"
|
||||
|
||||
[ "$2" = 0 ] || {
|
||||
logger -t nft-qos-static "validation failed"
|
||||
return 1
|
||||
}
|
||||
|
||||
[ $limit_enable -eq 0 -o \
|
||||
$limit_type = "dynamic" ] && return 1
|
||||
|
||||
[ -z "$NFT_QOS_HAS_BRIDGE" ] && {
|
||||
hook_ul="postrouting"
|
||||
hook_dl="prerouting"
|
||||
}
|
||||
|
||||
qosdef_appendx "table $NFT_QOS_INET_FAMILY nft-qos-static {\n"
|
||||
qosdef_append_chain_sta $hook_ul upload upload $static_unit_ul $static_rate_ul
|
||||
qosdef_append_chain_sta $hook_dl download download $static_unit_dl $static_rate_dl
|
||||
qosdef_appendx "}\n"
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Copyright 2018 rosysong@rosinson.com
|
||||
#
|
||||
|
||||
export initscript="nft-qos-dynamic"
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/nft-qos/core.sh
|
||||
. /lib/nft-qos/dynamic.sh
|
||||
|
||||
NFT_QOS_DYNAMIC_ON=
|
||||
|
||||
qosdef_check_if_dynamic() {
|
||||
[ $limit_enable -eq 1 -a \
|
||||
"$limit_type" = "dynamic" ] && \
|
||||
NFT_QOS_DYNAMIC_ON="y"
|
||||
}
|
||||
|
||||
|
||||
logger -t nft-qos-dynamic "ACTION=$ACTION, MACADDR=$MACADDR, IPADDR=$IPADDR, HOSTNAME=$HOSTNAME"
|
||||
|
||||
case "$ACTION" in
|
||||
add | update | remove)
|
||||
qosdef_validate_dynamic default qosdef_check_if_dynamic
|
||||
[ -z "$NFT_QOS_DYNAMIC_ON" ] && return
|
||||
|
||||
qosdef_init_env
|
||||
qosdef_flush_dynamic
|
||||
|
||||
qosdef_init_header
|
||||
qosdef_validate_dynamic default qosdef_init_dynamic
|
||||
qosdef_init_done
|
||||
qosdef_start
|
||||
;;
|
||||
esac
|
|
@ -1,23 +0,0 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Copyright 2018 rosysong@rosinson.com
|
||||
#
|
||||
|
||||
export initscript="nft-qos-monitor"
|
||||
|
||||
. /lib/nft-qos/monitor.sh
|
||||
|
||||
logger -t nft-qos-monitor "ACTION=$ACTION, MACADDR=$MACADDR, IPADDR=$IPADDR, HOSTNAME=$HOSTNAME"
|
||||
|
||||
case "$ACTION" in
|
||||
add | update)
|
||||
qosdef_init_env
|
||||
qosdef_init_monitor
|
||||
qosdef_monitor_add $MACADDR $IPADDR $HOSTNAME
|
||||
;;
|
||||
remove)
|
||||
qosdef_init_env
|
||||
qosdef_init_monitor
|
||||
qosdef_monitor_del $MACADDR $IPADDR $HOSTNAME
|
||||
;;
|
||||
esac
|
|
@ -1,119 +0,0 @@
|
|||
#
|
||||
# Copyright (C) 2018 rosysong@rosinson.com
|
||||
#
|
||||
# This is the sample for nft-qos configuration file,
|
||||
# which will generate a nftables script in /tmp/qos.nft
|
||||
#
|
||||
|
||||
# Getting Started
|
||||
# Official site :
|
||||
# https://netfilter.org/projects/nftables/index.html
|
||||
# What is nftables :
|
||||
# https://wiki.nftables.org/wiki-nftables/index.php/Main_Page
|
||||
#
|
||||
|
||||
# Basic Operations
|
||||
# Configuring Tables :
|
||||
# https://wiki.nftables.org/wiki-nftables/index.php/Configuring_tables
|
||||
# Configuring Chains :
|
||||
# https://wiki.nftables.org/wiki-nftables/index.php/Configuring_chains
|
||||
# Configuring Rules :
|
||||
# https://wiki.nftables.org/wiki-nftables/index.php/Simple_rule_management
|
||||
# Quick Reference (recommended) :
|
||||
# https://wiki.nftables.org/wiki-nftables/index.php/Quick_reference-nftables_in_10_minutes
|
||||
# https://netfilter.org/projects/nftables/manpage.html
|
||||
#
|
||||
|
||||
config default default
|
||||
# Enable Flag for limit rate
|
||||
option limit_enable '1'
|
||||
|
||||
# Options for enable Static QoS (rate limit)
|
||||
option limit_type 'static'
|
||||
# Options for Static QoS (rate limit)
|
||||
option static_unit_dl 'kbytes'
|
||||
option static_unit_ul 'kbytes'
|
||||
option static_rate_dl '50'
|
||||
option static_rate_ul '50'
|
||||
|
||||
# Options for enable Dynamic QoS
|
||||
# This option can not compatible with Static QoS
|
||||
# option limit_type 'dynamic'
|
||||
|
||||
# For Dynamic QoS Samples (unit of bandwidth is Mbps):
|
||||
option dynamic_cidr '192.168.1.0/24'
|
||||
option dynamic_cidr6 'AAAA:BBBB::1/64'
|
||||
option dynamic_bw_up '100'
|
||||
option dynamic_bw_down '100'
|
||||
|
||||
# White list for static/dynamic limit
|
||||
# list limit_whitelist '192.168.1.225'
|
||||
# list limit_whitelist '192.168.1.0/24'
|
||||
# list limit_whitelist 'ABCD:CDEF::1/64'
|
||||
|
||||
# Option for Mac address based traffic control
|
||||
option limit_mac_enable '0'
|
||||
|
||||
# Options for Traffic Priority
|
||||
option priority_enable '0'
|
||||
option priority_netdev 'lan'
|
||||
|
||||
|
||||
#
|
||||
# For Static QoS Rate Limit Samples :
|
||||
#
|
||||
# For Download :
|
||||
#config download
|
||||
# option hostname 'My PC'
|
||||
# option unit 'kbytes'
|
||||
# option ipaddr '192.168.1.224'
|
||||
# option rate '128'
|
||||
#
|
||||
# For Upload :
|
||||
#config upload
|
||||
# option hostname 'office-pc'
|
||||
# option unit 'mbytes'
|
||||
# option ipaddr 'ABCD:FFED::1/64'
|
||||
# option rate '1024'
|
||||
#
|
||||
# For MAC address based traffic control Samples :
|
||||
#
|
||||
#config client
|
||||
# option drunit 'kbytes'
|
||||
# option urunit 'kbytes'
|
||||
# option hostname 'tvbox'
|
||||
# option macaddr '00:00:00:00:00:00'
|
||||
# option drate '300'
|
||||
# option urate '30'
|
||||
#
|
||||
# Traffic Priority Samples :
|
||||
#
|
||||
# protocol : tcp, udp, udplite, sctp, dccp, tcp is default
|
||||
# priority : integer between 1-11, 1 is default and the highest
|
||||
# service : you can input a integer or service name,
|
||||
# e.g. '22', '11-22', 'telnet', 'ssh, http, ftp', etc
|
||||
#
|
||||
#config priority
|
||||
# option protocol 'tcp'
|
||||
# option priority '-400'
|
||||
# option service '23'
|
||||
# option comment '?'
|
||||
#
|
||||
#config priority
|
||||
# option protocol 'udp'
|
||||
# option priority '-400'
|
||||
# option service 'https'
|
||||
# option comment '?'
|
||||
#
|
||||
#config priority
|
||||
# option protocol 'dccp'
|
||||
# option priority '0'
|
||||
# option service '22-35'
|
||||
# option comment '?'
|
||||
#
|
||||
#config priority
|
||||
# option protocol 'dccp'
|
||||
# option priority '300'
|
||||
# option service 'ftp,ssh,http'
|
||||
# option comment '?'
|
||||
#
|
|
@ -1,54 +0,0 @@
|
|||
#!/bin/sh /etc/rc.common
|
||||
#
|
||||
# Copyright (C) 2018 rosysong@rosinson.com
|
||||
#
|
||||
|
||||
if [ -z "${IPKG_INSTROOT}" ]; then
|
||||
. /lib/nft-qos/core.sh
|
||||
. /lib/nft-qos/monitor.sh
|
||||
. /lib/nft-qos/dynamic.sh
|
||||
. /lib/nft-qos/static.sh
|
||||
. /lib/nft-qos/mac.sh
|
||||
. /lib/nft-qos/priority.sh
|
||||
fi
|
||||
|
||||
START=99
|
||||
USE_PROCD=1
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger nft-qos
|
||||
|
||||
procd_open_validate
|
||||
qosdef_validate_dynamic
|
||||
qosdef_validate_static
|
||||
qosdef_validate_priority
|
||||
qosdef_validate_mac
|
||||
procd_close_validate
|
||||
}
|
||||
|
||||
start_service() {
|
||||
config_load nft-qos
|
||||
|
||||
qosdef_init_env
|
||||
qosdef_flush_mac
|
||||
qosdef_flush_static
|
||||
qosdef_flush_dynamic
|
||||
qosdef_remove_priority
|
||||
|
||||
qosdef_init_header
|
||||
qosdef_init_monitor
|
||||
qosdef_validate_dynamic default qosdef_init_dynamic
|
||||
qosdef_validate_static default qosdef_init_static
|
||||
qosdef_validate_mac default qosdef_init_mac
|
||||
qosdef_validate_priority default qosdef_init_priority
|
||||
qosdef_init_done
|
||||
qosdef_start
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
qosdef_flush_dynamic
|
||||
qosdef_flush_static
|
||||
qosdef_flush_mac
|
||||
qosdef_remove_priority
|
||||
qosdef_clean_cache
|
||||
}
|
Loading…
Reference in New Issue