diff options
author | Daniil Baturin <daniil@vyos.io> | 2025-06-03 16:00:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-03 16:00:28 +0100 |
commit | a711ceb80158a1dcdeecd1570ca705684d636327 (patch) | |
tree | 91e2e43f3117d776fbc41f6da3cb57662e0a7e67 | |
parent | 1617e9fcb3423d3b520f3d6ae40c7870979a1ec4 (diff) | |
parent | 79b3f33d34edb418378eae01813e5263b268eaa1 (diff) | |
download | vyos-1x-a711ceb80158a1dcdeecd1570ca705684d636327.tar.gz vyos-1x-a711ceb80158a1dcdeecd1570ca705684d636327.zip |
Merge pull request #4538 from c-po/op-mode-bgp
op-mode: T7509: add "detail" and "wide" modifier for BGP advertised-routes|received-routes
12 files changed, 109 insertions, 97 deletions
diff --git a/op-mode-definitions/include/bgp/advertised-routes.xml.i b/op-mode-definitions/include/bgp/advertised-routes.xml.i new file mode 100644 index 000000000..cc3f1f9b5 --- /dev/null +++ b/op-mode-definitions/include/bgp/advertised-routes.xml.i @@ -0,0 +1,12 @@ +<!-- included start from bgp/advertised-routes.xml.i --> +<node name="advertised-routes"> + <properties> + <help>Show routes advertised to a BGP neighbor</help> + </properties> + <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command> + <children> + #include <include/vtysh-generic-detail-wide.xml.i> + #include <include/vtysh-generic-wide.xml.i> + </children> +</node> +<!-- included end --> 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 820d507fd..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 @@ -158,61 +158,14 @@ </properties> <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command> <children> - <leafNode name="advertised-routes"> - <properties> - <help>Show routes advertised to a BGP neighbor</help> - </properties> - <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command> - </leafNode> - <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> - <leafNode name="received-routes"> - <properties> - <help>Show received routes from BGP neighbor</help> - </properties> - <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command> - </leafNode> - <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/advertised-routes.xml.i> + #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> + #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-routes.xml.i b/op-mode-definitions/include/bgp/received-routes.xml.i new file mode 100644 index 000000000..55bed7c77 --- /dev/null +++ b/op-mode-definitions/include/bgp/received-routes.xml.i @@ -0,0 +1,12 @@ +<!-- included start from bgp/received-routes.xml.i --> +<node name="received-routes"> + <properties> + <help>Show received routes from a BGP neighbor</help> + </properties> + <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command> + <children> + #include <include/vtysh-generic-detail-wide.xml.i> + #include <include/vtysh-generic-wide.xml.i> + </children> +</node> +<!-- 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 d888bc3b0..003451a33 100644 --- a/op-mode-definitions/include/bgp/show-bgp-common.xml.i +++ b/op-mode-definitions/include/bgp/show-bgp-common.xml.i @@ -128,18 +128,8 @@ </properties> <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command> <children> - <leafNode name="advertised-routes"> - <properties> - <help>Show routes advertised to a BGP neighbor</help> - </properties> - <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command> - </leafNode> - <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/advertised-routes.xml.i> + #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 db9021f3e..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 @@ -81,36 +81,14 @@ </properties> <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command> <children> - <leafNode name="advertised-routes"> - <properties> - <help>Show routes advertised to a 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</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> - <leafNode name="received-routes"> - <properties> - <help>Show the received routes from neighbor</help> - </properties> - <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command> - </leafNode> - <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/advertised-routes.xml.i> + #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> + #include <include/bgp/routes.xml.i> </children> </tagNode> <leafNode name="paths"> diff --git a/op-mode-definitions/include/vtysh-generic-detail-wide.xml.i b/op-mode-definitions/include/vtysh-generic-detail-wide.xml.i new file mode 100644 index 000000000..98ce09948 --- /dev/null +++ b/op-mode-definitions/include/vtysh-generic-detail-wide.xml.i @@ -0,0 +1,11 @@ +<!-- included start from vtysh-generic-detail-wide.xml.i --> +<node name="detail"> + <properties> + <help>Detailed information</help> + </properties> + <command>${vyos_op_scripts_dir}/vtysh_wrapper.sh $@</command> + <children> + #include <include/vtysh-generic-wide.xml.i> + </children> +</node> +<!-- included end --> |