def _check_arp_reply(self, arp_packet):
    arp_packet_payload = arp_packet.payload
    if arp_packet_payload.opcode == arp.REQUEST:
      interface_matched = self._if_valid_arp_request(arp_packet_payload)
      if interface_matched is None:
        return None
      else:
        # This ARP query is for this host, construct an reply packet
        arp_reply = arp()
        arp_reply.hwsrc = interface_matched.hw_addr
        arp_reply.hwdst = arp_packet_payload.hwsrc
        arp_reply.opcode = arp.REPLY
        arp_reply.protosrc = arp_packet_payload.protodst
        arp_reply.protodst = arp_packet_payload.protosrc
        ether = ethernet()
        ether.type = ethernet.ARP_TYPE
        ether.src = interface_matched.hw_addr
        ether.dst = arp_packet.src
        ether.payload = arp_reply
        return ether
Check whether incoming packet is a valid ARP request.
dataset/ETHPy150Open ucb-sts/sts/sts/entities/hosts.py/Host._check_arp_reply