Search for entries in the ARP tables using the following mine functions:

    - net.arp

    Optional arguments:

    device
        Return interface data from a certain device only.

    interface
        Return data selecting by interface name.

    mac
        Search using a specific MAC Address.

    ip
        Search using a specific IP Address.

    display: ``True``
        Display on the screen or return structured object? Default: ``True``, will return on the CLI.

    CLI Example:

    .. code-block:: bash

        $ sudo salt-run net.findarp mac=8C:60:0F:78:EC:41

    Output Example:

    .. code-block:: text

        ARP Entries for MAC 8C:60:0F:78:EC:41
        ________________________________________________________________________________
        |    Device    |     Interface     |        MAC        |       IP      |  Age  |
        ________________________________________________________________________________
        | edge01.bjm01 | irb.171 [ae0.171] | 8C:60:0F:78:EC:41 | 172.172.17.19 | 956.0 |
        ________________________________________________________________________________

def findarp(device=None,
            interface=None,
            mac=None,
            ip=None,
            display=_DEFAULT_DISPLAY):  # pylint: disable=invalid-name
    '''
    Search for entries in the ARP tables using the following mine functions:

    - net.arp

    Optional arguments:

    device
        Return interface data from a certain device only.

    interface
        Return data selecting by interface name.

    mac
        Search using a specific MAC Address.

    ip
        Search using a specific IP Address.

    display: ``True``
        Display on the screen or return structured object? Default: ``True``, will return on the CLI.

    CLI Example:

    .. code-block:: bash

        $ sudo salt-run net.findarp mac=8C:60:0F:78:EC:41

    Output Example:

    .. code-block:: text

        ARP Entries for MAC 8C:60:0F:78:EC:41
        ________________________________________________________________________________
        |    Device    |     Interface     |        MAC        |       IP      |  Age  |
        ________________________________________________________________________________
        | edge01.bjm01 | irb.171 [ae0.171] | 8C:60:0F:78:EC:41 | 172.172.17.19 | 956.0 |
        ________________________________________________________________________________
    '''
    labels = {
        'device': 'Device',
        'interface': 'Interface',
        'mac': 'MAC',
        'ip': 'IP',
        'age': 'Age'
    }
    rows = []

    all_arp = _get_mine('net.arp')

    title = "ARP Entries"
    if device:
        title += ' on device {device}'.format(device=device)
    if interface:
        title += ' on interface {interf}'.format(interf=interface)
    if ip:
        title += ' for IP {ip}'.format(ip=ip)
    if mac:
        title += ' for MAC {mac}'.format(mac=mac)

    if device:
        all_arp = {device: all_arp.get(device)}

    for device, device_arp in six.iteritems(all_arp):
        if not device_arp:
            continue
        if not device_arp.get('result', False):
            continue
        arp_table = device_arp.get('out', [])
        for arp_entry in arp_table:
            if ((mac and arp_entry.get('mac', '').lower() == mac.lower()) or  # pylint: disable=too-many-boolean-expressions
                (interface and interface in arp_entry.get('interface', '')) or
                (ip and napalm_helpers.convert(napalm_helpers.ip, arp_entry.get('ip', '')) ==
                 napalm_helpers.convert(napalm_helpers.ip, ip))):
                rows.append({
                    'device': device,
                    'interface': arp_entry.get('interface'),
                    'mac': napalm_helpers.convert(napalm_helpers.mac, arp_entry.get('mac')),
                    'ip': napalm_helpers.convert(napalm_helpers.ip, arp_entry.get('ip')),
                    'age': arp_entry.get('age')
                })

    return _display_runner(rows, labels, title, display=display)