summaryrefslogtreecommitdiff
path: root/op-mode-definitions/show-ip-route.xml.in
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-12-13 21:06:47 +0100
committerChristian Poessinger <christian@poessinger.com>2021-12-13 21:08:15 +0100
commit3f2173873e0519ea253759e7e119b2bcaea596bb (patch)
treeeed586a3e466f5c32563c58630e62f0b9ef3df80 /op-mode-definitions/show-ip-route.xml.in
parent88c38dda4b872d2108156b56538302f4c5058a7e (diff)
downloadvyos-1x-3f2173873e0519ea253759e7e119b2bcaea596bb.tar.gz
vyos-1x-3f2173873e0519ea253759e7e119b2bcaea596bb.zip
op-mode: xml: refactor "show ip(v6) route" to use #include building blocks
This change then adds supper to filter for given route types under a VRF instance. You will have "show ip route bgp" in the global VRF and "show ip route vrf red bgp" in the red VRF. Same commands apply to IPv6 routes.
Diffstat (limited to 'op-mode-definitions/show-ip-route.xml.in')
-rw-r--r--op-mode-definitions/show-ip-route.xml.in109
1 files changed, 25 insertions, 84 deletions
diff --git a/op-mode-definitions/show-ip-route.xml.in b/op-mode-definitions/show-ip-route.xml.in
index fdbb6859d..1e906672d 100644
--- a/op-mode-definitions/show-ip-route.xml.in
+++ b/op-mode-definitions/show-ip-route.xml.in
@@ -13,12 +13,7 @@
</properties>
<command>vtysh -c "show ip route"</command>
<children>
- <leafNode name="bgp">
- <properties>
- <help>Show IP BGP routes</help>
- </properties>
- <command>vtysh -c "show ip route bgp"</command>
- </leafNode>
+ #include <include/show-route-bgp.xml.i>
<node name="cache">
<properties>
<help>Show kernel route cache</help>
@@ -34,12 +29,7 @@
</properties>
<command>ip -s route list cache $5</command>
</tagNode>
- <leafNode name="connected">
- <properties>
- <help>Show IP connected routes</help>
- </properties>
- <command>vtysh -c "show ip route connected"</command>
- </leafNode>
+ #include <include/show-route-connected.xml.i>
<node name="forward">
<properties>
<help>Show kernel route table</help>
@@ -55,76 +45,15 @@
</properties>
<command>ip -s route list $5</command>
</tagNode>
- <leafNode name="isis">
- <properties>
- <help>Show IP IS-IS routes</help>
- </properties>
- <command>vtysh -c "show ip route isis"</command>
- </leafNode>
- <leafNode name="kernel">
- <properties>
- <help>Show IP kernel routes</help>
- </properties>
- <command>vtysh -c "show ip route kernel"</command>
- </leafNode>
- <leafNode name="ospf">
- <properties>
- <help>Show IP OSPF routes</help>
- </properties>
- <command>vtysh -c "show ip route ospf"</command>
- </leafNode>
- <leafNode name="rip">
- <properties>
- <help>Show IP RIP routes</help>
- </properties>
- <command>vtysh -c "show ip route rip"</command>
- </leafNode>
- <leafNode name="static">
- <properties>
- <help>Show IP static routes</help>
- </properties>
- <command>vtysh -c "show ip route static"</command>
- </leafNode>
- <leafNode name="summary">
- <properties>
- <help>Show IP routes summary</help>
- </properties>
- <command>vtysh -c "show ip route summary"</command>
- </leafNode>
- <leafNode name="supernets-only">
- <properties>
- <help>Show IP supernet routes</help>
- </properties>
- <command>vtysh -c "show ip route supernets-only"</command>
- </leafNode>
- <node name="table">
- <properties>
- <help>Show IP routes in policy table</help>
- </properties>
- </node>
- <tagNode name="table">
- <properties>
- <help>Show IP routes in policy table</help>
- <completionHelp>
- <list>&lt;1-200&gt;</list>
- </completionHelp>
- </properties>
- <command>vtysh -c "show ip route table $5"</command>
- </tagNode>
- <node name="tag">
- <properties>
- <help>Show only routes with tag</help>
- </properties>
- </node>
- <tagNode name="tag">
- <properties>
- <help>Tag value</help>
- <completionHelp>
- <list>&lt;1-4294967295&gt;</list>
- </completionHelp>
- </properties>
- <command>vtysh -c "show ip route tag $5"</command>
- </tagNode>
+ #include <include/show-route-isis.xml.i>
+ #include <include/show-route-kernel.xml.i>
+ #include <include/show-route-ospf.xml.i>
+ #include <include/show-route-rip.xml.i>
+ #include <include/show-route-static.xml.i>
+ #include <include/show-route-summary.xml.i>
+ #include <include/show-route-supernets-only.xml.i>
+ #include <include/show-route-table.xml.i>
+ #include <include/show-route-tag.xml.i>
<tagNode name="vrf">
<properties>
<help>Show IP routes in VRF</help>
@@ -133,7 +62,19 @@
<path>vrf name</path>
</completionHelp>
</properties>
- <command>vtysh -c "show ip route vrf $5"</command>
+ <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
+ <children>
+ #include <include/show-route-bgp.xml.i>
+ #include <include/show-route-connected.xml.i>
+ #include <include/show-route-isis.xml.i>
+ #include <include/show-route-kernel.xml.i>
+ #include <include/show-route-ospf.xml.i>
+ #include <include/show-route-rip.xml.i>
+ #include <include/show-route-static.xml.i>
+ #include <include/show-route-summary.xml.i>
+ #include <include/show-route-supernets-only.xml.i>
+ #include <include/show-route-tag.xml.i>
+ </children>
</tagNode>
</children>
</node>
@@ -144,7 +85,7 @@
<list>&lt;x.x.x.x&gt; &lt;x.x.x.x/x&gt;</list>
</completionHelp>
</properties>
- <command>vtysh -c "show ip route $4"</command>
+ <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
<children>
<leafNode name="longer-prefixes">
<properties>