Commit Graph

16 Commits

Author SHA1 Message Date
Imran Khan 726633301e nft-qos: bump PKG_RELEASE
Signed-off-by: Imran Khan <gururug@gmail.com>
2021-12-17 14:07:47 -08:00
Imran Khan 4f4f66fd17 nft-qos: fix monitor duplicates
nft command syntax is incorrect

rearrange parameter order

Signed-off-by: Imran Khan <gururug@gmail.com>
2021-12-17 14:07:47 -08:00
Imran Khan 6d095c479a nft-qos: fix include on image build service enable
Fixes: f88485f572 ("nft-qos: silence buildsystem errors")

Prefixing IPKG_INSTROOT to sourced includes is ineffective for this
package.

Source includes only when empty to avoid image make errors.

Signed-off-by: Imran Khan <gururug@gmail.com>
2021-12-17 14:07:47 -08:00
Etienne Champetier 76b750d720 nft-qos: simplify ifname retrieval
network_get_device should be enough, and since https://git.openwrt.org/?p=openwrt/openwrt.git;a=commitdiff;h=4b9a67362d70c544b85078b8d5c661f43f7472d9
uci network config interface sections use 'device' instead of 'ifname',
rendering the fallback useless

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
2021-09-16 18:14:23 -04:00
Imran Khan f88485f572 nft-qos: silence buildsystem errors
add IPKG_INSTROOT to init script to
silence build system errors

Signed-off-by: Imran Khan <gururug@gmail.com>
2020-12-23 02:21:09 +11:00
Tong Zhang 0483b8dc88 nft-qos: support mac address based speed limit
This patch makes it possible to configure and limit per-client internet
speed based on MAC address and it can work with SQM.
This feature is what OpenWRT currently lacks. This patch is largely based
on static.sh and the configuration file is similar to original nft-qos.

New configuration options and examples are listed below

config default 'default'
    option limit_mac_enable '1'
config client
	option drunit 'kbytes'
	option urunit 'kbytes'
	option hostname 'tv-box'
	option macaddr 'AB:CD:EF:01:23:45'
	option drate '1000'
	option urate '50'
config client
	option drunit 'kbytes'
	option urunit 'kbytes'
	option hostname 'my-pc'
	option macaddr 'AB:CD:EF:01:23:46'
	option drate '3000'
	option urate '2000'

limit_mac_enable - enable rate limit based on MAC address
drunit - download rate unit
urunit - upload rate unit
macaddr - client MAC address
drate - download rate
urate - upload rate

Signed-off-by: Tong Zhang <ztong0001@gmail.com>
2020-08-19 09:39:57 -04:00
Kevin Darbyshire-Bryant d67a342150 nft-qos: swap dependency order
In preparation for generating nftables-no/json variants, swap dependency
order to prevent following recursive dependency warnings:

tmp/.config-package.in:73879:error: recursive dependency detected!
For a resolution refer to Documentation/kbuild/kconfig-language.txt
subsection "Kconfig recursive dependency limitations"
tmp/.config-package.in:73879:	symbol PACKAGE_luci-app-nft-qos depends on PACKAGE_luci-app-nft-qos
tmp/.config-package.in:854:error: recursive dependency detected!
For a resolution refer to Documentation/kbuild/kconfig-language.txt
subsection "Kconfig recursive dependency limitations"
tmp/.config-package.in:854:	symbol PACKAGE_nft-qos depends on PACKAGE_nft-qos

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
2020-03-30 12:57:58 +01:00
Deng Qingfang 17496030e2 treewide: add missing PKGARCH:=all to non-binary packages
Packages such as Perl, Lua, shell scripts don't generate binary files.
Add PKGARCH:=all to them.

Signed-off-by: Deng Qingfang <dengqf6@mail2.sysu.edu.cn>
2019-03-30 17:11:50 +08:00
Rosy Song 8dae40873c nft-qos: improve document for priority module
Signed-off-by: Rosy Song <rosysong@rosinson.com>
2019-03-10 15:44:30 +08:00
Rosy Song af9d96bc93 nft-qos: fix missing double semicolon in case
Signed-off-by: Rosy Song <rosysong@rosinson.com>
2019-03-10 15:42:32 +08:00
Jeffery To a0b51e9bd6 nft-qos: Update init script
This replaces the use of uci_validate_section() with
uci_load_validate(), which removes the need to declare local variables
for every config option.

