From 7640413d9dcb66d8a78148edca150fadaef1f60d Mon Sep 17 00:00:00 2001
From: Christian Poessinger <christian@poessinger.com>
Date: Fri, 5 Feb 2021 22:56:01 +0100
Subject: T2450: migrate vrf and static routes to vyos-1x

---
 .../protocols/static/interface-route/node.def      |  7 -----
 .../node.tag/next-hop-interface/node.def           | 32 ----------------------
 .../next-hop-interface/node.tag/disable/node.def   |  1 -
 .../next-hop-interface/node.tag/distance/node.def  |  4 ---
 .../node.tag/next-hop-vrf/node.def                 | 20 --------------
 5 files changed, 64 deletions(-)
 delete mode 100644 templates/protocols/static/interface-route/node.def
 delete mode 100644 templates/protocols/static/interface-route/node.tag/next-hop-interface/node.def
 delete mode 100644 templates/protocols/static/interface-route/node.tag/next-hop-interface/node.tag/disable/node.def
 delete mode 100644 templates/protocols/static/interface-route/node.tag/next-hop-interface/node.tag/distance/node.def
 delete mode 100644 templates/protocols/static/interface-route/node.tag/next-hop-interface/node.tag/next-hop-vrf/node.def

(limited to 'templates/protocols/static/interface-route')

diff --git a/templates/protocols/static/interface-route/node.def b/templates/protocols/static/interface-route/node.def
deleted file mode 100644
index 2b9d75ad..00000000
--- a/templates/protocols/static/interface-route/node.def
+++ /dev/null
@@ -1,7 +0,0 @@
-tag:
-type: ipv4net
-help: Interface based static route
-syntax:expression: exec "ipaddrcheck --verbose --is-ipv4-net $VAR(@)"
-
-commit:expression: $VAR(./next-hop-interface/) != "" ; \
-       "Must add a next-hop-interface for route $VAR(@)"
diff --git a/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.def b/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.def
deleted file mode 100644
index f8bc9270..00000000
--- a/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.def
+++ /dev/null
@@ -1,32 +0,0 @@
-tag:
-type: txt
-help: Next-hop interface [REQUIRED]
-# show all current interface
-# but syntax accepts any interface since it may exist later (ppp etc)
-allowed: ${vyatta_sbindir}/vyatta-interfaces.pl --show all
-
-
-end:
-  if [[ -z "$VAR(./disable)" ]]
-  then
-    if [[ ${COMMIT_ACTION} = 'DELETE' ]]
-    then
-      if ! ${vyatta_sbindir}/vyatta-next-hop-check $VAR(../@) ipv4 interface; then
-        exit 1;
-      fi
-      vtysh -c "configure terminal" \
-                   -c "no ip route $VAR(../@) $VAR(@)"
-    else
-      if [[ -n "$VAR(./distance/@)" ]]; then
-        DIST="$VAR(./distance/@)"
-      fi
-      if [[ -n "$VAR(./next-hop-vrf/@)" ]]; then
-         NEXTHOP_VRF="nexthop-vrf $VAR(./next-hop-vrf/@)"
-      fi
-      vtysh -c "configure terminal" \
-            -c "ip route $VAR(../@) $VAR(@) $NEXTHOP_VRF $DIST";
-    fi
-  else
-      vtysh -c "configure terminal" \
-                   -c "no ip route $VAR(../@) $VAR(@)"
-  fi
diff --git a/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.tag/disable/node.def b/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.tag/disable/node.def
deleted file mode 100644
index 92f2ba51..00000000
--- a/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.tag/disable/node.def
+++ /dev/null
@@ -1 +0,0 @@
-help: Disable IPv4 interface static route
diff --git a/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.tag/distance/node.def b/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.tag/distance/node.def
deleted file mode 100644
index 61abcc65..00000000
--- a/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.tag/distance/node.def
+++ /dev/null
@@ -1,4 +0,0 @@
-type: u32
-help: Distance value for this route
-syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 255; "Must be between (1-255)"
-val_help: u32:1-255; Distance for this route
diff --git a/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.tag/next-hop-vrf/node.def b/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.tag/next-hop-vrf/node.def
deleted file mode 100644
index c4fee0e0..00000000
--- a/templates/protocols/static/interface-route/node.tag/next-hop-interface/node.tag/next-hop-vrf/node.def
+++ /dev/null
@@ -1,20 +0,0 @@
-type: txt
-help: VRF to leak route
-allowed: local -a params
-    eval "params=($(cli-shell-api listNodes vrf name))"
-    echo -n "${params[@]}"
-val_help: <vrf> ; Name of VRF to leak to
-end:
-    if [[ ${COMMIT_ACTION} = 'DELETE' ]]
-      then
-        if ! ${vyatta_sbindir}/vyatta-next-hop-check $VAR(../@) ipv4 address; then
-          exit 1;
-        fi
-        if ${vyatta_sbindir}/vyatta-gateway-static_route-check.pl \
-            "$VAR(../../@)" "$VAR(../@)"
-        then
-          VRF_NAME=$VAR(../../../../@)
-          vtysh -c "configure terminal" \
-                -c "no ip route $VAR(../../@) $VAR(../@) nexthop-vrf $VAR(@)"
-        fi
-    fi
-- 
cgit v1.2.3