/* The ParseOptions() function parses the option fields in an MTFTPv4 OACK packet and returns the number of options that were found and optionally a list of pointers to the options in the packet. If one or more of the option fields are not valid, then EFI_PROTOCOL_ERROR is returned and *OptionCount and *OptionList stop at the last valid option. The OptionList is allocated by this function, and caller should free it when used. */
EFI_STATUS EFIAPI EfiMtftp4ParseOptions(IN EFI_MTFTP4_PROTOCOL *This, IN UINT32 PacketLen, IN EFI_MTFTP4_PACKET *Packet, OUT UINT32 *OptionCount, OUT EFI_MTFTP4_OPTION **OptionList OPTIONAL)
/* The ParseOptions() function parses the option fields in an MTFTPv4 OACK packet and returns the number of options that were found and optionally a list of pointers to the options in the packet. If one or more of the option fields are not valid, then EFI_PROTOCOL_ERROR is returned and *OptionCount and *OptionList stop at the last valid option. The OptionList is allocated by this function, and caller should free it when used. */
EFI_STATUS EFIAPI EfiMtftp4ParseOptions(IN EFI_MTFTP4_PROTOCOL *This, IN UINT32 PacketLen, IN EFI_MTFTP4_PACKET *Packet, OUT UINT32 *OptionCount, OUT EFI_MTFTP4_OPTION **OptionList OPTIONAL)
{
  EFI_STATUS  Status;
  if ((This == NULL) || (PacketLen < MTFTP4_OPCODE_LEN) ||
      (Packet == NULL) || (OptionCount == NULL))
  {
    return EFI_INVALID_PARAMETER;
  }
  Status = Mtftp4ExtractOptions (Packet, PacketLen, OptionCount, OptionList);
  if (EFI_ERROR (Status)) {
    return Status;
  }
  if (*OptionCount == 0) {
    return EFI_NOT_FOUND;
  }
  return EFI_SUCCESS;
}