/* If the controller handle does not have the EFI_IP4_CONFIG2_PROTOCOL installed, the default address is static. If failed to get the policy from Ip4 Config2 Protocol, the default address is static. Otherwise, get the result from Ip4 Config2 Protocol. */
BOOLEAN NetLibDefaultAddressIsStatic(IN EFI_HANDLE Controller)
/* If the controller handle does not have the EFI_IP4_CONFIG2_PROTOCOL installed, the default address is static. If failed to get the policy from Ip4 Config2 Protocol, the default address is static. Otherwise, get the result from Ip4 Config2 Protocol. */
BOOLEAN NetLibDefaultAddressIsStatic(IN EFI_HANDLE Controller)
{
  EFI_STATUS                Status;
  EFI_IP4_CONFIG2_PROTOCOL  *Ip4Config2;
  UINTN                     DataSize;
  EFI_IP4_CONFIG2_POLICY    Policy;
  BOOLEAN                   IsStatic;
  Ip4Config2 = NULL;
  DataSize = sizeof (EFI_IP4_CONFIG2_POLICY);
  IsStatic = TRUE;
  Status = gBS->HandleProtocol (Controller, &gEfiIp4Config2ProtocolGuid, (VOID **)&Ip4Config2);
  if (EFI_ERROR (Status)) {
    goto ON_EXIT;
  }
  Status = Ip4Config2->GetData (Ip4Config2, Ip4Config2DataTypePolicy, &DataSize, &Policy);
  if (EFI_ERROR (Status)) {
    goto ON_EXIT;
  }
  IsStatic = (BOOLEAN)(Policy == Ip4Config2PolicyStatic);
ON_EXIT:
  return IsStatic;
}