Developing lightweight computation at the DSG edge

Commit 8d67b72d authored by Simó Albert i Beltran's avatar Simó Albert i Beltran
Browse files

Add WAN devices to the firewall zone. References #234, #237.

parent aaba5ee6
......@@ -50,6 +50,17 @@ qmp_gw_disable_default() {
qmp_gw_masq_wan 0
}
qmp_gw_add_interfaces_to_firewall_zone() {
local cfg=$1
local $virtual_interfaces
for interface in $(qmp_get_devices wan)
do
[ -n "$virtual_interfaces" ] && virtual_interfaces="$virtual_interfaces "
virtual_interfaces="$virtual_interfaces$(qmp_get_virtual_iface $interface)"
done
qmp_uci_set_raw firewall.$cfg.network="$virtual_interfaces"
}
qmp_gw_masq_wan() {
#First parameter is 1/0 (enable/disable masquerade). Default is 1
[ -z "$1" ] && masq=1 || masq=$1
......@@ -80,7 +91,10 @@ qmp_gw_masq_wan() {
qmp_uci_set_raw firewall.@zone[$wan].output=ACCEPT
qmp_uci_set_raw firewall.@zone[$wan].forward=ACCEPT
qmp_uci_set_raw firewall.@zone[$wan].masq=$masq
cfg=@zone[$wan]
fi
qmp_gw_add_interfaces_to_firewall_zone $cfg
}
qmp_gw_apply() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment