from genie import parsergen as pg marked_up_show_interface_xrvr_output = '''\ OS: iosxr CMD: show_interface_ SHOWCMD: show interface {ifname} PREFIX: show.intf ACTUAL: show interface MgmtEth0/0/CPU0/0 Fri Mar 6 12:03:11.409 EST XWXMgmtEth0/0/CPU0/0 is up, line protocol is up Interface state transitions: 1 Hardware is Management Ethernet, address is 5254.00d6.36c9 (bia 5254.00d6.36c9) Internet address is 10.30.108.132/23 MTU 1514 bytes, BW 0 Kbit reliability 255/255, txload Unknown, rxload Unknown Encapsulation ARPA, Duplex unknown, 0Kb/s, unknown, link type is autonegotiation output flow control is off, input flow control is off Carrier delay (up) is 10 msec loopback not set, ARP type ARPA, ARP timeout 04:00:00 Last input 00:00:00, output 00:00:48 Last clearing of "show interface" counters never 5 minute input rate 79000 bits/sec, 32 packets/sec 5 minute output rate 0 bits/sec, 0 packets/sec 2459211 packets input, 774707935 bytes, 0 total input drops 0 drops for unrecognized upper-level protocol Received 2216135 broadcast packets, 233738 multicast packets 0 runts, 0 giants, 0 throttles, 0 parity 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort 349 packets output, 58930 bytes, 0 total output drops Output 4 broadcast packets, 0 multicast packets 0 output errors, 0 underruns, 0 applique, 0 resets 0 output buffer failures, 0 output buffers swapped out 1 carrier transitions MARKUP: show interface MgmtEth0/0/CPU0/0 Fri Mar 6 12:03:11.409 EST XIXMgmtEth0/0/CPU0/0 is XCXup, line protocol is XWXup Interface state transitions: XNX1 Hardware is XXX<[^,]+>XXXManagement Ethernet, address is XAX5254.00d6.36c9 (bia XaX5254.00d6.36c9) Internet address is XAX10.30.108.132/XnX23 MTU XNX1514 bytes, BW XNX0 Kbit reliability 255/255, txload Unknown, rxload Unknown Encapsulation XWXARPA, Duplex unknown, 0Kb/s, unknown, link type is XWXautonegotiation output flow control is XWXoff, input flow control is XWXoff Carrier delay (up) is XNX10 msec loopback XXX<[^,]+>XXXnot set, ARP type ARPA, ARP timeout XTX04:00:00 Last input XTX00:00:00, output XTX00:00:48 Last clearing of "show interface" counters XRXnever 5 minute input rate XNX79000 bits/sec, XNX32 packets/sec 5 minute output rate XNX0 bits/sec, XNX0 packets/sec XNX2459211 packets input, XNX774707935 bytes, XNX0 total input drops XNX0 drops for unrecognized upper-level protocol Received XNX2216135 broadcast packets, XNX233738 multicast packets XNX0 runts, XNX0 giants, XNX0 throttles, XNX0 parity XNX0 input errors, XNX0 CRC, XNX0 frame, XNX0 overrun, XNX0 ignored, XNX0 abort XNX349 packets output, XNX58930 bytes, XNX0 total output drops Output XNX4 broadcast packets, XNX0 multicast packets XNX0 output errors, XNX0 underruns, XNX0 applique, XNX0 resets XNX0 output buffer failures, XNX0 output buffers swapped out XNX1 carrier transitions OS: ios CMD: show_interface_ SHOWCMD: show interface {ifname} PREFIX: show.intf ACTUAL: GigabitEthernet0/0 is up, line protocol is up Hardware is iGbE, address is 5254.00f7.4fe8 (bia 5254.00f7.4fe8) Internet address is 10.10.10.2/24 MTU 1500 bytes, BW 1000000 Kbit/sec, DLY 10 usec, reliability 255/255, txload 1/255, rxload 1/255 Encapsulation ARPA, loopback not set Keepalive set (10 sec) Full Duplex, 1Gbps, media type is RJ45 output flow-control is unsupported, input flow-control is unsupported ARP type: ARPA, ARP Timeout 04:00:00 Last input 00:00:45, output 00:00:00, output hang never Last clearing of "show interface" counters never Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0 Queueing strategy: fifo Output queue: 0/40 (size/max) 5 minute input rate 0 bits/sec, 0 packets/sec 5 minute output rate 0 bits/sec, 0 packets/sec 96 packets input, 22961 bytes, 0 no buffer Received 0 broadcasts (0 IP multicasts) 0 runts, 0 giants, 0 throttles 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored 0 watchdog, 0 multicast, 0 pause input 364 packets output, 37751 bytes, 0 underruns 0 output errors, 0 collisions, 2 interface resets 12 unknown protocol drops 0 babbles, 0 late collision, 0 deferred 0 lost carrier, 0 no carrier, 0 pause output 0 output buffer failures, 0 output buffers swapped out MARKUP: XIXGigabitEthernet0/0 is XCXup, line protocol is XWXup Hardware is XXX<[^,]+>XXXiGbE, address is XAX5254.00d6.36c9 (bia XaX5254.00d6.36c9) Internet address is XAX10.30.108.132/XnX24 MTU XNX1500 bytes, BW XNX1000000 Kbit/sec, DLY XNX10 usec, reliability XXX<[a-z0-9/]+>XXX255/255, txload XXX<[a-z0-9/]+>XXX1/255, rxload XXX<[a-z0-9/]+>XXX1/255 Encapsulation XWXARPA, loopback XRXnot set Keepalive XWXset (10 sec) XWXFull Duplex, 1Gbps, media type is XRXRJ45 output flow-control is XWXunsupported, input flow-control is XWXunsupported ARP type: XWXARPA, ARP Timeout XTX04:00:00 Last input XTX00:00:45, output XTX00:00:00, output hang XRXnever Last clearing of "show interface" counters XRXnever Input queue: XXX<[0-9/]+>XXX0/75/0/0 (size/max/drops/flushes); Total output drops: XNX0 Queueing strategy: XWXfifo Output queue: X<[0-9/]+>X0/40 (size/max) 5 minute input rate XNX0 bits/sec, XNX0 packets/sec 5 minute output rate XNX0 bits/sec, XNX0 packets/sec XNX96 packets input, XNX22961 bytes, 0 no buffer Received XNX0 broadcasts (XNX0 IP multicasts) XNX0 runts, XNX0 giants, XNX0 throttles XNX0 input errors, XNX0 CRC, XNX0 frame, XNX0 overrun, XNX0 ignored XNX0 watchdog, XNX0 multicast, XNX0 pause input XNX364 packets output, XNX37751 bytes, XNX0 XNX0 output errors, XNX0 collisions, XNX2 interface resets XNX12 unknown protocol drops XNX0 babbles, XNX0 late collision, XNX0 deferred XNX0 lost carrier, XNX0 no carrier, XNX0 pause output XNX0 output buffer failures, XNX0 output buffers swapped out OS: iosxe CMD: show_interface_ SHOWCMD: show interface {ifname} PREFIX: show.intf ACTUAL: GigabitEthernet0/0 is up, line protocol is up Hardware is iGbE, address is 5254.00f7.4fe8 (bia 5254.00f7.4fe8) Internet address is 10.10.10.2/24 MTU 1500 bytes, BW 1000000 Kbit/sec, DLY 10 usec, reliability 255/255, txload 1/255, rxload 1/255 Encapsulation ARPA, loopback not set Keepalive set (10 sec) Auto Duplex, Unknown, link type is auto, media type is RJ45 output flow-control is unsupported, input flow-control is unsupported ARP type: ARPA, ARP Timeout 04:00:00 Last input 00:00:45, output 00:00:00, output hang never Last clearing of "show interface" counters never Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0 Queueing strategy: fifo Output queue: 0/40 (size/max) 5 minute input rate 0 bits/sec, 0 packets/sec 5 minute output rate 0 bits/sec, 0 packets/sec 96 packets input, 22961 bytes, 0 no buffer Received 0 broadcasts (0 IP multicasts) 0 runts, 0 giants, 0 throttles 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored 0 watchdog, 0 multicast, 0 pause input 364 packets output, 37751 bytes, 0 underruns 0 output errors, 0 collisions, 2 interface resets 12 unknown protocol drops 0 babbles, 0 late collision, 0 deferred 0 lost carrier, 0 no carrier, 0 pause output 0 output buffer failures, 0 output buffers swapped out MARKUP: XIXGigabitEthernet0/0 is XCXup, line protocol is XWXup Hardware is XXX<[^,]+>XXXiGbE, address is XAX5254.00d6.36c9 (bia XaX5254.00d6.36c9) Internet address is XAX10.30.108.132/XnX24 MTU XNX1500 bytes, BW XNX1000000 Kbit/sec, DLY XNX10 usec, reliability XXX<[a-z0-9/]+>XXX255/255, txload XXX<[a-z0-9/]+>XXX1/255, rxload XXX<[a-z0-9/]+>XXX1/255 Encapsulation XWXARPA, loopback XRXnot set Keepalive XWXset (10 sec) XWXAuto Duplex, XwXUnknown, link type is XWXauto, media type is XRXRJ45 output flow-control is XWXunsupported, input flow-control is XWXunsupported ARP type: XWXARPA, ARP Timeout XTX04:00:00 Last input XTX00:00:45, output XTX00:00:00, output hang XRXnever Last clearing of "show interface" counters XRXnever Input queue: XXX<[0-9/]+>XXX0/75/0/0 (size/max/drops/flushes); Total output drops: XNX0 Queueing strategy: XWXfifo Output queue: X<[0-9/]+>X0/40 (size/max) 5 minute input rate XNX0 bits/sec, XNX0 packets/sec 5 minute output rate XNX0 bits/sec, XNX0 packets/sec XNX96 packets input, XNX22961 bytes, 0 no buffer Received XNX0 broadcasts (XNX0 IP multicasts) XNX0 runts, XNX0 giants, XNX0 throttles XNX0 input errors, XNX0 CRC, XNX0 frame, XNX0 overrun, XNX0 ignored XNX0 watchdog, XNX0 multicast, XNX0 pause input XNX364 packets output, XNX37751 bytes, XNX0 XNX0 output errors, XNX0 collisions, XNX2 interface resets XNX12 unknown protocol drops XNX0 babbles, XNX0 late collision, XNX0 deferred XNX0 lost carrier, XNX0 no carrier, XNX0 pause output XNX0 output buffer failures, XNX0 output buffers swapped out OS: NXOS CMD: show_interface_ SHOWCMD: show interface {ifname} PREFIX: show.intf ACTUAL: mgmt0 is up admin state is up Hardware: Ethernet, address: 5254.0070.0dff (bia 5254.0070.0dff) Internet Address is 10.10.10.5/24 MTU 1500 bytes, BW 0 Kbit, DLY 10 usec reliability 255/255, txload 1/255, rxload 1/255 Encapsulation ARPA, medium is broadcast Port mode is routed auto-duplex, auto-speed Auto-Negotiation is turned on Auto-mdix is turned off EtherType is 0x0000 1 minute input rate 112 bits/sec, 0 packets/sec 1 minute output rate 24 bits/sec, 0 packets/sec Rx 71 input packets 2 unicast packets 68 multicast packets 1 broadcast packets 22451 bytes Tx 33 output packets 1 unicast packets 29 multicast packets 3 broadcast packets 6527 bytes MARKUP: XWXmgmt0 is XWXup admin state is XRXup Hardware: XWXEthernet, address: XMX5254.0070.0dff (bia XMX5254.0070.0dff) Internet Address is XXX<[0-9\.]+>XXX10.10.10.5/24 MTU XNX1500 bytes, BW XNX0 Kbit, DLY XNX10 usec reliability XXX<[0-9/]+>XXX255/255, txload XXX<[0-9/]+>XXX1/255, rxload XXX<[0-9/]+>XXX1/255 Encapsulation XWXARPA, medium is broadcast Port mode is XRXrouted XWXauto-duplex, XWXauto-speed Auto-Negotiation is turned XRXon Auto-mdix is turned XRXoff EtherType is XHX0x0000 1 minute input rate XNX112 bits/sec, XNX0 packets/sec 1 minute output rate XNX24 bits/sec, XNX0 packets/sec Rx XNX71 input packets XNX2 unicast packets XNX68 multicast packets XNX1 broadcast packets XNX22451 bytes Tx XNX33 output packets XNX1 unicast packets XNX29 multicast packets OS: aireos CMD: show_interface_ SHOWCMD: show interface detailed {ifname} PREFIX: show.intf ACTUAL: >show interface detailed management Interface Name................................... management MAC Address...................................... 80:e0:1d:23:98:a0 IP Address....................................... 1.1.1.1 IP Netmask....................................... 255.255.0.0 IP Gateway....................................... 1.1.1.5 External NAT IP State............................ Disabled External NAT IP Address.......................... 0.0.0.0 Link Local IPv6 Address.......................... fe80::82e0:1dff:fe23:98a0/64 STATE ........................................... REACHABLE Primary IPv6 Address............................. ::/128 STATE ........................................... NONE Primary IPv6 Gateway............................. :: Primary IPv6 Gateway Mac Address................. 00:00:00:00:00:00 STATE ........................................... INCOMPLETE VLAN............................................. untagged Quarantine-vlan.................................. 0 Active Physical Port............................. 1 Primary Physical Port............................ 1 Backup Physical Port............................. Unconfigured DHCP Proxy Mode.................................. Global Primary DHCP Server.............................. 1.1.1.10 Secondary DHCP Server............................ Unconfigured DHCP Option 82................................... Disabled DHCP Option 82 bridge mode insertion............. Disabled IPv4 ACL......................................... Unconfigured IPv6 ACL......................................... Unconfigured mDNS Profile Name................................ Unconfigured AP Manager....................................... Yes Guest Interface.................................. No L2 Multicast..................................... Enabled MARKUP: Interface Name................................... XIXmanagement MAC Address...................................... XMX80:e0:1d:23:98:a0 IP Address....................................... XAX1.1.1.1 IP Netmask....................................... XPX255.255.0.0 IP Gateway....................................... XAX1.1.1.5 External NAT IP State............................ XRXDisabled External NAT IP Address.......................... XAX0.0.0.0 Link Local IPv6 Address.......................... XAXfe80::82e0:1dff:fe23:98a0/64 STATE ........................................... XRXREACHABLE Primary IPv6 Address............................. XPX::/128 STATE ........................................... XRXNONE Primary IPv6 Gateway............................. XAX:: Primary IPv6 Gateway Mac Address................. XMX00:00:00:00:00:00 STATE ........................................... XRXINCOMPLETE VLAN............................................. XRXuntagged Quarantine-vlan.................................. XRX0 Active Physical Port............................. XRX1 Primary Physical Port............................ XRX1 Backup Physical Port............................. XRXUnconfigured DHCP Proxy Mode.................................. XRXGlobal Primary DHCP Server.............................. XAX1.1.1.10 Secondary DHCP Server............................ XAXUnconfigured DHCP Option 82................................... XRXDisabled DHCP Option 82 bridge mode insertion............. XRXDisabled IPv4 ACL......................................... XRXUnconfigured IPv6 ACL......................................... XRXUnconfigured mDNS Profile Name................................ XRXUnconfigured AP Manager....................................... XRXYes Guest Interface.................................. XRXNo L2 Multicast..................................... XRXEnabled OS: IOSXR CMD: show_eth_driver_interface_ SHOWCMD: show eth-drvr interface {ifname} PREFIX: show.ethdrvr ACTUAL: RP/0/0/CPU0:ios#show eth-drvr interface gigabitEthernet 0/0/0/0 Thu Mar 19 03:56:35.976 PDT Interface Gi0/0/0/0: Policy (internal, version=0, size=40) ether_if_type: PHY interface_ready: 1 is_l2: 0 not provisioned l2pt: off mac_addr: 02fe:08cb:26c5 trunk.native_vlan: 0 trunk.native_is_svlan: 0 trunk.qinq_tunneling_etype: 0x8100 trunk.mac_acc_ingress: 0 trunk.mac_acc_egress: 0 trunk.filter_dot1q: 0 trunk.filter_dot1ad: 0 trunk.filter_mac_relay: 0 Unicast MAC Addresses: 0 RP/0/0/CPU0:ios#show eth-drvr interface gigabitEthernet 0/0/0/0.0 Thu Mar 19 03:57:23.096 PDT Interface Gi0/0/0/0.0: Policy (internal, version=0, size=60) ether_if_type: PHY_L3_SUB interface_ready: 1 is_l2: 0 sub.parent: 0x00000100 sub.admin_up: 0 EFP MATCH: (none) EFP REWRITE: (none) Unicast MAC Addresses: 0 MARKUP: Interface XXX<[-A-Za-z0-9\.+/]+>XXXGi0/0/0/0: Policy (internal, version=0, size=XNX40) ether_if_type: XRXPHY interface_ready: XNX1 is_l2: XNX0 XWXnot provisioned l2pt: XRXoff mac_addr: XMX02fe:08cb:26c5 trunk.native_vlan: XNX0 trunk.native_is_svlan: XNX0 trunk.qinq_tunneling_etype: XHX0x8100 trunk.mac_acc_ingress: XNX0 trunk.mac_acc_egress: XNX0 trunk.filter_dot1q: XNX0 trunk.filter_dot1ad: XNX0 trunk.filter_mac_relay: XNX0 sub.parent: XHX0x00000100 sub.admin_up: XNX0 EFP MATCH: XRX(none) EFP REWRITE: XRX(none) Unicast MAC Addresses: XNX0 ''' pg.extend_markup(marked_up_show_interface_xrvr_output) show_cmds = { 'iosxr': { 'SHOW_ARP' : "show arp", }, 'ios': { 'SHOW_ARP' : "show arp", }, 'iosxe': { 'SHOW_ARP' : "show arp", }, 'nxos': { 'SHOW_ARP' : "show {=ip} arp", }, 'aireos': { 'SHOW_ARP' : "show arp kernel", } } pg.extend(show_cmds=show_cmds)