/* Close the protocol opened for Redfish discovery. This function also destroy the network services. */
EFI_STATUS CloseProtocolService(IN EFI_DRIVER_BINDING_PROTOCOL *ThisBindingProtocol, IN EFI_HANDLE ControllerHandle, IN REDFISH_DISCOVER_REQUIRED_PROTOCOL *ThisRequiredProtocol, IN EFI_HANDLE DriverAgentHandle, IN EFI_HANDLE DriverControllerHandle)
/* Close the protocol opened for Redfish discovery. This function also destroy the network services. */
EFI_STATUS CloseProtocolService(IN EFI_DRIVER_BINDING_PROTOCOL *ThisBindingProtocol, IN EFI_HANDLE ControllerHandle, IN REDFISH_DISCOVER_REQUIRED_PROTOCOL *ThisRequiredProtocol, IN EFI_HANDLE DriverAgentHandle, IN EFI_HANDLE DriverControllerHandle)
{
  EFI_STATUS  Status;
  Status = gBS->CloseProtocol (
                  ControllerHandle,
                  ThisRequiredProtocol->RequiredProtocolGuid,
                  DriverAgentHandle,
                  DriverControllerHandle
                  );
  if (!EFI_ERROR (Status)) {
    NetLibDestroyServiceChild (
      ControllerHandle,
      ThisBindingProtocol->ImageHandle,
      ThisRequiredProtocol->RequiredServiceBindingProtocolGuid,
      ControllerHandle
      );
  }
  return Status;
}