summaryrefslogtreecommitdiff
path: root/templates/policy
diff options
context:
space:
mode:
authorStig Thormodsrud <stig@uffda.(none)>2007-11-15 11:48:49 -0800
committerStig Thormodsrud <stig@uffda.(none)>2007-11-15 11:48:49 -0800
commit0529c54dd6ceef4ca301344407653c00883835ff (patch)
treeb2935c0d3c25b54c43514eabada7524dcf9360d7 /templates/policy
parent1a9535e68042f67087cd400523dc42103292c2fe (diff)
downloadvyatta-cfg-quagga-0529c54dd6ceef4ca301344407653c00883835ff.tar.gz
vyatta-cfg-quagga-0529c54dd6ceef4ca301344407653c00883835ff.zip
Fix "set policy prefix".
Diffstat (limited to 'templates/policy')
-rw-r--r--templates/policy/prefix-list/node.tag/rule/node.def11
-rw-r--r--templates/policy/prefix-list/node.tag/rule/node.tag/action/node.def1
2 files changed, 7 insertions, 5 deletions
diff --git a/templates/policy/prefix-list/node.tag/rule/node.def b/templates/policy/prefix-list/node.tag/rule/node.def
index 12a6bfb3..35ebe6e8 100644
--- a/templates/policy/prefix-list/node.tag/rule/node.def
+++ b/templates/policy/prefix-list/node.tag/rule/node.def
@@ -1,26 +1,27 @@
tag:
type: u32
help: "Specify prefix-list rule number"
+commit: $(./prefix/) != ""; "must set a prefix"
delete: "touch /tmp/protocols-$(../@)-$(@).\\$PPID \
LEN=`echo $(@) | awk -F/ '{ print \\$2 }'` ; \
if [ -n \"$(./ge/@)\" ]; then \
COND=\"ge $(./ge/@) \";
fi;
- if [ -n \"$(./le/@)\" ] && [ $(./le/@) -ne 32 ]; then \
+ if [ -n \"$(./le/@)\" ]; then \
COND=\"\\$COND le $(./le/@) \"; \
fi; \
/usr/bin/vtysh -c \"configure terminal\" \
-c \"no ip prefix-list $(../@) seq $(@) $(./action/@) $(./prefix/@) \\$COND \" "
-end: "LEN=`echo $(@) | awk -F/ '{ print \\$2 }'` ; \
+end: "LEN=`echo $(./prefix/@) | awk -F/ '{ print \\$2 }'` ; \
if [ -n \"$(./ge/@)\" ]; then \
- if [ \\$LEN -le $(./ge/@) ]; then \
+ if [ \\$LEN -ge $(./ge/@) ]; then \
echo ge must be greater than prefix length ;\
exit 1 ; \
fi ; \
COND=\"ge $(./ge/@) \";
fi;
- if [ -n \"$(./le/@)\" ] && [ $(./le/@) -ne 32 ]; then \
- if [ $(./le/@) -le $(./ge/@) ]; then \
+ if [ -n \"$(./le/@)\" ]; then \
+ if [ $(./le/@) -ne 32 ] && [ -n \"$(./ge/@)\" ] && [ $(./le/@) -le $(./ge/@) ]; then \
echo le must be greater than or equal to ge ; \
exit 1 ; \
fi ; \
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..9948b01e 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,4 @@
type: txt
+default: "deny"
help: "Action to take on prefixes matching this rule"
syntax: $(@) in "permit", "deny"; "action must be permit or deny"