From c999ddec2a30f23121072d51a49003fd822527d7 Mon Sep 17 00:00:00 2001 From: Stig Thormodsrud Date: Wed, 9 Apr 2008 16:39:45 -0700 Subject: 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 <>" --- .../protocols/ospf/area/node.tag/range/node.def | 47 +++++++++++++++++++--- .../area/node.tag/range/node.tag/cost/node.def | 10 ++--- .../node.tag/range/node.tag/not-advertise/node.def | 6 --- .../node.tag/range/node.tag/substitute/node.def | 7 +--- 4 files changed, 45 insertions(+), 25 deletions(-) (limited to 'templates') 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(@)\"; " -- cgit v1.2.3