/* The first part of the allocated buffer is EFI_ARP_FIND_DATA, following which are protocol address pairs and hardware address pairs. When finding a specific protocol address (BySwAddress is TRUE and AddressBuffer is not NULL), the ARP cache timeout for the found entry is reset if Refresh is set to TRUE. If the found ARP cache entry is a permanent entry, it is not affected by Refresh. */
EFI_STATUS EFIAPI ArpFind(IN EFI_ARP_PROTOCOL *This, IN BOOLEAN BySwAddress, IN VOID *AddressBuffer OPTIONAL, OUT UINT32 *EntryLength OPTIONAL, OUT UINT32 *EntryCount OPTIONAL, OUT EFI_ARP_FIND_DATA **Entries OPTIONAL, IN BOOLEAN Refresh)
/* The first part of the allocated buffer is EFI_ARP_FIND_DATA, following which are protocol address pairs and hardware address pairs. When finding a specific protocol address (BySwAddress is TRUE and AddressBuffer is not NULL), the ARP cache timeout for the found entry is reset if Refresh is set to TRUE. If the found ARP cache entry is a permanent entry, it is not affected by Refresh. */
EFI_STATUS EFIAPI ArpFind(IN EFI_ARP_PROTOCOL *This, IN BOOLEAN BySwAddress, IN VOID *AddressBuffer OPTIONAL, OUT UINT32 *EntryLength OPTIONAL, OUT UINT32 *EntryCount OPTIONAL, OUT EFI_ARP_FIND_DATA **Entries OPTIONAL, IN BOOLEAN Refresh)
{
  EFI_STATUS         Status;
  ARP_INSTANCE_DATA  *Instance;
  EFI_TPL            OldTpl;
  if ((This == NULL) ||
      (!Refresh && (EntryCount == NULL) && (EntryLength == NULL)) ||
      ((Entries != NULL) && ((EntryLength == NULL) || (EntryCount == NULL))))
  {
    return EFI_INVALID_PARAMETER;
  }
  Instance = ARP_INSTANCE_DATA_FROM_THIS (This);
  if (!Instance->Configured) {
    return EFI_NOT_STARTED;
  }
  OldTpl = gBS->RaiseTPL (TPL_CALLBACK);
  Status = ArpFindCacheEntry (
             Instance,
             BySwAddress,
             AddressBuffer,
             EntryLength,
             EntryCount,
             Entries,
             Refresh
             );
  gBS->RestoreTPL (OldTpl);
  return Status;
}