From 871890ad5952cd7f099f531453d8abe0b2f89ffc Mon Sep 17 00:00:00 2001 From: Stig Thormodsrud Date: Tue, 4 Jan 2011 14:08:16 -0800 Subject: Revert "OSPFv3 templates replaced to correspond new backend" This reverts commit d1bc0854513d794245bb53f4aa785abd4d70341f. --- templates/protocols/ospfv3/area/node.def | 3 ++- .../ospfv3/area/node.tag/.filter-list/node.tag/node.def | 6 ++++++ .../protocols/ospfv3/area/node.tag/export-list/node.def | 6 ++++++ .../protocols/ospfv3/area/node.tag/import-list/node.def | 6 ++++++ .../protocols/ospfv3/area/node.tag/interface/node.def | 6 ++++++ templates/protocols/ospfv3/area/node.tag/range/node.def | 16 ++++++++++++++++ .../area/node.tag/range/node.tag/advertise/node.def | 7 ++++++- .../area/node.tag/range/node.tag/not-advertise/node.def | 6 ++++++ templates/protocols/ospfv3/node.def | 3 ++- templates/protocols/ospfv3/parameters/router-id/node.def | 3 +++ templates/protocols/ospfv3/redistribute/bgp/node.def | 12 ++++++++++++ .../protocols/ospfv3/redistribute/connected/node.def | 12 ++++++++++++ templates/protocols/ospfv3/redistribute/kernel/node.def | 11 +++++++++++ templates/protocols/ospfv3/redistribute/ripng/node.def | 12 ++++++++++++ templates/protocols/ospfv3/redistribute/static/node.def | 12 ++++++++++++ 15 files changed, 118 insertions(+), 3 deletions(-) diff --git a/templates/protocols/ospfv3/area/node.def b/templates/protocols/ospfv3/area/node.def index f3824397..73750abb 100644 --- a/templates/protocols/ospfv3/area/node.def +++ b/templates/protocols/ospfv3/area/node.def @@ -1,5 +1,6 @@ tag: type: txt help: OSPFv3 Area -syntax:expression: exec "/opt/vyatta/sbin/vyatta-ospfv3.pl --check-area --area=$VAR(@)" +syntax:expression: exec "/opt/vyatta/sbin/vyatta_quagga_utils.pl --check-ospf-area $VAR(@)"; "Invalid OSFPv3 area \"$VAR(@)\" " +val_help: u32; OSPFv3 area in decimal notation val_help: ipv4; OSPFv3 area in dotted decimal notation diff --git a/templates/protocols/ospfv3/area/node.tag/.filter-list/node.tag/node.def b/templates/protocols/ospfv3/area/node.tag/.filter-list/node.tag/node.def index 5fa7a60c..6bcaaf77 100644 --- a/templates/protocols/ospfv3/area/node.tag/.filter-list/node.tag/node.def +++ b/templates/protocols/ospfv3/area/node.tag/.filter-list/node.tag/node.def @@ -2,3 +2,9 @@ tag: type: txt help: Direction of filter (in|out) allowed: echo "in out" +create:expression: "vtysh -c \"configure terminal\" \ + -c \"router ospf6 \" \ + -c \"area $VAR(../../@) filter-list $VAR(../@) $VAR(@) \"; " +delete:expression: "vtysh -c \"configure terminal\" \ + -c \"router ospf6 \" \ + -c \"no area $VAR(../../@) filter-list $VAR(../@) $VAR(@) \"; " diff --git a/templates/protocols/ospfv3/area/node.tag/export-list/node.def b/templates/protocols/ospfv3/area/node.tag/export-list/node.def index 4e603e7d..a27ca264 100644 --- a/templates/protocols/ospfv3/area/node.tag/export-list/node.def +++ b/templates/protocols/ospfv3/area/node.tag/export-list/node.def @@ -1,2 +1,8 @@ type: txt help: Name of export-list +create:expression: "vtysh -c \"configure terminal\" \ + -c \"router ospf6 \" \ + -c \"area $VAR(../@) export-list $VAR(@) \"; " +delete:expression: "vtysh -c \"configure terminal\" \ + -c \"router ospf6 \" \ + -c \"no area $VAR(../@) export-list $VAR(@) \"; " diff --git a/templates/protocols/ospfv3/area/node.tag/import-list/node.def b/templates/protocols/ospfv3/area/node.tag/import-list/node.def index 43feacca..cc689ab2 100644 --- a/templates/protocols/ospfv3/area/node.tag/import-list/node.def +++ b/templates/protocols/ospfv3/area/node.tag/import-list/node.def @@ -1,2 +1,8 @@ type: txt help: Name of import-list +create:expression: "vtysh -c \"configure terminal\" \ + -c \"router ospf6 \" \ + -c \"area $VAR(../@) import-list $VAR(@) \"; " +delete:expression: "vtysh -c \"configure terminal\" \ + -c \"router ospf6 \" \ + -c \"no area $VAR(../@) import-list $VAR(@) \"; " diff --git a/templates/protocols/ospfv3/area/node.tag/interface/node.def b/templates/protocols/ospfv3/area/node.tag/interface/node.def index 9263778c..046b78d6 100644 --- a/templates/protocols/ospfv3/area/node.tag/interface/node.def +++ b/templates/protocols/ospfv3/area/node.tag/interface/node.def @@ -2,4 +2,10 @@ multi: type: txt help: OSPFv3 area interface +create: vtysh -c "configure terminal" -c "router ospf6" \ + -c "interface $VAR(@) area $VAR(../@)" + +delete: vtysh -c "configure terminal" -c "router ospf6" \ + -c "no interface $VAR(@) area $VAR(../@)" + allowed: ${vyatta_sbindir}/vyatta-interfaces.pl --show all diff --git a/templates/protocols/ospfv3/area/node.tag/range/node.def b/templates/protocols/ospfv3/area/node.tag/range/node.def index 6249e511..4b594cd9 100644 --- a/templates/protocols/ospfv3/area/node.tag/range/node.def +++ b/templates/protocols/ospfv3/area/node.tag/range/node.def @@ -2,3 +2,19 @@ tag: type: ipv6net help: Specify IPv6 prefix (border routers only) syntax:expression: exec "${vyatta_sbindir}/check_prefix_boundary $VAR(@)" + +delete: touch /tmp/ospf6-range.$PPID + +end: if [ -f /tmp/ospf6-range.$PPID ]; then + vtysh -c "configure terminal" \ + -c "router ospf6" \ + -c "no area $VAR(../@) range $VAR(@)"; + rm /tmp/ospf6-range.$PPID; + else + vtysh --noerror -c "configure terminal" \ + -c "router ospf6" \ + -c "no area $VAR(../@) range $VAR(@)"; + vtysh -c "configure terminal" \ + -c "router ospf6" \ + -c "area $VAR(../@) range $VAR(@)"; + fi; diff --git a/templates/protocols/ospfv3/area/node.tag/range/node.tag/advertise/node.def b/templates/protocols/ospfv3/area/node.tag/range/node.tag/advertise/node.def index 29e0d619..81be1db0 100644 --- a/templates/protocols/ospfv3/area/node.tag/range/node.tag/advertise/node.def +++ b/templates/protocols/ospfv3/area/node.tag/range/node.tag/advertise/node.def @@ -1,2 +1,7 @@ help: Advertise this range - +create:expression: "vtysh -c \"configure terminal\" \ + -c \"router ospf6\" \ + -c \"area $VAR(../../@) range $VAR(../@) advertise\"; " +delete:expression: "vtysh -c \"configure terminal\" \ + -c \"router ospf6\" \ + -c \"no area $VAR(../../@) range $VAR(../@) advertise\"; " diff --git a/templates/protocols/ospfv3/area/node.tag/range/node.tag/not-advertise/node.def b/templates/protocols/ospfv3/area/node.tag/range/node.tag/not-advertise/node.def index bb524e98..d0a74ecd 100644 --- a/templates/protocols/ospfv3/area/node.tag/range/node.tag/not-advertise/node.def +++ b/templates/protocols/ospfv3/area/node.tag/range/node.tag/not-advertise/node.def @@ -1 +1,7 @@ help: Do not advertise this range +create:expression: "vtysh -c \"configure terminal\" \ + -c \"router ospf6\" \ + -c \"area $VAR(../../@) range $VAR(../@) not-advertise\"; " +delete:expression: "vtysh -c \"configure terminal\" \ + -c \"router ospf6\" \ + -c \"no area $VAR(../../@) range $VAR(../@) not-advertise\"; " diff --git a/templates/protocols/ospfv3/node.def b/templates/protocols/ospfv3/node.def index 0776b936..72e1886f 100644 --- a/templates/protocols/ospfv3/node.def +++ b/templates/protocols/ospfv3/node.def @@ -1,3 +1,4 @@ priority: 640 help: IPv6 Open Shortest Path First protocol (OSPFv3) parameters -end: ${vyatta_sbindir}/vyatta-ospfv3.pl --main +create: vtysh -c "configure terminal" -c "router ospf6" +delete: vtysh -c "configure terminal" -c "no router ospf6" diff --git a/templates/protocols/ospfv3/parameters/router-id/node.def b/templates/protocols/ospfv3/parameters/router-id/node.def index 659cccf1..f0a02436 100644 --- a/templates/protocols/ospfv3/parameters/router-id/node.def +++ b/templates/protocols/ospfv3/parameters/router-id/node.def @@ -1,2 +1,5 @@ type: ipv4 help: Router identifier +update:expression: "vtysh -c \"configure terminal\" \ + -c \"router ospf6\" \ + -c \"router-id $VAR(@)\" " diff --git a/templates/protocols/ospfv3/redistribute/bgp/node.def b/templates/protocols/ospfv3/redistribute/bgp/node.def index c18804bc..3541a9a4 100644 --- a/templates/protocols/ospfv3/redistribute/bgp/node.def +++ b/templates/protocols/ospfv3/redistribute/bgp/node.def @@ -1 +1,13 @@ help: Redistribute bgp routes + +end: vtysh -c "configure terminal" \ + -c "router ospf6" \ + -c "no redistribute bgp"; + if [ "$COMMIT_ACTION" = "SET" -o "$COMMIT_ACTION" = "ACTIVE" ]; then + if [ -n "$VAR(./route-map/@)" ]; then + COND="route-map $VAR(./route-map/@)"; + fi; + vtysh -c "configure terminal" \ + -c "router ospf6" \ + -c "redistribute bgp $COND"; + fi; diff --git a/templates/protocols/ospfv3/redistribute/connected/node.def b/templates/protocols/ospfv3/redistribute/connected/node.def index 37a8bd6b..d9b43cb0 100644 --- a/templates/protocols/ospfv3/redistribute/connected/node.def +++ b/templates/protocols/ospfv3/redistribute/connected/node.def @@ -1 +1,13 @@ help: Redistribute connected routes + +end: vtysh -c "configure terminal" \ + -c "router ospf6" \ + -c "no redistribute connected"; + if [ "$COMMIT_ACTION" = "SET" -o "$COMMIT_ACTION" = "ACTIVE" ]; then + if [ -n "$VAR(./route-map/@)" ]; then + COND="route-map $VAR(./route-map/@)"; + fi; + vtysh -c "configure terminal" \ + -c "router ospf6" \ + -c "redistribute connected $COND"; + fi; diff --git a/templates/protocols/ospfv3/redistribute/kernel/node.def b/templates/protocols/ospfv3/redistribute/kernel/node.def index 316ca3b8..78fe7d36 100644 --- a/templates/protocols/ospfv3/redistribute/kernel/node.def +++ b/templates/protocols/ospfv3/redistribute/kernel/node.def @@ -1,2 +1,13 @@ help: Redistribute kernel routes +end: vtysh -c "configure terminal" \ + -c "router ospf6" \ + -c "no redistribute kernel"; + if [ "$COMMIT_ACTION" = "SET" -o "$COMMIT_ACTION" = "ACTIVE" ]; then + if [ -n "$VAR(./route-map/@)" ]; then + COND="route-map $VAR(./route-map/@)"; + fi; + vtysh -c "configure terminal" \ + -c "router ospf6" \ + -c "redistribute kernel $COND"; + fi; diff --git a/templates/protocols/ospfv3/redistribute/ripng/node.def b/templates/protocols/ospfv3/redistribute/ripng/node.def index 0aba8758..f418999a 100644 --- a/templates/protocols/ospfv3/redistribute/ripng/node.def +++ b/templates/protocols/ospfv3/redistribute/ripng/node.def @@ -1 +1,13 @@ help: Redistribute RIPNG routes + +end: vtysh -c "configure terminal" \ + -c "router ospf6" \ + -c "no redistribute ripng"; + if [ "$COMMIT_ACTION" = "SET" -o "$COMMIT_ACTION" = "ACTIVE" ]; then + if [ -n "$VAR(./route-map/@)" ]; then + COND="route-map $VAR(./route-map/@)"; + fi; + vtysh -c "configure terminal" \ + -c "router ospf6" \ + -c "redistribute ripng $COND"; + fi; diff --git a/templates/protocols/ospfv3/redistribute/static/node.def b/templates/protocols/ospfv3/redistribute/static/node.def index fd4c7b04..d82d5f05 100644 --- a/templates/protocols/ospfv3/redistribute/static/node.def +++ b/templates/protocols/ospfv3/redistribute/static/node.def @@ -1 +1,13 @@ help: Redistribute static routes + +end: vtysh -c "configure terminal" \ + -c "router ospf6" \ + -c "no redistribute static"; + if [ "$COMMIT_ACTION" = "SET" -o "$COMMIT_ACTION" = "ACTIVE" ]; then + if [ -n "$VAR(./route-map/@)" ]; then + COND="route-map $VAR(./route-map/@)"; + fi; + vtysh -c "configure terminal" \ + -c "router ospf6" \ + -c "redistribute static $COND"; + fi; -- cgit v1.2.3