/* This function finds the udp instance by the specified <Address, Port> pair. */
BOOLEAN Udp4FindInstanceByPort(IN LIST_ENTRY *InstanceList, IN EFI_IPv4_ADDRESS *Address, IN UINT16 Port)
/* This function finds the udp instance by the specified <Address, Port> pair. */
BOOLEAN Udp4FindInstanceByPort(IN LIST_ENTRY *InstanceList, IN EFI_IPv4_ADDRESS *Address, IN UINT16 Port)
{
  LIST_ENTRY            *Entry;
  UDP4_INSTANCE_DATA    *Instance;
  EFI_UDP4_CONFIG_DATA  *ConfigData;
  NET_LIST_FOR_EACH (Entry, InstanceList) {
    Instance   = NET_LIST_USER_STRUCT (Entry, UDP4_INSTANCE_DATA, Link);
    ConfigData = &Instance->ConfigData;
    if (!Instance->Configured || ConfigData->AcceptAnyPort) {
      continue;
    }
    if (EFI_IP4_EQUAL (&ConfigData->StationAddress, Address) &&
        (ConfigData->StationPort == Port))
    {
      return TRUE;
    }
  }
  return FALSE;
}