/* Build and send a ACK packet for download. */
EFI_STATUS Mtftp6RrqSendAck(IN MTFTP6_INSTANCE *Instance, IN UINT16 BlockNum)
/* Build and send a ACK packet for download. */
EFI_STATUS Mtftp6RrqSendAck(IN MTFTP6_INSTANCE *Instance, IN UINT16 BlockNum)
{
  EFI_MTFTP6_PACKET  *Ack;
  NET_BUF            *Packet;
  EFI_STATUS         Status;
  Status = EFI_SUCCESS;
  Packet = NetbufAlloc (sizeof (EFI_MTFTP6_ACK_HEADER));
  if (Packet == NULL) {
    return EFI_OUT_OF_RESOURCES;
  }
  Ack = (EFI_MTFTP6_PACKET *)NetbufAllocSpace (
                               Packet,
                               sizeof (EFI_MTFTP6_ACK_HEADER),
                               FALSE
                               );
  ASSERT (Ack != NULL);
  Ack->Ack.OpCode   = HTONS (EFI_MTFTP6_OPCODE_ACK);
  Ack->Ack.Block[0] = HTONS (BlockNum);
  Instance->CurRetry   = 0;
  Instance->LastPacket = Packet;
  Status = Mtftp6TransmitPacket (Instance, Packet);
  if (!EFI_ERROR (Status)) {
    Instance->AckedBlock = Instance->TotalBlock;
  }
  return Status;
}