summaryrefslogtreecommitdiff
path: root/templates/protocols/ospf
diff options
context:
space:
mode:
authorStig Thormodsrud <stig@vyatta.com>2008-04-09 16:39:45 -0700
committerStig Thormodsrud <stig@vyatta.com>2008-04-09 16:39:45 -0700
commitc999ddec2a30f23121072d51a49003fd822527d7 (patch)
treec3b48181c04ae70ddaa2368aebcf332c1d822cd3 /templates/protocols/ospf
parent5a040d2ba78f633b7633f8fded6ac7e14a9d453b (diff)
downloadvyatta-cfg-quagga-c999ddec2a30f23121072d51a49003fd822527d7.tar.gz
vyatta-cfg-quagga-c999ddec2a30f23121072d51a49003fd822527d7.zip
Fix [Bug 3125] "...... range <> no-advertise" should be removed from the config while it is removed from the routing engine by "set protocols ospf area <> range <> substitute
<>"
Diffstat (limited to 'templates/protocols/ospf')
-rw-r--r--templates/protocols/ospf/area/node.tag/range/node.def47
-rw-r--r--templates/protocols/ospf/area/node.tag/range/node.tag/cost/node.def10
-rw-r--r--templates/protocols/ospf/area/node.tag/range/node.tag/not-advertise/node.def6
-rw-r--r--templates/protocols/ospf/area/node.tag/range/node.tag/substitute/node.def7
4 files changed, 45 insertions, 25 deletions
diff --git a/templates/protocols/ospf/area/node.tag/range/node.def b/templates/protocols/ospf/area/node.tag/range/node.def
index 63147ac6..ab689990 100644
--- a/templates/protocols/ospf/area/node.tag/range/node.def
+++ b/templates/protocols/ospf/area/node.tag/range/node.def
@@ -2,9 +2,44 @@ tag:
type: ipv4net
help: Summarize routes matching prefix (border routers only)
syntax:expression: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --check-prefix-boundry $VAR(@)"
-create:expression: "${vyatta_sbindir}/vyatta-vtysh.pl -c \"configure terminal\" \
- -c \"router ospf\" \
- -c \"area $VAR(../@) range $VAR(@)\"; "
-delete:expression: "${vyatta_sbindir}/vyatta-vtysh.pl -c \"configure terminal\" \
- -c \"router ospf\" \
- -c \"no area $VAR(../@) range $VAR(@)\"; "
+
+delete: touch /tmp/ospf-range.$PPID
+
+end: if [ -f /tmp/ospf-range.$PPID ]; then
+ ${vyatta_sbindir}/vyatta-vtysh.pl -c "configure terminal" \
+ -c "router ospf" \
+ -c "no area $VAR(../@) range $VAR(@)";
+ rm /tmp/ospf-range.$PPID;
+ else
+ ${vyatta_sbindir}/vyatta-check-typeless-node.pl \
+ "protocols ospf area $VAR(../@) range $VAR(@) not-advertise";
+ if [ $? -eq 0 ] ; then
+ if [ -n "$VAR(cost/@)" ] || [ -n "$VAR(substitute/@)" ]; then
+ echo "Remove 'not-advertise' before setting cost or substitue";
+ exit 1;
+ fi;
+ ${vyatta_sbindir}/vyatta-vtysh.pl -noerr -c "configure terminal" \
+ -c "router ospf" \
+ -c "no area $VAR(../@) range $VAR(@)";
+ ${vyatta_sbindir}/vyatta-vtysh.pl -c "configure terminal" \
+ -c "router ospf" \
+ -c "area $VAR(../@) range $VAR(@) not-advertise";
+ else
+ ${vyatta_sbindir}/vyatta-vtysh.pl -noerr -c "configure terminal" \
+ -c "router ospf" \
+ -c "no area $VAR(../@) range $VAR(@)";
+ ${vyatta_sbindir}/vyatta-vtysh.pl -c "configure terminal" \
+ -c "router ospf" \
+ -c "area $VAR(../@) range $VAR(@)";
+ if [ -n "$VAR(cost/@)" ]; then
+ ${vyatta_sbindir}/vyatta-vtysh.pl -c "configure terminal" \
+ -c "router ospf" \
+ -c "area $VAR(../@) range $VAR(@) cost $VAR(cost/@)";
+ fi;
+ if [ -n "$VAR(substitute/@)" ]; then
+ ${vyatta_sbindir}/vyatta-vtysh.pl -c "configure terminal" \
+ -c "router ospf" \
+ -c "area $VAR(../@) range $VAR(@) substitute $VAR(substitute/@)";
+ fi;
+ fi;
+ fi;
diff --git a/templates/protocols/ospf/area/node.tag/range/node.tag/cost/node.def b/templates/protocols/ospf/area/node.tag/range/node.tag/cost/node.def
index 11b744db..fcd58871 100644
--- a/templates/protocols/ospf/area/node.tag/range/node.tag/cost/node.def
+++ b/templates/protocols/ospf/area/node.tag/range/node.tag/cost/node.def
@@ -1,11 +1,7 @@
type: u32
help: Metric for this range
+
syntax:expression: $VAR(@) >= 0 && $VAR(@) <= 16777215; "Metric must be between 0-16777215"
-update:expression: "${vyatta_sbindir}/vyatta-vtysh.pl -c \"configure terminal\" \
- -c \"router ospf\" \
- -c \"area $VAR(../../@) range $VAR(../@) cost $VAR(@)\"; "
-delete:expression: "${vyatta_sbindir}/vyatta-vtysh.pl -c \"configure terminal\" \
- -c \"router ospf\" \
- -c \"no area $VAR(../../@) range $VAR(../@) cost $VAR(@)\"; "
+
comp_help: possible completions:
- <0-16777215> Set metric for this range
+ <0-16777215> Set metric for this range
diff --git a/templates/protocols/ospf/area/node.tag/range/node.tag/not-advertise/node.def b/templates/protocols/ospf/area/node.tag/range/node.tag/not-advertise/node.def
index 22a10e0c..0a8079ce 100644
--- a/templates/protocols/ospf/area/node.tag/range/node.tag/not-advertise/node.def
+++ b/templates/protocols/ospf/area/node.tag/range/node.tag/not-advertise/node.def
@@ -1,7 +1 @@
help: Do NOT advertise this range
-create:expression: "${vyatta_sbindir}/vyatta-vtysh.pl -c \"configure terminal\" \
- -c \"router ospf\" \
- -c \"area $VAR(../../@) range $VAR(../@) not-advertise\"; "
-delete:expression: "${vyatta_sbindir}/vyatta-vtysh.pl -c \"configure terminal\" \
- -c \"router ospf\" \
- -c \"no area $VAR(../../@) range $VAR(../@) not-advertise\"; "
diff --git a/templates/protocols/ospf/area/node.tag/range/node.tag/substitute/node.def b/templates/protocols/ospf/area/node.tag/range/node.tag/substitute/node.def
index dba70a07..a691273e 100644
--- a/templates/protocols/ospf/area/node.tag/range/node.tag/substitute/node.def
+++ b/templates/protocols/ospf/area/node.tag/range/node.tag/substitute/node.def
@@ -1,9 +1,4 @@
type: ipv4net
help: Announce area range as another prefix
+
syntax:expression: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --check-prefix-boundry $VAR(@)"
-update:expression: "${vyatta_sbindir}/vyatta-vtysh.pl -c \"configure terminal\" \
- -c \"router ospf\" \
- -c \"area $VAR(../../@) range $VAR(../@) substitute $VAR(@)\"; "
-delete:expression: "${vyatta_sbindir}/vyatta-vtysh.pl -c \"configure terminal\" \
- -c \"router ospf\" \
- -c \"no area $VAR(../../@) range $VAR(../@) substitute $VAR(@)\"; "