From cd50a751d1480424cdf103fd748b514330029c24 Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Thu, 31 Jan 2008 07:58:38 -0800 Subject: convert templates to new syntax --- templates/policy/prefix-list/node.def | 4 +- .../prefix-list/node.tag/description/node.def | 2 +- .../policy/prefix-list/node.tag/rule/node.def | 44 +++++++++++----------- .../node.tag/rule/node.tag/action/node.def | 4 +- .../node.tag/rule/node.tag/description/node.def | 2 +- .../prefix-list/node.tag/rule/node.tag/ge/node.def | 4 +- .../prefix-list/node.tag/rule/node.tag/le/node.def | 4 +- .../node.tag/rule/node.tag/prefix/node.def | 2 +- 8 files changed, 33 insertions(+), 33 deletions(-) (limited to 'templates/policy/prefix-list') diff --git a/templates/policy/prefix-list/node.def b/templates/policy/prefix-list/node.def index de9d34ab..b1fcc1f9 100644 --- a/templates/policy/prefix-list/node.def +++ b/templates/policy/prefix-list/node.def @@ -1,4 +1,4 @@ tag: type: txt -help: "Add a prefix list entry" -syntax: pattern $(@) "^[-a-zA-Z0-9.]+$" ; "prefix-list name must be alpha-numeric" +help: Add a prefix list entry +syntax:expression: pattern $VAR(@) "^[-a-zA-Z0-9.]+$" ; "prefix-list name must be alpha-numeric" diff --git a/templates/policy/prefix-list/node.tag/description/node.def b/templates/policy/prefix-list/node.tag/description/node.def index 1803aa14..8e10bcb9 100644 --- a/templates/policy/prefix-list/node.tag/description/node.def +++ b/templates/policy/prefix-list/node.tag/description/node.def @@ -1,2 +1,2 @@ type: txt -help: "Prefix list description" +help: Prefix list description diff --git a/templates/policy/prefix-list/node.tag/rule/node.def b/templates/policy/prefix-list/node.tag/rule/node.def index f59d1ab4..841e824c 100644 --- a/templates/policy/prefix-list/node.tag/rule/node.def +++ b/templates/policy/prefix-list/node.tag/rule/node.def @@ -1,37 +1,37 @@ tag: type: u32 -help: "Specify prefix-list rule number" -commit: $(./prefix/) != ""; "must set a prefix" -commit: $(./action/) != ""; "must specify an action before committing" -delete: "touch /tmp/protocols-$(../@)-$(@).\\$PPID \ - LEN=`echo $(@) | awk -F/ '{ print \\$2 }'` ; \ - if [ -n \"$(./ge/@)\" ]; then \ - COND=\"ge $(./ge/@) \"; +help: Specify prefix-list rule number +commit:expression: $VAR(./prefix/) != ""; "must set a prefix" +commit:expression: $VAR(./action/) != ""; "must specify an action before committing" +delete:expression: "touch /tmp/protocols-$VAR(../@)-$VAR(@).$PPID \ + LEN=`echo $VAR(@) | awk -F/ '{ print $2 }'` ; \ + if [ -n \"$VAR(./ge/@)\" ]; then \ + COND=\"ge $VAR(./ge/@) \"; fi; - if [ -n \"$(./le/@)\" ]; then \ - COND=\"\\$COND le $(./le/@) \"; \ + if [ -n \"$VAR(./le/@)\" ]; then \ + COND=\"$COND le $VAR(./le/@) \"; \ fi; \ - \\${vyatta_sbindir}/vyatta-vtysh.pl -c \"configure terminal\" \ - -c \"no ip prefix-list $(../@) seq $(@) $(./action/@) $(./prefix/@) \\$COND \" " -end: "LEN=`echo $(./prefix/@) | awk -F/ '{ print \\$2 }'` ; \ - if [ -n \"$(./ge/@)\" ]; then \ - if [ \\$LEN -ge $(./ge/@) ]; then \ + ${vyatta_sbindir}/vyatta-vtysh.pl -c \"configure terminal\" \ + -c \"no ip prefix-list $VAR(../@) seq $VAR(@) $VAR(./action/@) $VAR(./prefix/@) $COND \" " +end:expression: "LEN=`echo $VAR(./prefix/@) | awk -F/ '{ print $2 }'` ; \ + if [ -n \"$VAR(./ge/@)\" ]; then \ + if [ $LEN -ge $VAR(./ge/@) ]; then \ echo ge must be greater than prefix length ;\ exit 1 ; \ fi ; \ - COND=\"ge $(./ge/@) \"; + COND=\"ge $VAR(./ge/@) \"; fi; - if [ -n \"$(./le/@)\" ]; then \ - if [ $(./le/@) -ne 32 ] && [ -n \"$(./ge/@)\" ] && [ $(./le/@) -le $(./ge/@) ]; then \ + if [ -n \"$VAR(./le/@)\" ]; then \ + if [ $VAR(./le/@) -ne 32 ] && [ -n \"$VAR(./ge/@)\" ] && [ $VAR(./le/@) -le $VAR(./ge/@) ]; then \ echo le must be greater than or equal to ge ; \ exit 1 ; \ fi ; \ - COND=\"\\$COND le $(./le/@) \"; \ + COND=\"$COND le $VAR(./le/@) \"; \ fi; \ - if [ -f \"/tmp/protocols-$(../@)-$(@).\\$PPID\" ]; then \ - rm -f \"protocols-$(../@)-$(@).\\$PPID\" ; \ + if [ -f \"/tmp/protocols-$VAR(../@)-$VAR(@).$PPID\" ]; then \ + rm -f \"protocols-$VAR(../@)-$VAR(@).$PPID\" ; \ else \ - \\${vyatta_sbindir}/vyatta-vtysh.pl -c \"configure terminal\" \ - -c \"ip prefix-list $(../@) seq $(@) $(./action/@) $(./prefix/@) \\$COND \" ; \ + ${vyatta_sbindir}/vyatta-vtysh.pl -c \"configure terminal\" \ + -c \"ip prefix-list $VAR(../@) seq $VAR(@) $VAR(./action/@) $VAR(./prefix/@) $COND \" ; \ fi ; \ exit 0 ; " diff --git a/templates/policy/prefix-list/node.tag/rule/node.tag/action/node.def b/templates/policy/prefix-list/node.tag/rule/node.tag/action/node.def index eeb8f9e5..4cdf4170 100644 --- a/templates/policy/prefix-list/node.tag/rule/node.tag/action/node.def +++ b/templates/policy/prefix-list/node.tag/rule/node.tag/action/node.def @@ -1,3 +1,3 @@ type: txt -help: "Action to take on prefixes matching this rule" -syntax: $(@) in "permit", "deny"; "action must be permit or deny" +help: Action to take on prefixes matching this rule +syntax:expression: $VAR(@) in "permit", "deny"; "action must be permit or deny" diff --git a/templates/policy/prefix-list/node.tag/rule/node.tag/description/node.def b/templates/policy/prefix-list/node.tag/rule/node.tag/description/node.def index 00fed102..b8e3095b 100644 --- a/templates/policy/prefix-list/node.tag/rule/node.tag/description/node.def +++ b/templates/policy/prefix-list/node.tag/rule/node.tag/description/node.def @@ -1,2 +1,2 @@ type: txt -help: "Description for this rule" +help: Description for this rule diff --git a/templates/policy/prefix-list/node.tag/rule/node.tag/ge/node.def b/templates/policy/prefix-list/node.tag/rule/node.tag/ge/node.def index 12470415..ae818e87 100644 --- a/templates/policy/prefix-list/node.tag/rule/node.tag/ge/node.def +++ b/templates/policy/prefix-list/node.tag/rule/node.tag/ge/node.def @@ -1,3 +1,3 @@ type: u32 -help: "Prefix greater than or equal to" -syntax: $(@) >= 0 && $(@) <= 32; "ge must be between 0 and 32" +help: Prefix greater than or equal to +syntax:expression: $VAR(@) >= 0 && $VAR(@) <= 32; "ge must be between 0 and 32" diff --git a/templates/policy/prefix-list/node.tag/rule/node.tag/le/node.def b/templates/policy/prefix-list/node.tag/rule/node.tag/le/node.def index 5b017010..e108cd60 100644 --- a/templates/policy/prefix-list/node.tag/rule/node.tag/le/node.def +++ b/templates/policy/prefix-list/node.tag/rule/node.tag/le/node.def @@ -1,3 +1,3 @@ type: u32 -help: "Prefix less than or equal to" -syntax: $(@) >= 0 && $(@) <= 32; "le must be between 0 and 32" +help: Prefix less than or equal to +syntax:expression: $VAR(@) >= 0 && $VAR(@) <= 32; "le must be between 0 and 32" diff --git a/templates/policy/prefix-list/node.tag/rule/node.tag/prefix/node.def b/templates/policy/prefix-list/node.tag/rule/node.tag/prefix/node.def index 5da0b4f5..5494d284 100644 --- a/templates/policy/prefix-list/node.tag/rule/node.tag/prefix/node.def +++ b/templates/policy/prefix-list/node.tag/rule/node.tag/prefix/node.def @@ -1,2 +1,2 @@ type: ipv4net -help: "Prefix to match against this rule" +help: Prefix to match against this rule -- cgit v1.2.3