fw4: consolidate helper code
authorJo-Philipp Wich <jo@mein.io>
Fri, 4 Feb 2022 22:44:25 +0000 (23:44 +0100)
committerJo-Philipp Wich <jo@mein.io>
Sat, 5 Feb 2022 23:33:04 +0000 (00:33 +0100)
commit4d5af8b0196912ab21f1b288f73cafa2eb6a1345
tree9c953f1733f9a903be8adfa720fce23ffe417c8c
parent300c737e48fda62e38ee60ec9a38350eca55264f
fw4: consolidate helper code

 - Move various local helper functions out of main.uc into the fw4 class
 - Rework settype reading to use nft JSON output as terse mode now works
 - Simplify testing flowtable enable conditions
 - Adjust testcases to changed flowtable logic

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
root/usr/share/firewall4/main.uc
root/usr/share/firewall4/templates/ruleset.uc
root/usr/share/ucode/fw4.uc
tests/01_configuration/01_ruleset
tests/mocks/fs/opendir~_sys_class_net_br-lan.json [new file with mode: 0644]
tests/mocks/fs/opendir~_sys_class_net_eth0.json [new file with mode: 0644]
tests/mocks/fs/opendir~_sys_class_net_eth1.json [new file with mode: 0644]
tests/mocks/fs/popen~_usr_sbin_nft_--terse_--json_list_flowtables_inet.txt [new file with mode: 0644]
tests/mocks/ubus/network.device~status.json [new file with mode: 0644]