This also adds a validate section to service_triggers(), and fixes some
variable name typos in qosdef_init_static().

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2019-02-12 16:31:59 +08:00
Rosy Song 9ba94ebbaa nft-qos: fix useless log in syslog
Since the functions in procd.sh invoke "initscript" variable which is
not defined when imported procd.sh from hotplug scripts. And this
results in error when calling basename utility.

Sun Jan 20 12:34:50 2019 daemon.debug dnsmasq-script[15340]: BusyBox v1.28.4 () multi-call binary.
Sun Jan 20 12:34:50 2019 daemon.debug dnsmasq-script[15340]:
Sun Jan 20 12:34:50 2019 daemon.debug dnsmasq-script[15340]: Usage: basename FILE [SUFFIX]
Sun Jan 20 12:34:50 2019 daemon.debug dnsmasq-script[15340]:
Sun Jan 20 12:34:50 2019 daemon.debug dnsmasq-script[15340]: Strip directory path and .SUFFIX from FILE
Sun Jan 20 12:34:50 2019 user.notice nft-qos-monitor: ACTION=update, MACADDR=xxxxxx, IPADDR=192.168.11.109, HOSTNAME=Honor_Play
Sun Jan 20 12:34:50 2019 daemon.info dnsmasq[15340]: 250 192.168.11.109/60566 reply www.google.com is 216.58.215.68
Sun Jan 20 12:34:50 2019 daemon.info dnsmasq[15340]: 251 192.168.11.109/43456 reply mtalk.google.com is <CNAME>
Sun Jan 20 12:34:50 2019 daemon.info dnsmasq[15340]: 251 192.168.11.109/43456 reply mobile-gtalk.l.google.com is 173.194.222.188
Sun Jan 20 12:34:50 2019 daemon.debug dnsmasq-script[15340]: BusyBox v1.28.4 () multi-call binary.
Sun Jan 20 12:34:50 2019 daemon.debug dnsmasq-script[15340]:
Sun Jan 20 12:34:50 2019 daemon.debug dnsmasq-script[15340]: Usage: basename FILE [SUFFIX]
Sun Jan 20 12:34:50 2019 daemon.debug dnsmasq-script[15340]:
Sun Jan 20 12:34:50 2019 daemon.debug dnsmasq-script[15340]: Strip directory path and .SUFFIX from FILE
Sun Jan 20 12:34:51 2019 daemon.debug dnsmasq-script[15340]: BusyBox v1.28.4 () multi-call binary.
Sun Jan 20 12:34:51 2019 daemon.debug dnsmasq-script[15340]:
Sun Jan 20 12:34:51 2019 daemon.debug dnsmasq-script[15340]: Usage: basename FILE [SUFFIX]
Sun Jan 20 12:34:51 2019 daemon.debug dnsmasq-script[15340]:
Sun Jan 20 12:34:51 2019 daemon.debug dnsmasq-script[15340]: Strip directory path and .SUFFIX from FILE
Sun Jan 20 12:34:51 2019 user.notice nft-qos-dynamic: ACTION=update, MACADDR=xxxxxx, IPADDR=192.168.11.109, HOSTNAME=Honor_Play

Signed-off-by: Rosy Song <rosysong@rosinson.com>
2019-02-01 09:39:02 +08:00
Rosy Song 6a42b7bf38 nft-qos: fix monitor doesn't work when firstboot
Signed-off-by: Rosy Song <rosysong@rosinson.com>
2019-01-02 09:20:36 +08:00
Rosy Song cf239752d2 nft-qos: replace input chain with prerouting for monitor and dynamic QoS as well
Signed-off-by: Rosy Song <rosysong@rosinson.com>
2018-11-12 09:42:55 +08:00
Rosy Song 07c2d29859 nft-qos: use prerouting chain rather than input
Using the input chain can only limit the upload rate in local network.
Since to do the limit rate on both native and remote, we have to
replace the input hook with prerouting.

Signed-off-by: Rosy Song <rosysong@rosinson.com>

(Added Makefile version bump)
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2018-11-10 20:47:23 +02:00
Rosy Song 6649ac91e9 nft-qos: add new package
This is the nftables implementation for qos on OpenWrt,
Currently, it has below features:

* Static QoS : setting limit rate for devices or global network.

* Dynamic/Auto QoS : setting limit rate according to the network
  bandwidth and adjust itself automatically (hotplug event).

* Traffic Priority : this feature is like traffic shaping under tc,
  it uses ingress hook to handle to packets here.

Signed-off-by: Rosy Song <rosysong@rosinson.com>
2018-11-06 16:13:28 +08:00