From 3f2173873e0519ea253759e7e119b2bcaea596bb Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Mon, 13 Dec 2021 21:06:47 +0100 Subject: 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. --- op-mode-definitions/include/show-route-bgp.xml.i | 8 ++ .../include/show-route-connected.xml.i | 8 ++ op-mode-definitions/include/show-route-isis.xml.i | 8 ++ .../include/show-route-kernel.xml.i | 8 ++ op-mode-definitions/include/show-route-ospf.xml.i | 8 ++ .../include/show-route-ospfv3.xml.i | 8 ++ op-mode-definitions/include/show-route-rip.xml.i | 8 ++ op-mode-definitions/include/show-route-ripng.xml.i | 8 ++ .../include/show-route-static.xml.i | 8 ++ .../include/show-route-summary.xml.i | 8 ++ .../include/show-route-supernets-only.xml.i | 8 ++ op-mode-definitions/include/show-route-table.xml.i | 17 ++++ op-mode-definitions/include/show-route-tag.xml.i | 16 +++ op-mode-definitions/show-ip-route.xml.in | 109 +++++---------------- op-mode-definitions/show-ipv6-route.xml.in | 97 +++++------------- 15 files changed, 172 insertions(+), 155 deletions(-) create mode 100644 op-mode-definitions/include/show-route-bgp.xml.i create mode 100644 op-mode-definitions/include/show-route-connected.xml.i create mode 100644 op-mode-definitions/include/show-route-isis.xml.i create mode 100644 op-mode-definitions/include/show-route-kernel.xml.i create mode 100644 op-mode-definitions/include/show-route-ospf.xml.i create mode 100644 op-mode-definitions/include/show-route-ospfv3.xml.i create mode 100644 op-mode-definitions/include/show-route-rip.xml.i create mode 100644 op-mode-definitions/include/show-route-ripng.xml.i create mode 100644 op-mode-definitions/include/show-route-static.xml.i create mode 100644 op-mode-definitions/include/show-route-summary.xml.i create mode 100644 op-mode-definitions/include/show-route-supernets-only.xml.i create mode 100644 op-mode-definitions/include/show-route-table.xml.i create mode 100644 op-mode-definitions/include/show-route-tag.xml.i (limited to 'op-mode-definitions') diff --git a/op-mode-definitions/include/show-route-bgp.xml.i b/op-mode-definitions/include/show-route-bgp.xml.i new file mode 100644 index 000000000..5c26bf43f --- /dev/null +++ b/op-mode-definitions/include/show-route-bgp.xml.i @@ -0,0 +1,8 @@ + + + + Border Gateway Protocol (BGP) + + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + + diff --git a/op-mode-definitions/include/show-route-connected.xml.i b/op-mode-definitions/include/show-route-connected.xml.i new file mode 100644 index 000000000..37364de64 --- /dev/null +++ b/op-mode-definitions/include/show-route-connected.xml.i @@ -0,0 +1,8 @@ + + + + Connected routes (directly attached subnet or host) + + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + + diff --git a/op-mode-definitions/include/show-route-isis.xml.i b/op-mode-definitions/include/show-route-isis.xml.i new file mode 100644 index 000000000..9ff2ccdc5 --- /dev/null +++ b/op-mode-definitions/include/show-route-isis.xml.i @@ -0,0 +1,8 @@ + + + + Intermediate System to Intermediate System (IS-IS) + + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + + diff --git a/op-mode-definitions/include/show-route-kernel.xml.i b/op-mode-definitions/include/show-route-kernel.xml.i new file mode 100644 index 000000000..8c5ac414e --- /dev/null +++ b/op-mode-definitions/include/show-route-kernel.xml.i @@ -0,0 +1,8 @@ + + + + Kernel routes (not installed via the zebra RIB) + + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + + diff --git a/op-mode-definitions/include/show-route-ospf.xml.i b/op-mode-definitions/include/show-route-ospf.xml.i new file mode 100644 index 000000000..1122aaba5 --- /dev/null +++ b/op-mode-definitions/include/show-route-ospf.xml.i @@ -0,0 +1,8 @@ + + + + Open Shortest Path First (OSPFv2) + + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + + diff --git a/op-mode-definitions/include/show-route-ospfv3.xml.i b/op-mode-definitions/include/show-route-ospfv3.xml.i new file mode 100644 index 000000000..c7a11b7ba --- /dev/null +++ b/op-mode-definitions/include/show-route-ospfv3.xml.i @@ -0,0 +1,8 @@ + + + + Open Shortest Path First (IPv6) (OSPFv3) + + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + + diff --git a/op-mode-definitions/include/show-route-rip.xml.i b/op-mode-definitions/include/show-route-rip.xml.i new file mode 100644 index 000000000..3c2fede28 --- /dev/null +++ b/op-mode-definitions/include/show-route-rip.xml.i @@ -0,0 +1,8 @@ + + + + Routing Information Protocol (RIP) + + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + + diff --git a/op-mode-definitions/include/show-route-ripng.xml.i b/op-mode-definitions/include/show-route-ripng.xml.i new file mode 100644 index 000000000..6e59cb054 --- /dev/null +++ b/op-mode-definitions/include/show-route-ripng.xml.i @@ -0,0 +1,8 @@ + + + + Routing Information Protocol next-generation (IPv6) (RIPng) + + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + + diff --git a/op-mode-definitions/include/show-route-static.xml.i b/op-mode-definitions/include/show-route-static.xml.i new file mode 100644 index 000000000..c2e396763 --- /dev/null +++ b/op-mode-definitions/include/show-route-static.xml.i @@ -0,0 +1,8 @@ + + + + Statically configured routes + + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + + diff --git a/op-mode-definitions/include/show-route-summary.xml.i b/op-mode-definitions/include/show-route-summary.xml.i new file mode 100644 index 000000000..471124562 --- /dev/null +++ b/op-mode-definitions/include/show-route-summary.xml.i @@ -0,0 +1,8 @@ + + + + Summary of all routes + + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + + diff --git a/op-mode-definitions/include/show-route-supernets-only.xml.i b/op-mode-definitions/include/show-route-supernets-only.xml.i new file mode 100644 index 000000000..4d1e7c51f --- /dev/null +++ b/op-mode-definitions/include/show-route-supernets-only.xml.i @@ -0,0 +1,8 @@ + + + + Show supernet entries only + + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + + diff --git a/op-mode-definitions/include/show-route-table.xml.i b/op-mode-definitions/include/show-route-table.xml.i new file mode 100644 index 000000000..c3cf82a86 --- /dev/null +++ b/op-mode-definitions/include/show-route-table.xml.i @@ -0,0 +1,17 @@ + + + + Table to display + + + + + The table number to display + + all + protocols static table + + + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + + diff --git a/op-mode-definitions/include/show-route-tag.xml.i b/op-mode-definitions/include/show-route-tag.xml.i new file mode 100644 index 000000000..8bfa0ae4e --- /dev/null +++ b/op-mode-definitions/include/show-route-tag.xml.i @@ -0,0 +1,16 @@ + + + + Show only routes with tag + + + + + Tag value + + <1-4294967295> + + + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + + 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 @@ vtysh -c "show ip route" - - - Show IP BGP routes - - vtysh -c "show ip route bgp" - + #include Show kernel route cache @@ -34,12 +29,7 @@ ip -s route list cache $5 - - - Show IP connected routes - - vtysh -c "show ip route connected" - + #include Show kernel route table @@ -55,76 +45,15 @@ ip -s route list $5 - - - Show IP IS-IS routes - - vtysh -c "show ip route isis" - - - - Show IP kernel routes - - vtysh -c "show ip route kernel" - - - - Show IP OSPF routes - - vtysh -c "show ip route ospf" - - - - Show IP RIP routes - - vtysh -c "show ip route rip" - - - - Show IP static routes - - vtysh -c "show ip route static" - - - - Show IP routes summary - - vtysh -c "show ip route summary" - - - - Show IP supernet routes - - vtysh -c "show ip route supernets-only" - - - - Show IP routes in policy table - - - - - Show IP routes in policy table - - <1-200> - - - vtysh -c "show ip route table $5" - - - - Show only routes with tag - - - - - Tag value - - <1-4294967295> - - - vtysh -c "show ip route tag $5" - + #include + #include + #include + #include + #include + #include + #include + #include + #include Show IP routes in VRF @@ -133,7 +62,19 @@ vrf name - vtysh -c "show ip route vrf $5" + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + @@ -144,7 +85,7 @@ <x.x.x.x> <x.x.x.x/x> - vtysh -c "show ip route $4" + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ diff --git a/op-mode-definitions/show-ipv6-route.xml.in b/op-mode-definitions/show-ipv6-route.xml.in index 8624574ac..2c5024991 100644 --- a/op-mode-definitions/show-ipv6-route.xml.in +++ b/op-mode-definitions/show-ipv6-route.xml.in @@ -13,12 +13,7 @@ vtysh -c "show ipv6 route" - - - Show IPv6 BGP routes - - vtysh -c "show ipv6 route bgp" - + #include Show kernel IPv6 route cache @@ -34,12 +29,7 @@ ip -s -f inet6 route list cache $5 - - - Show IPv6 connected routes - - vtysh -c "show ipv6 route connected" - + #include Show kernel IPv6 route table @@ -55,71 +45,36 @@ ip -s -f inet6 route list $5 - - - Show IPv6 IS-IS routes - - vtysh -c "show ipv6 route isis" - - - - Show IPv6 Kernel routes - - vtysh -c "show ipv6 route kernel" - - - - Show IPv6 OSPF routes - - vtysh -c "show ipv6 route ospf6" - - - - Show IPv6 RIPNG routes - - vtysh -c "show ipv6 route ripng" - - - - Show IPv6 static routes - - vtysh -c "show ipv6 route static" - - - - Show IPv6 routes summary - - vtysh -c "show ipv6 route summary" - - - - Show IPv6 routes in policy tables - - vtysh -c "show ipv6 route table all" - - - - Show IPv6 routes in specific policy table - - protocols static table - - - vtysh -c "show ipv6 route table $5" - - - - Show IPv6 routes in VRFs - - vtysh -c "show ipv6 route vrf all" - + #include + #include + #include + #include + #include + #include + #include + #include - Show IPv6 routes in specific VRF + Show IPv6 routes in VRF + all vrf name - vtysh -c "show ipv6 route vrf $5" + ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ + + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + -- cgit v1.2.3