/* Do arp resolution from arp cache in PxeBcMode. */
BOOLEAN PxeBcCheckArpCache(IN EFI_PXE_BASE_CODE_MODE *Mode, IN EFI_IPv4_ADDRESS *Ip4Addr, OUT EFI_MAC_ADDRESS *MacAddress)
/* Do arp resolution from arp cache in PxeBcMode. */
BOOLEAN PxeBcCheckArpCache(IN EFI_PXE_BASE_CODE_MODE *Mode, IN EFI_IPv4_ADDRESS *Ip4Addr, OUT EFI_MAC_ADDRESS *MacAddress)
{
  UINT32  Index;
  ASSERT (!Mode->UsingIpv6);
  for (Index = 0; Index < Mode->ArpCacheEntries; Index++) {
    if (EFI_IP4_EQUAL (&Mode->ArpCache[Index].IpAddr.v4, Ip4Addr)) {
      CopyMem (
        MacAddress,
        &Mode->ArpCache[Index].MacAddr,
        sizeof (EFI_MAC_ADDRESS)
        );
      return TRUE;
    }
  }
  return FALSE;
}