From 40417afbaf508ec18dbee5e033ec11a280969d7c Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Tue, 26 Jul 2011 19:47:57 +0700 Subject: Modify NAT configuration templates to support "any" inbound-interface and outbound-interface. --- templates-cfg/nat/rule/node.tag/inbound-interface/node.def | 7 +++++-- templates-cfg/nat/rule/node.tag/outbound-interface/node.def | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/templates-cfg/nat/rule/node.tag/inbound-interface/node.def b/templates-cfg/nat/rule/node.tag/inbound-interface/node.def index 69913d6..43c2998 100644 --- a/templates-cfg/nat/rule/node.tag/inbound-interface/node.def +++ b/templates-cfg/nat/rule/node.tag/inbound-interface/node.def @@ -2,11 +2,14 @@ type: txt help: Inbound interface of NAT traffic -enumeration: existing-interfaces +enumeration: existing-interfaces; echo "any" -val_help: ; Interface name +val_help: ; Interface name or "any" commit:expression: exec " + if [ \"any\" == \"$VAR(@)\" ] ; then + exit 0 + fi intf_array=($(awk '$1 ~ /:/ { print $1 }' /proc/net/dev)) intf_array_len=${#intf_array[*]} i=0 diff --git a/templates-cfg/nat/rule/node.tag/outbound-interface/node.def b/templates-cfg/nat/rule/node.tag/outbound-interface/node.def index 28e42e8..fa432cf 100644 --- a/templates-cfg/nat/rule/node.tag/outbound-interface/node.def +++ b/templates-cfg/nat/rule/node.tag/outbound-interface/node.def @@ -2,11 +2,14 @@ type: txt help: Outbound interface for NAT traffic -enumeration: existing-interfaces +enumeration: existing-interfaces; echo "any" -val_help: ; Interface name +val_help: ; Interface name or "any" commit:expression: exec " + if [ \"any\" == \"$VAR(@)\" ] ; then + exit 0 + fi intf_array=($(awk '$1 ~ /:/ { print $1 }' /proc/net/dev)) intf_array_len=${#intf_array[*]} i=0 -- cgit v1.2.3