1 # Copyright (C) 2009-2010 OpenWrt.org
3 fw_config_get_forwarding
() {
4 [ "${forwarding_NAME}" != "$1" ] ||
return
5 fw_config_get_section
"$1" forwarding
{ \
12 [ -n "$forwarding_name" ] || forwarding_name
=$forwarding__name
15 fw_load_forwarding
() {
16 fw_config_get_forwarding
"$1"
18 fw_callback pre forwarding
21 [ -n "$forwarding_src" ] && {
22 chain
=zone_
${forwarding_src}_forward
26 [ -n "$forwarding_dest" ] && {
27 target
=zone_
${forwarding_dest}_ACCEPT
31 fw_get_family_mode mode
${forwarding_family:-x} ${forwarding_dest:-${forwarding_src:--}} i
33 fw add
$mode f
$chain $target ^
35 # propagate masq zone flag
36 [ -n "$forwarding_src" ] && list_contains FW_CONNTRACK_ZONES
$forwarding_src && {
37 append FW_CONNTRACK_ZONES
$forwarding_dest
39 [ -n "$forwarding_dest" ] && list_contains FW_CONNTRACK_ZONES
$forwarding_dest && {
40 append FW_CONNTRACK_ZONES
$forwarding_src
43 fw_callback post forwarding