summaryrefslogtreecommitdiff
path: root/templates/policy/prefix-list
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2007-10-01 13:14:31 -0700
committerAn-Cheng Huang <ancheng@vyatta.com>2007-10-01 13:14:31 -0700
commitcfa368bbc1d4c55c42c60838e04fc523625932b7 (patch)
treee439217d7e3ebb726b9954d7f823db2b47f18c9d /templates/policy/prefix-list
downloadvyatta-cfg-quagga-cfa368bbc1d4c55c42c60838e04fc523625932b7.tar.gz
vyatta-cfg-quagga-cfa368bbc1d4c55c42c60838e04fc523625932b7.zip
initial import (from eureka /cli).upstream
Diffstat (limited to 'templates/policy/prefix-list')
-rw-r--r--templates/policy/prefix-list/node.def4
-rw-r--r--templates/policy/prefix-list/node.tag/description/node.def2
-rw-r--r--templates/policy/prefix-list/node.tag/rule/node.def35
-rw-r--r--templates/policy/prefix-list/node.tag/rule/node.tag/action/node.def3
-rw-r--r--templates/policy/prefix-list/node.tag/rule/node.tag/description/node.def2
-rw-r--r--templates/policy/prefix-list/node.tag/rule/node.tag/ge/node.def3
-rw-r--r--templates/policy/prefix-list/node.tag/rule/node.tag/le/node.def3
-rw-r--r--templates/policy/prefix-list/node.tag/rule/node.tag/prefix/node.def2
8 files changed, 54 insertions, 0 deletions
diff --git a/templates/policy/prefix-list/node.def b/templates/policy/prefix-list/node.def
new file mode 100644
index 00000000..de9d34ab
--- /dev/null
+++ b/templates/policy/prefix-list/node.def
@@ -0,0 +1,4 @@
+tag:
+type: txt
+help: "Add a prefix list entry"
+syntax: pattern $(@) "^[-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
new file mode 100644
index 00000000..effa9577
--- /dev/null
+++ b/templates/policy/prefix-list/node.tag/description/node.def
@@ -0,0 +1,2 @@
+type: txt
+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
new file mode 100644
index 00000000..7750cba9
--- /dev/null
+++ b/templates/policy/prefix-list/node.tag/rule/node.def
@@ -0,0 +1,35 @@
+tag:
+type: u32; "prefix-list rule number must be an integer"
+help: "Specify prefix-list rule number"
+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 \
+ COND=\"\\$COND le $(./le/@) \"; \
+ fi; \
+ /opt/vyatta/bin/vtysh -c \"configure terminal\" \
+ -c \"no ip prefix-list $(../@) seq $(@) $(./action/@) $(./prefix/@) \\$COND \" "
+end: "LEN=`echo $(@) | awk -F/ '{ print \\$2 }'` ; \
+ if [ -n \"$(./ge/@)\" ]; then \
+ if [ \\$LEN -le $(./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 \
+ echo le must be greater than or equal to ge ; \
+ exit 1 ; \
+ fi ; \
+ COND=\"\\$COND le $(./le/@) \"; \
+ fi; \
+ if [ -f \"/tmp/protocols-$(../@)-$(@).\\$PPID\" ]; then \
+ rm -f \"protocols-$(../@)-$(@).\\$PPID\" ; \
+ else \
+ /opt/vyatta/bin/vtysh -c \"configure terminal\" \
+ -c \"ip prefix-list $(../@) seq $(@) $(./action/@) $(./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
new file mode 100644
index 00000000..4eada21b
--- /dev/null
+++ b/templates/policy/prefix-list/node.tag/rule/node.tag/action/node.def
@@ -0,0 +1,3 @@
+type: txt
+help: "action to take on prefixes matching this rule"
+syntax: $(@) 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
new file mode 100644
index 00000000..3d61ac85
--- /dev/null
+++ b/templates/policy/prefix-list/node.tag/rule/node.tag/description/node.def
@@ -0,0 +1,2 @@
+type: txt
+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
new file mode 100644
index 00000000..638c2b61
--- /dev/null
+++ b/templates/policy/prefix-list/node.tag/rule/node.tag/ge/node.def
@@ -0,0 +1,3 @@
+type: u32
+help: "prefix greater than or equal to"
+syntax: $(@) >= 0 && $(@) <= 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
new file mode 100644
index 00000000..e83ae034
--- /dev/null
+++ b/templates/policy/prefix-list/node.tag/rule/node.tag/le/node.def
@@ -0,0 +1,3 @@
+type: u32
+help: "prefix less than or equal to"
+syntax: $(@) >= 0 && $(@) <= 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
new file mode 100644
index 00000000..ed167d00
--- /dev/null
+++ b/templates/policy/prefix-list/node.tag/rule/node.tag/prefix/node.def
@@ -0,0 +1,2 @@
+type: ipv4net; "prefix-list $(../../@) rule $(../@) prefix: must be an IPv4 prefix"
+help: "prefix to match against this rule"