NAME

App::Netdisco::SSHCollector::Platform::IOSXR

DESCRIPTION

Collect ARP entries from Cisco IOS-XR routers using Expect, and, with store_vrfs on, IPv6 neighbor entries as well. Suitable for both 32- and 64-bit IOS-XR.

PUBLIC METHODS

arpnip($host, $ssh)

Retrieve ARP entries from device. $host is the hostname or IP address of the device. $ssh is a Net::OpenSSH connection to the device.

Returns a list of hashrefs in the format { mac => MACADDR, ip => IPADDR }.

arpnip_by_vrf($host, $ssh, $args)

As arpnip, used when store_vrfs is on. Reads show vrf all, then the global show arp and show ipv6 neighbors and, for each listed VRF, show arp vrf NAME and, when the global show ipv6 neighbors answered, show ipv6 neighbors vrf NAME. Each entry's VRF is the one it was read from (the global table is ''). The global show ipv6 neighbors also lists VRF neighbors, so its entries carry mixed => 1. The router's own addresses (state Interface) are kept, as arpnip keeps them.

Returns { entries => [ { ip, mac, vrf } ], vrf_read => { VRF => 0|1 }, vrf_list_complete => 0|1, families => [4, 6] }, or undef when the session or show vrf all fails. families is [4] when the global show ipv6 neighbors did not answer cleanly (IPv6 is unsupported or unreached), and then vrf_read covers IPv4 only; otherwise it is [4, 6]. A table is read whole when it returned to the prompt with no % or Invalid line and every line was a timestamp, a header, a location, an entry or a multicast adjacency. A VRF is 1 only when its table for every family in families was read whole, so a VRF whose IPv6 table fails is 0 though its IPv4 entries are reported. A VRF that is empty, misspelled or unknown prints nothing, so an empty table reads as whole. A VRF list row that cannot be parsed into a name makes vrf_list_complete 0, and a VRF name outside [A-Za-z0-9_.:-] or equal to all is 0 with no command sent. Only a VRF named exactly default is skipped as the global table; Default is a user VRF. A show vrf all that returned with its header and no VRF is a whole, empty list. After a timeout the rest of the session is not read, and that VRF and every one not yet read are 0.

A subclass that overrides arpnip must also override arpnip_by_vrf, or with store_vrfs on this arpnip_by_vrf is used instead of the override.