1 # Copyright (C) 2009-2010 OpenWrt.org
3 fw_config_get_forwarding
() {
4 [ "${forwarding_NAME}" != "$1" ] ||
return
5 fw_config_get_section
"$1" forwarding
{ \
11 [ -n "$forwarding_name" ] || forwarding_name
=$forwarding__name
14 fw_load_forwarding
() {
15 fw_config_get_forwarding
"$1"
17 fw_callback pre forwarding
20 [ -n "$forwarding_src" ] && {
21 chain
=zone_
${forwarding_src}_forward
25 [ -n "$forwarding_dest" ] && {
26 target
=zone_
${forwarding_dest}_ACCEPT
29 fw add i f
$chain $target ^
31 # propagate masq zone flag
32 [ -n "$forwarding_src" ] && list_contains CONNTRACK_ZONES
$forwarding_src && {
33 append CONNTRACK_ZONES
$forwarding_dest
35 [ -n "$forwarding_dest" ] && list_contains CONNTRACK_ZONES
$forwarding_dest && {
36 append CONNTRACK_ZONES
$forwarding_src
39 fw_callback post forwarding