diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-01-10 10:25:41 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-01-10 11:00:39 +0100 |
commit | 1e3de0926517fe7b7b1bd14aa1bd9d74fc021505 (patch) | |
tree | 10ca4dc647f5853ab9e887e8e6ab88b680877426 /op-mode-definitions | |
parent | e982b78f24d1dca3d2bc92a39b8e9fcf35b39a37 (diff) | |
download | vyos-1x-1e3de0926517fe7b7b1bd14aa1bd9d74fc021505.tar.gz vyos-1x-1e3de0926517fe7b7b1bd14aa1bd9d74fc021505.zip |
op-mode: T3178: migrate most of the OSPFv3 parts to re-includable snippets
This eases CLI maintenance and also migration from legacy code.
Diffstat (limited to 'op-mode-definitions')
8 files changed, 123 insertions, 468 deletions
diff --git a/op-mode-definitions/include/ospfv3-adv-router-id-node-tag.xml.i b/op-mode-definitions/include/ospfv3-adv-router-id-node-tag.xml.i new file mode 100644 index 000000000..b6a64c52a --- /dev/null +++ b/op-mode-definitions/include/ospfv3-adv-router-id-node-tag.xml.i @@ -0,0 +1,16 @@ +<!-- included start from ospfv3-adv-router-id-node-tag.xml.i --> +<node name="node.tag"> + <properties> + <help>Search by Advertising Router ID</help> + <completionHelp> + <list><x.x.x.x></list> + </completionHelp> + </properties> + <command>vtysh -c "show ipv6 ospf6 database * $6 $7"</command> + <children> + #include <include/ospfv3-detail.xml.i> + #include <include/ospfv3-dump.xml.i> + #include <include/ospfv3-internal.xml.i> + </children> +</node> +<!-- included end --> diff --git a/op-mode-definitions/include/ospfv3-adv-router.xml.i b/op-mode-definitions/include/ospfv3-adv-router.xml.i new file mode 100644 index 000000000..6330c0a72 --- /dev/null +++ b/op-mode-definitions/include/ospfv3-adv-router.xml.i @@ -0,0 +1,13 @@ +<!-- included start from ospfv3-adv-router.xml.i --> +<tagNode name="adv-router"> + <properties> + <help>Search by Advertising Router ID</help> + <completionHelp> + <list><x.x.x.x></list> + </completionHelp> + </properties> + <children> + #include <include/ospfv3-linkstate-id.xml.i> + </children> +</tagNode> +<!-- included end --> diff --git a/op-mode-definitions/include/ospfv3-detail.xml.i b/op-mode-definitions/include/ospfv3-detail.xml.i new file mode 100644 index 000000000..76096fbc8 --- /dev/null +++ b/op-mode-definitions/include/ospfv3-detail.xml.i @@ -0,0 +1,9 @@ +<!-- included start from ospfv3-detail.xml.i --> +<node name="detail"> + <properties> + <help>Show detailed information</help> + </properties> + <!-- FRR uses ospf6 where we use ospfv3, thus alter the command --> + <command>vtysh -c "show ipv6 ospf6 ${@:4}"</command> +</node> +<!-- included end --> diff --git a/op-mode-definitions/include/ospfv3-dump.xml.i b/op-mode-definitions/include/ospfv3-dump.xml.i new file mode 100644 index 000000000..4271aec53 --- /dev/null +++ b/op-mode-definitions/include/ospfv3-dump.xml.i @@ -0,0 +1,9 @@ +<!-- included start from ospfv3-dump.xml.i --> +<node name="dump"> + <properties> + <help>Show dump of LSAs</help> + </properties> + <!-- FRR uses ospf6 where we use ospfv3, thus alter the command --> + <command>vtysh -c "show ipv6 ospf6 ${@:4}"</command> +</node> +<!-- included end --> diff --git a/op-mode-definitions/include/ospfv3-internal.xml.i b/op-mode-definitions/include/ospfv3-internal.xml.i new file mode 100644 index 000000000..8b45e86c1 --- /dev/null +++ b/op-mode-definitions/include/ospfv3-internal.xml.i @@ -0,0 +1,9 @@ +<!-- included start from ospfv3-internal.xml.i --> +<node name="internal"> + <properties> + <help>Show internal LSA information</help> + </properties> + <!-- FRR uses ospf6 where we use ospfv3, thus alter the command --> + <command>vtysh -c "show ipv6 ospf6 ${@:4}"</command> +</node> +<!-- included end --> diff --git a/op-mode-definitions/include/ospfv3-linkstate-id.xml.i b/op-mode-definitions/include/ospfv3-linkstate-id.xml.i new file mode 100644 index 000000000..eab5916f1 --- /dev/null +++ b/op-mode-definitions/include/ospfv3-linkstate-id.xml.i @@ -0,0 +1,15 @@ +<!-- included start from ospfv3-linkstate-id.xml.i --> +<tagNode name="linkstate-id"> + <properties> + <help>Search by Link state ID</help> + <completionHelp> + <list><x.x.x.x></list> + </completionHelp> + </properties> + <children> + #include <include/ospfv3-detail.xml.i> + #include <include/ospfv3-dump.xml.i> + #include <include/ospfv3-internal.xml.i> + </children> +</tagNode> +<!-- included end --> diff --git a/op-mode-definitions/include/ospfv3-self-originated.xml.i b/op-mode-definitions/include/ospfv3-self-originated.xml.i new file mode 100644 index 000000000..76054757b --- /dev/null +++ b/op-mode-definitions/include/ospfv3-self-originated.xml.i @@ -0,0 +1,13 @@ +<!-- included start from ospfv3-self-originated.xml.i --> +<node name="self-originated"> + <properties> + <help>Show Self-originated LSAs</help> + </properties> + <command>vtysh -c "show ipv6 ospf6 database as-external $6 self-originated"</command> + <children> + #include <include/ospfv3-detail.xml.i> + #include <include/ospfv3-dump.xml.i> + #include <include/ospfv3-internal.xml.i> + </children> +</node> +<!-- included end --> diff --git a/op-mode-definitions/show-ipv6-ospfv3.xml.in b/op-mode-definitions/show-ipv6-ospfv3.xml.in index 36bb5b40e..bbae74c75 100644 --- a/op-mode-definitions/show-ipv6-ospfv3.xml.in +++ b/op-mode-definitions/show-ipv6-ospfv3.xml.in @@ -45,12 +45,7 @@ </properties> <command>vtysh -c "show ipv6 ospf6 border-routers"</command> <children> - <node name="detail"> - <properties> - <help>Show OSPFv3 detailed border-router information</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 border-routers detail"</command> - </node> + #include <include/ospfv3-detail.xml.i> </children> </node> <tagNode name="border-routers"> @@ -68,44 +63,7 @@ </properties> <command>vtysh -c "show ipv6 ospf6 database"</command> <children> - <tagNode name="adv-router"> - <properties> - <help>Search by Advertising Router ID</help> - <completionHelp> - <list><x.x.x.x></list> - </completionHelp> - </properties> - <children> - <tagNode name="linkstate-id"> - <properties> - <help>Search by Link state ID</help> - <completionHelp> - <list><x.x.x.x></list> - </completionHelp> - </properties> - <children> - <node name="detail"> - <properties> - <help>Show details of LSAs</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database adv-router $6 linkstate-id $8 detail"</command> - </node> - <node name="dump"> - <properties> - <help>Show dump of LSAs</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database adv-router $6 linkstate-id $8 dump"</command> - </node> - <node name="internal"> - <properties> - <help>Show LSAs internal information</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database adv-router $6 linkstate-id $8 internal"</command> - </node> - </children> - </tagNode> - </children> - </tagNode> + #include <include/ospfv3-adv-router.xml.i> <node name="any"> <properties> <help>Search by Any Link state Type</help> @@ -119,24 +77,9 @@ </completionHelp> </properties> <children> - <node name="detail"> - <properties> - <help>Show details of LSAs</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database * * $7 detail"</command> - </node> - <node name="dump"> - <properties> - <help>Show dump of LSAs</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database * * $7 dump"</command> - </node> - <node name="internal"> - <properties> - <help>Show LSAs internal information</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database * * $7 internal"</command> - </node> + #include <include/ospfv3-detail.xml.i> + #include <include/ospfv3-dump.xml.i> + #include <include/ospfv3-internal.xml.i> </children> </tagNode> </children> @@ -150,98 +93,19 @@ </properties> <command>vtysh -c "show ipv6 ospf6 database * $6"</command> <children> - <node name="detail"> - <properties> - <help>Show details of LSAs</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database * $6 detail"</command> - </node> - <node name="dump"> - <properties> - <help>Show dump of LSAs</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database * $6 dump"</command> - </node> - <node name="internal"> - <properties> - <help>Show LSAs internal information</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database * $6 internal"</command> - </node> - <node name="node.tag"> - <properties> - <help>Search by Advertising Router ID</help> - <completionHelp> - <list><x.x.x.x></list> - </completionHelp> - </properties> - <command>vtysh -c "show ipv6 ospf6 database * $6 $7"</command> - <children> - <node name="detail"> - <properties> - <help>Show details of LSAs</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database * $6 $7 detail"</command> - </node> - <node name="dump"> - <properties> - <help>Show dump of LSAs</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database * $6 $7 dump"</command> - </node> - <node name="internal"> - <properties> - <help>Show LSAs internal information</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database * $6 $7 internal"</command> - </node> - </children> - </node> + #include <include/ospfv3-detail.xml.i> + #include <include/ospfv3-dump.xml.i> + #include <include/ospfv3-internal.xml.i> + #include <include/ospfv3-adv-router-id-node-tag.xml.i> </children> </tagNode> - - - - - <node name="as-external"> <properties> <help>Show AS-External LSAs</help> </properties> <command>vtysh -c "show ipv6 ospf6 database as-external"</command> <children> - <tagNode name="adv-router"> - <properties> - <help>Search by Advertising Router ID</help> - <completionHelp> - <list><x.x.x.x></list> - </completionHelp> - </properties> - <children> - <tagNode name="linkstate-id"> - <properties> - <help>Search by Link state ID</help> - <completionHelp> - <list><x.x.x.x></list> - </completionHelp> - </properties> - <children> - <node name="dump"> - <properties> - <help>Show dump of LSAs</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database as-external adv-router $7 linkstate-id $9 dump"</command> - </node> - <node name="internal"> - <properties> - <help>Show LSAs internal information</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database as-external adv-router $7 linkstate-id $9 internal"</command> - </node> - </children> - </tagNode> - </children> - </tagNode> + #include <include/ospfv3-adv-router.xml.i> <tagNode name="any"> <properties> <help>Search by Advertising Router ID</help> @@ -251,126 +115,16 @@ </properties> <command>vtysh -c "show ipv6 ospf6 database as-external * $7"</command> <children> - <node name="detail"> - <properties> - <help>Show details of LSAs</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database as-external * $7 detail"</command> - </node> - <node name="dump"> - <properties> - <help>Show dump of LSAs</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database as-external * $7 dump"</command> - </node> - <node name="internal"> - <properties> - <help>Show LSAs internal information</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database as-external * $7 internal"</command> - </node> - </children> - </tagNode> - <node name="detail"> - <properties> - <help>Show details of LSAs</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database as-external detail"</command> - </node> - <node name="dump"> - <properties> - <help>Show dump of LSAs</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database as-external dump"</command> - </node> - <node name="internal"> - <properties> - <help>Show LSAs internal information</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database as-external internal"</command> - </node> - <tagNode name="linkstate-id"> - <properties> - <help>Search by Link state ID</help> - <completionHelp> - <list><x.x.x.x></list> - </completionHelp> - </properties> - <children> - <node name="detail"> - <properties> - <help>Show details of LSAs</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database as-external linkstate-id $7 detail"</command> - </node> - <node name="dump"> - <properties> - <help>Show dump of LSAs</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database as-external linkstate-id $7 dump"</command> - </node> - <node name="internal"> - <properties> - <help>Show LSAs internal information</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database as-external linkstate-id $7 internal"</command> - </node> + #include <include/ospfv3-detail.xml.i> + #include <include/ospfv3-dump.xml.i> + #include <include/ospfv3-internal.xml.i> </children> </tagNode> - <node name="self-originated"> - <properties> - <help>Show Self-originated LSAs</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database as-external self-originated"</command> - <children> - <node name="detail"> - <properties> - <help>Show details of LSAs</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database as-external self-originated detail"</command> - </node> - <node name="dump"> - <properties> - <help>Show dump of LSAs</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database as-external self-originated dump"</command> - </node> - <node name="internal"> - <properties> - <help>Show LSAs internal information</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database as-external self-originated internal"</command> - </node> - <tagNode name="linkstate-id"> - <properties> - <help>Search by Link state ID</help> - <completionHelp> - <list><x.x.x.x></list> - </completionHelp> - </properties> - <children> - <node name="detail"> - <properties> - <help>Show details of LSAs</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database as-external self-originated linkstate-id $8 detail"</command> - </node> - <node name="dump"> - <properties> - <help>Show dump of LSAs</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database as-external self-originated linkstate-id $8 dump"</command> - </node> - <node name="internal"> - <properties> - <help>Show LSAs internal information</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database as-external self-originated linkstate-id $8 internal"</command> - </node> - </children> - </tagNode> - </children> - </node> + #include <include/ospfv3-detail.xml.i> + #include <include/ospfv3-dump.xml.i> + #include <include/ospfv3-internal.xml.i> + #include <include/ospfv3-linkstate-id.xml.i> + #include <include/ospfv3-self-originated.xml.i> </children> </node> <tagNode name="as-external"> @@ -381,140 +135,17 @@ </completionHelp> </properties> <children> - <node name="detail"> - <properties> - <help>Show details of LSAs</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database as-external $6 detail"</command> - </node> - <node name="dump"> - <properties> - <help>Show dump of LSAs</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database as-external $6 dump"</command> - </node> - <node name="internal"> - <properties> - <help>Show LSAs internal information</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database as-external $6 internal"</command> - </node> - <node name="self-originated"> - <properties> - <help>Show Self-originated LSAs</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database as-external $6 self-originated"</command> - <children> - <node name="detail"> - <properties> - <help>Show details of LSAs</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database as-external $6 self-originated detail"</command> - </node> - <node name="dump"> - <properties> - <help>Show dump of LSAs</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database as-external $6 self-originated dump"</command> - </node> - <node name="internal"> - <properties> - <help>Show LSAs internal information</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database as-external $6 self-originated internal"</command> - </node> - </children> - </node> - <node name="node.tag"> - <properties> - <help>Search by Advertising Router ID</help> - <completionHelp> - <list><x.x.x.x></list> - </completionHelp> - </properties> - <children> - <node name="dump"> - <properties> - <help>Show dump of LSAs</help> - </properties> - <command>echo vtysh -c "show ipv6 ospf6 database as-external $6 $7 dump"</command> - </node> - <node name="internal"> - <properties> - <help>Show LSAs internal information</help> - </properties> - <command>echo vtysh -c "show ipv6 ospf6 database as-external $6 $7 internal"</command> - </node> - </children> - </node> - </children> - </tagNode> - <node name="detail"> - <properties> - <help>Show details of LSAs</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database detail"</command> - </node> - <node name="dump"> - <properties> - <help>Show dump of LSAs</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database dump"</command> - </node> - <tagNode name="linkstate-id"> - <properties> - <help>Search by Link state ID</help> - <completionHelp> - <list><x.x.x.x></list> - </completionHelp> - </properties> - <children> - <node name="detail"> - <properties> - <help>Show details of LSAs</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database linkstate-id $6 detail"</command> - </node> - <node name="dump"> - <properties> - <help>Show dump of LSAs</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database linkstate-id $6 dump"</command> - </node> - <node name="internal"> - <properties> - <help>Show LSAs internal information</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database linkstate-id $6 internal"</command> - </node> + #include <include/ospfv3-detail.xml.i> + #include <include/ospfv3-dump.xml.i> + #include <include/ospfv3-internal.xml.i> + #include <include/ospfv3-self-originated.xml.i> + #include <include/ospfv3-adv-router-id-node-tag.xml.i> </children> </tagNode> - <node name="self-originated"> - <properties> - <help>Show Self-originated LSAs</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database self-originated"</command> - <children> - <node name="detail"> - <properties> - <help>Show details of LSAs</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database self-originated detail"</command> - </node> - <node name="dump"> - <properties> - <help>Show dump of LSAs</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database self-originated dump"</command> - </node> - <node name="internal"> - <properties> - <help>Show LSAs internal information</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 database self-originated internal"</command> - </node> - </children> - </node> + #include <include/ospfv3-detail.xml.i> + #include <include/ospfv3-internal.xml.i> + #include <include/ospfv3-linkstate-id.xml.i> + #include <include/ospfv3-self-originated.xml.i> </children> </node> <node name="interface"> @@ -529,12 +160,7 @@ </properties> <command>vtysh -c "show ipv6 ospf6 interface prefix"</command> <children> - <node name="detail"> - <properties> - <help>More detailed interface prefix information</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 interface prefix detail"</command> - </node> + #include <include/ospfv3-detail.xml.i> </children> </node> <tagNode name="prefix"> @@ -546,12 +172,7 @@ </properties> <command>vtysh -c "show ipv6 ospf6 interface prefix $6"</command> <children> - <node name="detail"> - <properties> - <help>More detailed information</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 interface prefix $6 detail"</command> - </node> + #include <include/ospfv3-detail.xml.i> <node name="match"> <properties> <help>Matched interface prefix information</help> @@ -577,12 +198,7 @@ </properties> <command>vtysh -c "show ipv6 ospf6 interface $5 prefix"</command> <children> - <node name="detail"> - <properties> - <help>More detailed interface prefix information</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 interface $5 prefix detail"</command> - </node> + #include <include/ospfv3-detail.xml.i> </children> </node> <tagNode name="prefix"> @@ -594,12 +210,7 @@ </properties> <command>vtysh -c "show ipv6 ospf6 interface $5 prefix $7"</command> <children> - <node name="detail"> - <properties> - <help>More detailed information</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 interface $5 prefix $7 detail"</command> - </node> + #include <include/ospfv3-detail.xml.i> <node name="match"> <properties> <help>Matched interface prefix information</help> @@ -615,12 +226,7 @@ <help>Show OSPFv3 linkstate routing information</help> </properties> <children> - <node name="detail"> - <properties> - <help>Show detailed linkstate information</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 linkstate detail"</command> - </node> + #include <include/ospfv3-detail.xml.i> <node name="network"> <properties> <help>Show linkstate Network information</help> @@ -641,12 +247,7 @@ </properties> <command>vtysh -c "show ipv6 ospf6 neighbor"</command> <children> - <node name="detail"> - <properties> - <help>Show detailed neighbor information</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 neighbor detail"</command> - </node> + #include <include/ospfv3-detail.xml.i> <node name="drchoice"> <properties> <help>Show neighbor DR choice information</help> @@ -673,12 +274,7 @@ </properties> <command>vtysh -c "show ipv6 ospf6 route external-1"</command> <children> - <node name="detail"> - <properties> - <help>Show detailed Type-1 External route information</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 route external-1 detail"</command> - </node> + #include <include/ospfv3-detail.xml.i> </children> </node> <node name="external-2"> @@ -687,12 +283,7 @@ </properties> <command>vtysh -c "show ipv6 ospf6 route external-2"</command> <children> - <node name="detail"> - <properties> - <help>Show detailed Type-2 External route information</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 route external-2 detail"</command> - </node> + #include <include/ospfv3-detail.xml.i> </children> </node> <node name="inter-area"> @@ -701,12 +292,7 @@ </properties> <command>vtysh -c "show ipv6 ospf6 route inter-area"</command> <children> - <node name="detail"> - <properties> - <help>Show detailed Inter-Area route information</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 route inter-area detail"</command> - </node> + #include <include/ospfv3-detail.xml.i> </children> </node> <node name="intra-area"> @@ -715,20 +301,10 @@ </properties> <command>vtysh -c "show ipv6 ospf6 route intra-area"</command> <children> - <node name="detail"> - <properties> - <help>Show detailed Intra-Area route information</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 route intra-area detail"</command> - </node> + #include <include/ospfv3-detail.xml.i> </children> </node> - <node name="detail"> - <properties> - <help>Show detailed route information</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 route detail"</command> - </node> + #include <include/ospfv3-detail.xml.i> <node name="summary"> <properties> <help>Show route table summary</help> @@ -758,12 +334,7 @@ </properties> <command>vtysh -c "show ipv6 ospf6 route $5 match"</command> <children> - <node name="detail"> - <properties> - <help>Detailed information</help> - </properties> - <command>vtysh -c "show ipv6 ospf6 route $5 match detail"</command> - </node> + #include <include/ospfv3-detail.xml.i> </children> </node> </children> |