summaryrefslogtreecommitdiff
path: root/templates/policy/prefix-list6
diff options
context:
space:
mode:
authorStig Thormodsrud <stig@vyatta.com>2009-10-30 12:19:25 -0700
committerStig Thormodsrud <stig@vyatta.com>2009-10-30 12:19:25 -0700
commit722b77390b977f4ff67c63afcdc4dde61408cb8f (patch)
treeeb640f39303232a883fe55f1ae76c0fcd3ec001e /templates/policy/prefix-list6
parentb7ed3c86dbbe8dfc711d0e194294f1e2d137d56d (diff)
downloadvyatta-cfg-quagga-722b77390b977f4ff67c63afcdc4dde61408cb8f.tar.gz
vyatta-cfg-quagga-722b77390b977f4ff67c63afcdc4dde61408cb8f.zip
First pass of IPv6 policy.
Diffstat (limited to 'templates/policy/prefix-list6')
-rw-r--r--templates/policy/prefix-list6/node.def8
-rw-r--r--templates/policy/prefix-list6/node.tag/description/node.def3
-rw-r--r--templates/policy/prefix-list6/node.tag/rule/node.def44
-rw-r--r--templates/policy/prefix-list6/node.tag/rule/node.tag/action/node.def8
-rw-r--r--templates/policy/prefix-list6/node.tag/rule/node.tag/description/node.def2
-rw-r--r--templates/policy/prefix-list6/node.tag/rule/node.tag/ge/node.def7
-rw-r--r--templates/policy/prefix-list6/node.tag/rule/node.tag/le/node.def7
-rw-r--r--templates/policy/prefix-list6/node.tag/rule/node.tag/prefix/node.def5
8 files changed, 84 insertions, 0 deletions
diff --git a/templates/policy/prefix-list6/node.def b/templates/policy/prefix-list6/node.def
new file mode 100644
index 00000000..07796eae
--- /dev/null
+++ b/templates/policy/prefix-list6/node.def
@@ -0,0 +1,8 @@
+tag:
+type: txt
+help: Set IPv6 prefix-list filter
+
+syntax:expression: pattern $VAR(@) "^[-a-zA-Z0-9.]+$" ; "prefix-list6 name must be alpha-numeric"
+
+comp_help: possible completions:
+ <txt> prefix-list list name
diff --git a/templates/policy/prefix-list6/node.tag/description/node.def b/templates/policy/prefix-list6/node.tag/description/node.def
new file mode 100644
index 00000000..7617ee52
--- /dev/null
+++ b/templates/policy/prefix-list6/node.tag/description/node.def
@@ -0,0 +1,3 @@
+type: txt
+help: Set a description for this prefix-list6
+
diff --git a/templates/policy/prefix-list6/node.tag/rule/node.def b/templates/policy/prefix-list6/node.tag/rule/node.def
new file mode 100644
index 00000000..644f09c1
--- /dev/null
+++ b/templates/policy/prefix-list6/node.tag/rule/node.def
@@ -0,0 +1,44 @@
+tag:
+type: u32
+help: Set a rule for this prefix-list6
+
+syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 65535; "rule number must be between 1 and 65535"
+
+commit:expression: $VAR(./prefix/) != ""; "policy prefix-list6 $VAR(../@) rule $VAR(@): You must specify a prefix"
+
+commit:expression: $VAR(./action/) != ""; "policy prefix-list6 $VAR(../@) rule $VAR(@): You must specify an action"
+
+delete: len=`echo $VAR(@) | awk -F/ '{ print $2 }'` ;
+ if [ -n "$VAR(./ge/@)" ]; then
+ cond="ge $VAR(./ge/@) ";
+ fi;
+ if [ -n "$VAR(./le/@)" ]; then
+ cond="$cond le $VAR(./le/@) ";
+ fi;
+ vyatta-vtysh -c "configure terminal" \
+ -c "no ipv6 prefix-list $VAR(../@) seq $VAR(@) $VAR(./action/@) $VAR(./prefix/@) $cond "
+
+end: len=`echo $VAR(./prefix/@) | awk -F/ '{ print $2 }'` ;
+ if [ -n "$VAR(./ge/@)" ]; then
+ if [ $len -ge $VAR(./ge/@) ]; then
+ echo "policy prefix-list $VAR(../@) rule $VAR(@): ge must be greater than prefix length";
+ exit 1 ;
+ fi ;
+ cond="ge $VAR(./ge/@) ";
+ fi;
+ if [ -n "$VAR(./le/@)" ]; then
+ if [ $VAR(./le/@) -ne 128 ] && [ -n "$VAR(./ge/@)" ] && [ $VAR(./le/@) -le $VAR(./ge/@) ]; then
+ echo "policy prefix-list $VAR(../@) rule $VAR(@): le must be greater than or equal to ge";
+ exit 1 ;
+ fi ;
+ cond="$cond le $VAR(./le/@) ";
+ fi;
+
+ if [ ${COMMIT_ACTION} = 'SET' ]; then
+ vyatta-vtysh -c "configure terminal" \
+ -c "ipv6 prefix-list $VAR(../@) seq $VAR(@) $VAR(./action/@) $VAR(./prefix/@) $cond " ;
+ fi;
+ exit 0 ;
+
+comp_help: possible completions:
+ <1-65535> prefix-list rule number \ No newline at end of file
diff --git a/templates/policy/prefix-list6/node.tag/rule/node.tag/action/node.def b/templates/policy/prefix-list6/node.tag/rule/node.tag/action/node.def
new file mode 100644
index 00000000..479c8100
--- /dev/null
+++ b/templates/policy/prefix-list6/node.tag/rule/node.tag/action/node.def
@@ -0,0 +1,8 @@
+type: txt
+help: Set action to take on prefixes matching this rule
+
+syntax:expression: $VAR(@) in "permit", "deny"; "action must be permit or deny"
+
+comp_help: possible completions:
+ permit permit matching prefixes
+ deny deny matching prefixes
diff --git a/templates/policy/prefix-list6/node.tag/rule/node.tag/description/node.def b/templates/policy/prefix-list6/node.tag/rule/node.tag/description/node.def
new file mode 100644
index 00000000..8b6dc54a
--- /dev/null
+++ b/templates/policy/prefix-list6/node.tag/rule/node.tag/description/node.def
@@ -0,0 +1,2 @@
+type: txt
+help: Set a description for this rule
diff --git a/templates/policy/prefix-list6/node.tag/rule/node.tag/ge/node.def b/templates/policy/prefix-list6/node.tag/rule/node.tag/ge/node.def
new file mode 100644
index 00000000..729089a3
--- /dev/null
+++ b/templates/policy/prefix-list6/node.tag/rule/node.tag/ge/node.def
@@ -0,0 +1,7 @@
+type: u32
+help: Set prefix length to match a netmask greater than or equal to it
+
+syntax:expression: $VAR(@) >= 0 && $VAR(@) <= 128; "ge must be between 0 and 128"
+
+comp_help: possible completions:
+ <0-128> netmask greater than length
diff --git a/templates/policy/prefix-list6/node.tag/rule/node.tag/le/node.def b/templates/policy/prefix-list6/node.tag/rule/node.tag/le/node.def
new file mode 100644
index 00000000..1bb344b9
--- /dev/null
+++ b/templates/policy/prefix-list6/node.tag/rule/node.tag/le/node.def
@@ -0,0 +1,7 @@
+type: u32
+help: Set prefix length to match a netmask less than or equal to it
+
+syntax:expression: $VAR(@) >= 0 && $VAR(@) <= 128; "le must be between 0 and 128"
+
+comp_help: possible completions:
+ <0-128> netmask less than length
diff --git a/templates/policy/prefix-list6/node.tag/rule/node.tag/prefix/node.def b/templates/policy/prefix-list6/node.tag/rule/node.tag/prefix/node.def
new file mode 100644
index 00000000..ff9875dc
--- /dev/null
+++ b/templates/policy/prefix-list6/node.tag/rule/node.tag/prefix/node.def
@@ -0,0 +1,5 @@
+type: ipv6net
+help: Set a prefix to match
+
+comp_help: possible completions:
+ <h:h:h:h:h:h:h:h/x> Set the IPv6 prefix