diff options
author | Robert Bays <robert@vyatta.com> | 2012-09-05 10:55:36 -0700 |
---|---|---|
committer | Robert Bays <robert@vyatta.com> | 2012-09-05 10:55:36 -0700 |
commit | 91eb3ef4cb9d4cb62d1b56b8daf17bd3845976cb (patch) | |
tree | 80234a54041ff4d619daa5d4ad26794d6aaf2ac8 /templates/policy | |
parent | c353904cdb9faf701973d32aaa6748ea97a2f797 (diff) | |
download | vyatta-cfg-firewall-91eb3ef4cb9d4cb62d1b56b8daf17bd3845976cb.tar.gz vyatta-cfg-firewall-91eb3ef4cb9d4cb62d1b56b8daf17bd3845976cb.zip |
add support for main table
Diffstat (limited to 'templates/policy')
-rwxr-xr-x[-rw-r--r--] | templates/policy/ipv6-route/node.tag/rule/node.tag/set/table/node.def | 17 | ||||
-rwxr-xr-x[-rw-r--r--] | templates/policy/route/node.tag/rule/node.tag/set/table/node.def | 17 |
2 files changed, 28 insertions, 6 deletions
diff --git a/templates/policy/ipv6-route/node.tag/rule/node.tag/set/table/node.def b/templates/policy/ipv6-route/node.tag/rule/node.tag/set/table/node.def index 07a0e91..b404ef9 100644..100755 --- a/templates/policy/ipv6-route/node.tag/rule/node.tag/set/table/node.def +++ b/templates/policy/ipv6-route/node.tag/rule/node.tag/set/table/node.def @@ -1,5 +1,16 @@ -type: u32 +type: txt help: Routing table to forward packet with val_help: u32:1-250 ; Table number -syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 250; - "Table must be between 1 and 250" +val_help: main ; Main table +syntax:expression: exec " + if [[ $VAR(@) =~ ^-?[0-9]+$ ]] ; then + if [ $VAR(@) -lt 1 -o $VAR(@) -gt 250 ] ; then + echo Table must be between 1-250 or table main + exit 1 + fi + else + if [[ $VAR(@) != 'main' ]] ; then + echo Table must be between 1-250 or table main + exit 1 + fi + fi" diff --git a/templates/policy/route/node.tag/rule/node.tag/set/table/node.def b/templates/policy/route/node.tag/rule/node.tag/set/table/node.def index 07a0e91..b404ef9 100644..100755 --- a/templates/policy/route/node.tag/rule/node.tag/set/table/node.def +++ b/templates/policy/route/node.tag/rule/node.tag/set/table/node.def @@ -1,5 +1,16 @@ -type: u32 +type: txt help: Routing table to forward packet with val_help: u32:1-250 ; Table number -syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 250; - "Table must be between 1 and 250" +val_help: main ; Main table +syntax:expression: exec " + if [[ $VAR(@) =~ ^-?[0-9]+$ ]] ; then + if [ $VAR(@) -lt 1 -o $VAR(@) -gt 250 ] ; then + echo Table must be between 1-250 or table main + exit 1 + fi + else + if [[ $VAR(@) != 'main' ]] ; then + echo Table must be between 1-250 or table main + exit 1 + fi + fi" |