/* Set the station address, subnetmask and gateway address for the default interface. */
EFI_STATUS Ip4Config2SetDefaultIf(IN IP4_CONFIG2_INSTANCE *Instance, IN IP4_ADDR StationAddress, IN IP4_ADDR SubnetMask, IN IP4_ADDR GatewayAddress)
/* Set the station address, subnetmask and gateway address for the default interface. */
EFI_STATUS Ip4Config2SetDefaultIf(IN IP4_CONFIG2_INSTANCE *Instance, IN IP4_ADDR StationAddress, IN IP4_ADDR SubnetMask, IN IP4_ADDR GatewayAddress)
{
  EFI_STATUS   Status;
  IP4_SERVICE  *IpSb;
  IpSb = IP4_SERVICE_FROM_IP4_CONFIG2_INSTANCE (Instance);
  if (!Ip4StationAddressValid (StationAddress, SubnetMask)) {
    return EFI_INVALID_PARAMETER;
  }
  Status = Ip4Config2SetDefaultAddr (IpSb, StationAddress, SubnetMask);
  if (EFI_ERROR (Status)) {
    return Status;
  }
  if (GatewayAddress != IP4_ALLZERO_ADDRESS) {
    Ip4AddRoute (
      IpSb->DefaultRouteTable,
      IP4_ALLZERO_ADDRESS,
      IP4_ALLZERO_ADDRESS,
      GatewayAddress
      );
  }
  return EFI_SUCCESS;
}