diff options
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" |