/* Add Dns4 ServerIp to common list of addresses of all configured DNSv4 server. */
EFI_STATUS EFIAPI AddDns4ServerIp(IN LIST_ENTRY *Dns4ServerList, IN EFI_IPv4_ADDRESS ServerIp)
/* Add Dns4 ServerIp to common list of addresses of all configured DNSv4 server. */
EFI_STATUS EFIAPI AddDns4ServerIp(IN LIST_ENTRY *Dns4ServerList, IN EFI_IPv4_ADDRESS ServerIp)
{
  DNS4_SERVER_IP  *NewServerIp;
  DNS4_SERVER_IP  *Item;
  LIST_ENTRY      *Entry;
  LIST_ENTRY      *Next;
  NewServerIp = NULL;
  Item        = NULL;
  NET_LIST_FOR_EACH_SAFE (Entry, Next, Dns4ServerList) {
    Item = NET_LIST_USER_STRUCT (Entry, DNS4_SERVER_IP, AllServerLink);
    if (CompareMem (&Item->Dns4ServerIp, &ServerIp, sizeof (EFI_IPv4_ADDRESS)) == 0) {
      return EFI_SUCCESS;
    }
  }
  NewServerIp = AllocatePool (sizeof (DNS4_SERVER_IP));
  if (NewServerIp == NULL) {
    return EFI_OUT_OF_RESOURCES;
  }
  InitializeListHead (&NewServerIp->AllServerLink);
  CopyMem (&NewServerIp->Dns4ServerIp, &ServerIp, sizeof (EFI_IPv4_ADDRESS));
  InsertTailList (Dns4ServerList, &NewServerIp->AllServerLink);
  return EFI_SUCCESS;
}