/* This function wraps the Packet and the RxData. */
UDP4_RXDATA_WRAP * Udp4WrapRxData(IN UDP4_INSTANCE_DATA *Instance, IN NET_BUF *Packet, IN EFI_UDP4_RECEIVE_DATA *RxData)
/* This function wraps the Packet and the RxData. */
UDP4_RXDATA_WRAP * Udp4WrapRxData(IN UDP4_INSTANCE_DATA *Instance, IN NET_BUF *Packet, IN EFI_UDP4_RECEIVE_DATA *RxData)
{
  EFI_STATUS        Status;
  UDP4_RXDATA_WRAP  *Wrap;
  Wrap = AllocatePool (
           sizeof (UDP4_RXDATA_WRAP) +
           (Packet->BlockOpNum - 1) * sizeof (EFI_UDP4_FRAGMENT_DATA)
           );
  if (Wrap == NULL) {
    return NULL;
  }
  InitializeListHead (&Wrap->Link);
  CopyMem (&Wrap->RxData, RxData, sizeof (Wrap->RxData));
  Status = gBS->CreateEvent (
                  EVT_NOTIFY_SIGNAL,
                  TPL_NOTIFY,
                  Udp4RecycleRxDataWrap,
                  Wrap,
                  &Wrap->RxData.RecycleSignal
                  );
  if (EFI_ERROR (Status)) {
    FreePool (Wrap);
    return NULL;
  }
  Wrap->Packet      = Packet;
  Wrap->TimeoutTick = Instance->ConfigData.ReceiveTimeout;
  return Wrap;
}