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
30 local mode
=$
(fw_get_family_mode
${forwarding_family:-x} ${forwarding_dest:-${forwarding_src:--}} i
)
32 fw add
$mode f
$chain $target ^
34 # propagate masq zone flag
35 [ -n "$forwarding_src" ] && list_contains FW_CONNTRACK_ZONES
$forwarding_src && {
36 append FW_CONNTRACK_ZONES
$forwarding_dest
38 [ -n "$forwarding_dest" ] && list_contains FW_CONNTRACK_ZONES
$forwarding_dest && {
39 append FW_CONNTRACK_ZONES
$forwarding_src
42 fw_callback post forwarding