Introduce a structure to represent variable fields

If there is a variable field in the message body, the decode function
needs to ensure that the buffer space passed by the caller is sufficient,
and then copy the contents of the field into the buffer.

However, we can do it like this:

struct variable_field{
         const uint8_t * ptr; // point to the filed in the message body
         size_t length; // length of the field
};

decode_func(request_msg, struct variable_field *field)

pldm command runs as request-response, we(openbmc) hold the request message
until command processing is complete. So in most cases, the lifecycle of
the message body is longer than the variable_field struct. then, it's no
need to copy the field, improving performance.

if we need to copy the field, we could:

uint8_t buffer[field->length]; // here we know exactly the size of the buffer
memcpy(buffer, field->ptr, filed->length);

avoid checking the buffer length in decode_functions().

eg:

decode_func(request_msg, uint8_t *buffer, size_t buffer_length)
{
	size_t field_length = sth;
	if(filed_length > buffer_length){
		do_sth;
	}
	memcpy(buffer, field, field_length);
}

uint8_t buffer[estimated];
decode_func(request_msg, buffer,sizeof(buffer));

In addition, s/breif/brief in the comments

Signed-off-by: John Wang <wangzqbj@inspur.com>
Change-Id: I033aa14edc2e93b0d6bb9e732e5259cf41e8cf75
diff --git a/libpldm/utils.h b/libpldm/utils.h
index df5b62a..1e15e18 100644
--- a/libpldm/utils.h
+++ b/libpldm/utils.h
@@ -10,6 +10,15 @@
 #include <stddef.h>
 #include <stdint.h>
 
+/** @struct variable_field
+ *
+ *  Structure representing variable filed in the pldm message
+ */
+struct variable_field {
+	const uint8_t *ptr;
+	size_t length;
+};
+
 /** @brief Compute Crc8(same as the one used by SMBUS)
  *
  *  @param[in] data - Pointer to the target data
@@ -35,37 +44,37 @@
  */
 int ver2str(const ver32_t *version, char *buffer, size_t buffer_size);
 
-/** @breif Convert bcd number(uint8_t) to decimal
+/** @brief Convert bcd number(uint8_t) to decimal
  *  @param[in] bcd - bcd number
  *  @return the decimal number
  */
 uint8_t bcd2dec8(uint8_t bcd);
 
-/** @breif Convert decimal number(uint8_t) to bcd
+/** @brief Convert decimal number(uint8_t) to bcd
  *  @param[in] dec - decimal number
  *  @return the bcd number
  */
 uint8_t dec2bcd8(uint8_t dec);
 
-/** @breif Convert bcd number(uint16_t) to decimal
+/** @brief Convert bcd number(uint16_t) to decimal
  *  @param[in] bcd - bcd number
  *  @return the decimal number
  */
 uint16_t bcd2dec16(uint16_t bcd);
 
-/** @breif Convert decimal number(uint16_t) to bcd
+/** @brief Convert decimal number(uint16_t) to bcd
  *  @param[in] dec - decimal number
  *  @return the bcd number
  */
 uint16_t dec2bcd16(uint16_t dec);
 
-/** @breif Convert bcd number(uint32_t) to decimal
+/** @brief Convert bcd number(uint32_t) to decimal
  *  @param[in] bcd - bcd number
  *  @return the decimal number
  */
 uint32_t bcd2dec32(uint32_t bcd);
 
-/** @breif Convert decimal number(uint32_t) to bcd
+/** @brief Convert decimal number(uint32_t) to bcd
  *  @param[in] dec - decimal number
  *  @return the bcd number
  */