From 035a3f1b053136e553f9f03f536d0a3d6daabb72 Mon Sep 17 00:00:00 2001 From: Viacheslav Date: Tue, 23 Nov 2021 17:57:48 +0000 Subject: netns: T3829: Add op-mode for show netns --- op-mode-definitions/show-netns.xml.in | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 op-mode-definitions/show-netns.xml.in (limited to 'op-mode-definitions') diff --git a/op-mode-definitions/show-netns.xml.in b/op-mode-definitions/show-netns.xml.in new file mode 100644 index 000000000..8d5072d4e --- /dev/null +++ b/op-mode-definitions/show-netns.xml.in @@ -0,0 +1,13 @@ + + + + + + + Show network namespace information + + ip netns ls + + + + -- cgit v1.2.3 From d0c62f2e3f8d7a89b3502a400a88933b2d0b4501 Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Sat, 4 Dec 2021 00:19:00 -0500 Subject: T4035: add op mode "show interfaces geneve" commands --- op-mode-definitions/show-interfaces-geneve.xml.in | 42 +++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 op-mode-definitions/show-interfaces-geneve.xml.in (limited to 'op-mode-definitions') diff --git a/op-mode-definitions/show-interfaces-geneve.xml.in b/op-mode-definitions/show-interfaces-geneve.xml.in new file mode 100644 index 000000000..a47933315 --- /dev/null +++ b/op-mode-definitions/show-interfaces-geneve.xml.in @@ -0,0 +1,42 @@ + + + + + + + + + Show specified GENEVE interface information + + interfaces geneve + + + ${vyos_op_scripts_dir}/show_interfaces.py --intf="$4" + + + + Show summary of the specified GENEVE interface information + + ${vyos_op_scripts_dir}/show_interfaces.py --intf="$4" --action=show-brief + + + + + + Show GENEVE interface information + + ${vyos_op_scripts_dir}/show_interfaces.py --intf-type=geneve --action=show-brief + + + + Show detailed GENEVE interface information + + ${vyos_op_scripts_dir}/show_interfaces.py --intf-type=geneve --action=show + + + + + + + + -- cgit v1.2.3 From 467eb1f18ec971d6d3913d9ecc58b241db104f0d Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sat, 4 Dec 2021 07:33:53 +0100 Subject: op-mode: disk: T4045: cleanup code to use python f'ormat strings --- op-mode-definitions/disks.xml.in | 2 +- src/op_mode/format_disk.py | 67 +++++++++++++++++----------------------- 2 files changed, 29 insertions(+), 40 deletions(-) (limited to 'op-mode-definitions') diff --git a/op-mode-definitions/disks.xml.in b/op-mode-definitions/disks.xml.in index 2102a2e8e..117ac5065 100644 --- a/op-mode-definitions/disks.xml.in +++ b/op-mode-definitions/disks.xml.in @@ -20,7 +20,7 @@ - ${vyos_op_scripts_dir}/format_disk.py --target $3 --proto $5 + sudo ${vyos_op_scripts_dir}/format_disk.py --target $3 --proto $5 diff --git a/src/op_mode/format_disk.py b/src/op_mode/format_disk.py index df4486bce..b68948e40 100755 --- a/src/op_mode/format_disk.py +++ b/src/op_mode/format_disk.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (C) 2019 VyOS maintainers and contributors +# Copyright (C) 2019-2021 VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as @@ -17,11 +17,10 @@ import argparse import os import re -import sys + from datetime import datetime -from time import sleep -from vyos.util import is_admin, ask_yes_no +from vyos.util import ask_yes_no from vyos.util import call from vyos.util import cmd from vyos.util import DEVNULL @@ -38,7 +37,7 @@ def list_disks(): def is_busy(disk: str): """Check if given disk device is busy by re-reading it's partition table""" - return call(f'sudo blockdev --rereadpt /dev/{disk}', stderr=DEVNULL) != 0 + return call(f'blockdev --rereadpt /dev/{disk}', stderr=DEVNULL) != 0 def backup_partitions(disk: str): @@ -65,11 +64,11 @@ def list_partitions(disk: str): def delete_partition(disk: str, partition_idx: int): - cmd(f'sudo /sbin/parted /dev/{disk} rm {partition_idx}') + cmd(f'parted /dev/{disk} rm {partition_idx}') def format_disk_like(target: str, proto: str): - cmd(f'sudo /sbin/sfdisk -d /dev/{proto} | sudo /sbin/sfdisk --force /dev/{target}') + cmd(f'sfdisk -d /dev/{proto} | sfdisk --force /dev/{target}') if __name__ == '__main__': @@ -79,10 +78,6 @@ if __name__ == '__main__': group.add_argument('-p', '--proto', type=str, required=True, help='Prototype device to use as reference') args = parser.parse_args() - if not is_admin(): - print('Must be admin or root to format disk') - sys.exit(1) - target_disk = args.target eligible_target_disks = list_disks() @@ -90,54 +85,48 @@ if __name__ == '__main__': eligible_proto_disks = eligible_target_disks.copy() eligible_proto_disks.remove(target_disk) - fmt = { - 'target_disk': target_disk, - 'proto_disk': proto_disk, - } - if proto_disk == target_disk: print('The two disk drives must be different.') - sys.exit(1) + exit(1) - if not os.path.exists('/dev/' + proto_disk): - print('Device /dev/{proto_disk} does not exist'.format_map(fmt)) - sys.exit(1) + if not os.path.exists(f'/dev/{proto_disk}'): + print(f'Device /dev/{proto_disk} does not exist') + exit(1) if not os.path.exists('/dev/' + target_disk): - print('Device /dev/{target_disk} does not exist'.format_map(fmt)) - sys.exit(1) + print(f'Device /dev/{target_disk} does not exist') + exit(1) if target_disk not in eligible_target_disks: - print('Device {target_disk} can not be formatted'.format_map(fmt)) - sys.exit(1) + print(f'Device {target_disk} can not be formatted') + exit(1) if proto_disk not in eligible_proto_disks: - print('Device {proto_disk} can not be used as a prototype for {target_disk}'.format_map(fmt)) - sys.exit(1) + print(f'Device {proto_disk} can not be used as a prototype for {target_disk}') + exit(1) if is_busy(target_disk): - print("Disk device {target_disk} is busy. Can't format it now".format_map(fmt)) - sys.exit(1) + print(f'Disk device {target_disk} is busy, unable to format') + exit(1) - print('This will re-format disk {target_disk} so that it has the same disk\n' - 'partion sizes and offsets as {proto_disk}. This will not copy\n' - 'data from {proto_disk} to {target_disk}. But this will erase all\n' - 'data on {target_disk}.\n'.format_map(fmt)) + print(f'\nThis will re-format disk {target_disk} so that it has the same disk' + f'\npartion sizes and offsets as {proto_disk}. This will not copy' + f'\ndata from {proto_disk} to {target_disk}. But this will erase all' + f'\ndata on {target_disk}.\n') - if not ask_yes_no("Do you wish to proceed?"): - print('OK. Disk drive {target_disk} will not be re-formated'.format_map(fmt)) - sys.exit(0) + if not ask_yes_no('Do you wish to proceed?'): + print(f'Disk drive {target_disk} will not be re-formated') + exit(0) - print('OK. Re-formating disk drive {target_disk}...'.format_map(fmt)) + print(f'Re-formating disk drive {target_disk}...') print('Making backup copy of partitions...') backup_partitions(target_disk) - sleep(1) print('Deleting old partitions...') for p in list_partitions(target_disk): delete_partition(disk=target_disk, partition_idx=p) - print('Creating new partitions on {target_disk} based on {proto_disk}...'.format_map(fmt)) + print(f'Creating new partitions on {target_disk} based on {proto_disk}...') format_disk_like(target=target_disk, proto=proto_disk) - print('Done.') + print('Done!') -- cgit v1.2.3 From 1edacb9c1788db06de570d25e274a7a7df8e81e8 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sat, 4 Dec 2021 07:35:53 +0100 Subject: xml: op-mode: add "show bfd" alias node to "show protocols bfd" --- op-mode-definitions/include/bfd-common.xml.i | 54 ++++++++++++++++++++++++++++ op-mode-definitions/show-bfd.xml.in | 8 +++++ op-mode-definitions/show-protocols.xml.in | 45 +---------------------- 3 files changed, 63 insertions(+), 44 deletions(-) create mode 100644 op-mode-definitions/include/bfd-common.xml.i create mode 100644 op-mode-definitions/show-bfd.xml.in (limited to 'op-mode-definitions') diff --git a/op-mode-definitions/include/bfd-common.xml.i b/op-mode-definitions/include/bfd-common.xml.i new file mode 100644 index 000000000..eebfbdad4 --- /dev/null +++ b/op-mode-definitions/include/bfd-common.xml.i @@ -0,0 +1,54 @@ + + + + Show Bidirectional Forwarding Detection (BFD) + + + + + Show all Bidirectional Forwarding Detection (BFD) peer status + + vtysh -c "show bfd peers" + + + + Show Bidirectional Forwarding Detection (BFD) peer counters + + vtysh -c "show bfd peers counters" + + + + + + Show Bidirectional Forwarding Detection (BFD) peer status + + + + + vtysh -c "show bfd peers" | awk -v BFD_PEER=$5 'BEGIN { regex = sprintf("(peer %s.*)vrf", BFD_PEER) } { if (match($0, regex, bfd_peer_value)) peer=bfd_peer_value[1] } END { if (peer) system("vtysh -c \"show bfd " peer "\"") }' + + + + Show Bidirectional Forwarding Detection (BFD) peer counters + + vtysh -c "show bfd peers" | awk -v BFD_PEER=$5 'BEGIN { regex = sprintf("(peer %s.*)vrf", BFD_PEER) } { if (match($0, regex, bfd_peer_value)) peer=bfd_peer_value[1] } END { if (peer) system("vtysh -c \"show bfd " peer " counters\"") }' + + + + + + Show Bidirectional Forwarding Detection peers + + vtysh -c "show bfd peers" + + + + Show Bidirectional Forwarding Detection (BFD) peers brief + + vtysh -c "show bfd peers brief" + + + + + + diff --git a/op-mode-definitions/show-bfd.xml.in b/op-mode-definitions/show-bfd.xml.in new file mode 100644 index 000000000..7339c92a2 --- /dev/null +++ b/op-mode-definitions/show-bfd.xml.in @@ -0,0 +1,8 @@ + + + + + #include + + + diff --git a/op-mode-definitions/show-protocols.xml.in b/op-mode-definitions/show-protocols.xml.in index d595e2c3c..48bfa10dc 100644 --- a/op-mode-definitions/show-protocols.xml.in +++ b/op-mode-definitions/show-protocols.xml.in @@ -7,50 +7,7 @@ Show protocol specific information - - - Show Bidirectional Forwarding Detection (BFD) - - - - - Show all Bidirectional Forwarding Detection (BFD) peer status - - vtysh -c "show bfd peers" - - - - Show Bidirectional Forwarding Detection (BFD) peer counters - - vtysh -c "show bfd peers counters" - - - - - - Show Bidirectional Forwarding Detection (BFD) peer status - - - - - vtysh -c "show bfd peers" | awk -v BFD_PEER=$5 'BEGIN { regex = sprintf("(peer %s.*)vrf", BFD_PEER) } { if (match($0, regex, bfd_peer_value)) peer=bfd_peer_value[1] } END { if (peer) system("vtysh -c \"show bfd " peer "\"") }' - - - - Show Bidirectional Forwarding Detection (BFD) peer counters - - vtysh -c "show bfd peers" | awk -v BFD_PEER=$5 'BEGIN { regex = sprintf("(peer %s.*)vrf", BFD_PEER) } { if (match($0, regex, bfd_peer_value)) peer=bfd_peer_value[1] } END { if (peer) system("vtysh -c \"show bfd " peer " counters\"") }' - - - - - - Show Bidirectional Forwarding Detection (BFD) peers brief - - vtysh -c "show bfd peers brief" - - - + #include Show static protocol parameters -- cgit v1.2.3 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 From a6f951ed7f4669b7601f5f7e6c37451ed855d40b Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Mon, 13 Dec 2021 21:40:19 +0100 Subject: op-mode: BGP wide option is not availbale for L2VPN/EVPN AFI --- op-mode-definitions/include/bgp/afi-common.xml.i | 1 - op-mode-definitions/include/bgp/afi-ipv4-ipv6-common.xml.i | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) (limited to 'op-mode-definitions') diff --git a/op-mode-definitions/include/bgp/afi-common.xml.i b/op-mode-definitions/include/bgp/afi-common.xml.i index 4d5f56656..acf20d950 100644 --- a/op-mode-definitions/include/bgp/afi-common.xml.i +++ b/op-mode-definitions/include/bgp/afi-common.xml.i @@ -61,5 +61,4 @@ -#include 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 a51595b7f..084f5da83 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 @@ -230,4 +230,5 @@ ${vyos_op_scripts_dir}/vtysh_wrapper.sh $@ +#include -- cgit v1.2.3 From 6f9ba4e577a6470372a478310ea0c49a6400b8e6 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Wed, 15 Dec 2021 22:15:58 +0100 Subject: op-mode: bfd: T4073: "show protocols bfd peer " returned invalid session data Due to the AWK regex pattern data from a different peer was returned as the first match was shown. --- op-mode-definitions/show-bfd.xml.in | 50 ++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) (limited to 'op-mode-definitions') diff --git a/op-mode-definitions/show-bfd.xml.in b/op-mode-definitions/show-bfd.xml.in index 7339c92a2..39e42e6ec 100644 --- a/op-mode-definitions/show-bfd.xml.in +++ b/op-mode-definitions/show-bfd.xml.in @@ -2,7 +2,55 @@ - #include + + + Show Bidirectional Forwarding Detection (BFD) + + + + + Show all Bidirectional Forwarding Detection (BFD) peer status + + + + + Show Bidirectional Forwarding Detection (BFD) peer status + + + + + vtysh -c "show bfd peers" | sed -n "/peer $4 /,/^$/p" + + + + Show Bidirectional Forwarding Detection (BFD) peer counters + + vtysh -c "show bfd peers counters" | sed -n "/peer $4 /,/^$/p" + + + + + + Show Bidirectional Forwarding Detection peers + + vtysh -c "show bfd peers" + + + + Show Bidirectional Forwarding Detection (BFD) peer counters + + vtysh -c "show bfd peers counters" + + + + Show Bidirectional Forwarding Detection (BFD) peers brief + + vtysh -c "show bfd peers brief" + + + + + -- cgit v1.2.3 From 25d95b1f73f3e5e0fd2dfc9199f46d808c68af43 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Wed, 15 Dec 2021 22:18:34 +0100 Subject: op-mode: T4073: drop "show protocols bfd" in favour of "show bfd" --- op-mode-definitions/include/bfd-common.xml.i | 54 ---------------------------- op-mode-definitions/show-protocols.xml.in | 1 - 2 files changed, 55 deletions(-) delete mode 100644 op-mode-definitions/include/bfd-common.xml.i (limited to 'op-mode-definitions') diff --git a/op-mode-definitions/include/bfd-common.xml.i b/op-mode-definitions/include/bfd-common.xml.i deleted file mode 100644 index eebfbdad4..000000000 --- a/op-mode-definitions/include/bfd-common.xml.i +++ /dev/null @@ -1,54 +0,0 @@ - - - - Show Bidirectional Forwarding Detection (BFD) - - - - - Show all Bidirectional Forwarding Detection (BFD) peer status - - vtysh -c "show bfd peers" - - - - Show Bidirectional Forwarding Detection (BFD) peer counters - - vtysh -c "show bfd peers counters" - - - - - - Show Bidirectional Forwarding Detection (BFD) peer status - - - - - vtysh -c "show bfd peers" | awk -v BFD_PEER=$5 'BEGIN { regex = sprintf("(peer %s.*)vrf", BFD_PEER) } { if (match($0, regex, bfd_peer_value)) peer=bfd_peer_value[1] } END { if (peer) system("vtysh -c \"show bfd " peer "\"") }' - - - - Show Bidirectional Forwarding Detection (BFD) peer counters - - vtysh -c "show bfd peers" | awk -v BFD_PEER=$5 'BEGIN { regex = sprintf("(peer %s.*)vrf", BFD_PEER) } { if (match($0, regex, bfd_peer_value)) peer=bfd_peer_value[1] } END { if (peer) system("vtysh -c \"show bfd " peer " counters\"") }' - - - - - - Show Bidirectional Forwarding Detection peers - - vtysh -c "show bfd peers" - - - - Show Bidirectional Forwarding Detection (BFD) peers brief - - vtysh -c "show bfd peers brief" - - - - - - diff --git a/op-mode-definitions/show-protocols.xml.in b/op-mode-definitions/show-protocols.xml.in index 48bfa10dc..698001b76 100644 --- a/op-mode-definitions/show-protocols.xml.in +++ b/op-mode-definitions/show-protocols.xml.in @@ -7,7 +7,6 @@ Show protocol specific information - #include Show static protocol parameters -- cgit v1.2.3