'Builds an ETH/IP any-to-any ARP packet (an "ARP ping")'

def sendPing(self, macEntry, ipAddr):

    r = arp()
    r.opcode = arp.REQUEST
    r.hwdst = macEntry.macaddr
    r.hwsrc = self.ping_src_mac
    r.protodst = ipAddr
    e = ethernet(type=ethernet.ARP_TYPE, src=r.hwsrc, dst=r.hwdst)
    e.payload = r
    log.debug('%i    %i    sending    ARP    REQ    to    %s    %s', macEntry.dpid, macEntry.port, str(r.hwdst), str(r.protodst))
    msg = of.ofp_packet_out(data=e.pack(), action=of.ofp_action_output(port=macEntry.port))
    if core.openflow.sendToDPID(macEntry.dpid, msg.pack()):
        ipEntry = macEntry.ipAddrs[ipAddr]
        ipEntry.pings.sent()
    else:
        log.debug('%i    %i    ERROR    sending    ARP    REQ    to    %s    %s', macEntry.dpid, macEntry.port, str(r.hwdst), str(r.protodst))
        del macEntry.ipAddrs[ipAddr]
    return
