summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2025-06-02 15:38:23 +0200
committerChristian Breunig <christian@breunig.cc>2025-06-02 15:38:23 +0200
commit79b3f33d34edb418378eae01813e5263b268eaa1 (patch)
treec1a6f47f787adc60e42ef7753ac2de63442b2bbc
parente5183e60552773ba5b7dd4abc73b9d5967a08b18 (diff)
downloadvyos-1x-79b3f33d34edb418378eae01813e5263b268eaa1.tar.gz
vyos-1x-79b3f33d34edb418378eae01813e5263b268eaa1.zip
op-mode: T7509: refactor "show bgp" XML definitions to re-usable code blocks
-rw-r--r--op-mode-definitions/include/bgp/afi-ipv4-ipv6-common.xml.i49
-rw-r--r--op-mode-definitions/include/bgp/dampened-routes.xml.i8
-rw-r--r--op-mode-definitions/include/bgp/filtered-routes.xml.i8
-rw-r--r--op-mode-definitions/include/bgp/flap-statistics.xml.i8
-rw-r--r--op-mode-definitions/include/bgp/prefix-counts.xml.i8
-rw-r--r--op-mode-definitions/include/bgp/received.xml.i16
-rw-r--r--op-mode-definitions/include/bgp/routes.xml.i8
-rw-r--r--op-mode-definitions/include/bgp/show-bgp-common.xml.i7
-rw-r--r--op-mode-definitions/include/bgp/show-ip-bgp-common.xml.i24
9 files changed, 69 insertions, 67 deletions
diff --git a/op-mode-definitions/include/bgp/afi-ipv4-ipv6-common.xml.i b/op-mode-definitions/include/bgp/afi-ipv4-ipv6-common.xml.i
index 9a743f828..d5fb7f5ee 100644
--- a/op-mode-definitions/include/bgp/afi-ipv4-ipv6-common.xml.i
+++ b/op-mode-definitions/include/bgp/afi-ipv4-ipv6-common.xml.i
@@ -159,50 +159,13 @@
<command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
<children>
#include <include/bgp/advertised-routes.xml.i>
- <leafNode name="dampened-routes">
- <properties>
- <help>Show dampened routes received from BGP neighbor</help>
- </properties>
- <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
- </leafNode>
- <leafNode name="flap-statistics">
- <properties>
- <help>Show flap statistics of the routes learned from BGP neighbor</help>
- </properties>
- <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
- </leafNode>
- <leafNode name="prefix-counts">
- <properties>
- <help>Show detailed prefix count information for BGP neighbor</help>
- </properties>
- <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
- </leafNode>
- <node name="received">
- <properties>
- <help>Show information received from BGP neighbor</help>
- </properties>
- <children>
- <leafNode name="prefix-filter">
- <properties>
- <help>Show prefixlist filter</help>
- </properties>
- <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
- </leafNode>
- </children>
- </node>
- <leafNode name="filtered-routes">
- <properties>
- <help>Show filtered routes from BGP neighbor</help>
- </properties>
- <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
- </leafNode>
+ #include <include/bgp/dampened-routes.xml.i>
+ #include <include/bgp/filtered-routes.xml.i>
+ #include <include/bgp/flap-statistics.xml.i>
+ #include <include/bgp/prefix-counts.xml.i>
+ #include <include/bgp/received.xml.i>
#include <include/bgp/received-routes.xml.i>
- <leafNode name="routes">
- <properties>
- <help>Show routes learned from BGP neighbor</help>
- </properties>
- <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
- </leafNode>
+ #include <include/bgp/routes.xml.i>
</children>
</tagNode>
<tagNode name="prefix-list">
diff --git a/op-mode-definitions/include/bgp/dampened-routes.xml.i b/op-mode-definitions/include/bgp/dampened-routes.xml.i
new file mode 100644
index 000000000..073ca3325
--- /dev/null
+++ b/op-mode-definitions/include/bgp/dampened-routes.xml.i
@@ -0,0 +1,8 @@
+<!-- included start from bgp/dampened-routes.xml.i -->
+<leafNode name="dampened-routes">
+ <properties>
+ <help>Show dampened routes received from BGP neighbor</help>
+ </properties>
+ <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
+</leafNode>
+<!-- included end -->
diff --git a/op-mode-definitions/include/bgp/filtered-routes.xml.i b/op-mode-definitions/include/bgp/filtered-routes.xml.i
new file mode 100644
index 000000000..a33e8f28f
--- /dev/null
+++ b/op-mode-definitions/include/bgp/filtered-routes.xml.i
@@ -0,0 +1,8 @@
+<!-- included start from bgp/filtered-routes.xml.i -->
+<leafNode name="filtered-routes">
+ <properties>
+ <help>Show filtered routes from BGP neighbor</help>
+ </properties>
+ <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
+</leafNode>
+<!-- included end -->
diff --git a/op-mode-definitions/include/bgp/flap-statistics.xml.i b/op-mode-definitions/include/bgp/flap-statistics.xml.i
new file mode 100644
index 000000000..93ac110e0
--- /dev/null
+++ b/op-mode-definitions/include/bgp/flap-statistics.xml.i
@@ -0,0 +1,8 @@
+<!-- included start from bgp/flap-statistics.xml.i -->
+<leafNode name="flap-statistics">
+ <properties>
+ <help>Show flap statistics of the routes learned from BGP neighbor</help>
+ </properties>
+ <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
+</leafNode>
+<!-- included end -->
diff --git a/op-mode-definitions/include/bgp/prefix-counts.xml.i b/op-mode-definitions/include/bgp/prefix-counts.xml.i
new file mode 100644
index 000000000..a7131ebeb
--- /dev/null
+++ b/op-mode-definitions/include/bgp/prefix-counts.xml.i
@@ -0,0 +1,8 @@
+<!-- included start from bgp/prefix-counts.xml.i -->
+<leafNode name="prefix-counts">
+ <properties>
+ <help>Show detailed prefix count information</help>
+ </properties>
+ <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
+</leafNode>
+<!-- included end -->
diff --git a/op-mode-definitions/include/bgp/received.xml.i b/op-mode-definitions/include/bgp/received.xml.i
new file mode 100644
index 000000000..bb8dc6981
--- /dev/null
+++ b/op-mode-definitions/include/bgp/received.xml.i
@@ -0,0 +1,16 @@
+<!-- included start from bgp/received.xml.i -->
+<node name="received">
+ <properties>
+ <help>Show information received from BGP neighbor</help>
+ </properties>
+ <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
+ <children>
+ <leafNode name="prefix-filter">
+ <properties>
+ <help>Show prefixlist filter</help>
+ </properties>
+ <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
+ </leafNode>
+ </children>
+</node>
+<!-- included end -->
diff --git a/op-mode-definitions/include/bgp/routes.xml.i b/op-mode-definitions/include/bgp/routes.xml.i
new file mode 100644
index 000000000..248e8fc5c
--- /dev/null
+++ b/op-mode-definitions/include/bgp/routes.xml.i
@@ -0,0 +1,8 @@
+<!-- included start from bgp/routes.xml.i -->
+<leafNode name="routes">
+ <properties>
+ <help>Show routes learned from BGP neighbor</help>
+ </properties>
+ <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
+</leafNode>
+<!-- included end -->
diff --git a/op-mode-definitions/include/bgp/show-bgp-common.xml.i b/op-mode-definitions/include/bgp/show-bgp-common.xml.i
index 8d2c3d1b9..003451a33 100644
--- a/op-mode-definitions/include/bgp/show-bgp-common.xml.i
+++ b/op-mode-definitions/include/bgp/show-bgp-common.xml.i
@@ -129,12 +129,7 @@
<command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
<children>
#include <include/bgp/advertised-routes.xml.i>
- <leafNode name="routes">
- <properties>
- <help>Show routes learned from BGP neighbor</help>
- </properties>
- <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
- </leafNode>
+ #include <include/bgp/routes.xml.i>
</children>
</tagNode>
<leafNode name="next-hops">
diff --git a/op-mode-definitions/include/bgp/show-ip-bgp-common.xml.i b/op-mode-definitions/include/bgp/show-ip-bgp-common.xml.i
index 559b20755..48475e04e 100644
--- a/op-mode-definitions/include/bgp/show-ip-bgp-common.xml.i
+++ b/op-mode-definitions/include/bgp/show-ip-bgp-common.xml.i
@@ -82,25 +82,13 @@
<command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
<children>
#include <include/bgp/advertised-routes.xml.i>
- <leafNode name="prefix-counts">
- <properties>
- <help>Show detailed prefix count information</help>
- </properties>
- <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
- </leafNode>
- <leafNode name="filtered-routes">
- <properties>
- <help>Show the filtered routes from neighbor</help>
- </properties>
- <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
- </leafNode>
+ #include <include/bgp/dampened-routes.xml.i>
+ #include <include/bgp/filtered-routes.xml.i>
+ #include <include/bgp/flap-statistics.xml.i>
+ #include <include/bgp/prefix-counts.xml.i>
+ #include <include/bgp/received.xml.i>
#include <include/bgp/received-routes.xml.i>
- <leafNode name="routes">
- <properties>
- <help>Show routes learned from neighbor</help>
- </properties>
- <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command>
- </leafNode>
+ #include <include/bgp/routes.xml.i>
</children>
</tagNode>
<leafNode name="paths">