libpldm: Add encode API for VerifyComplete response

After the component image transfer finishes successfully, the FD
transitions to the VERIFY state and performs a validation check
against the component image that was received. This implementation
works with DSP0267_1.1.0, DSP0267_1.0.1 and DSP0267_1.0.0.

Tested: Unit tests passed

Signed-off-by: gokulsanker <gokul.sanker.v.g@intel.com>
Change-Id: Ia52586ede23b43dc0470910260cfc4ac1f427742
diff --git a/libpldm/firmware_update.h b/libpldm/firmware_update.h
index 3458680..9163f96 100644
--- a/libpldm/firmware_update.h
+++ b/libpldm/firmware_update.h
@@ -27,7 +27,8 @@
 	PLDM_PASS_COMPONENT_TABLE = 0x13,

 	PLDM_UPDATE_COMPONENT = 0x14,

 	PLDM_REQUEST_FIRMWARE_DATA = 0x15,

-	PLDM_TRANSFER_COMPLETE = 0x16

+	PLDM_TRANSFER_COMPLETE = 0x16,

+	PLDM_VERIFY_COMPLETE = 0x17

 };

 

 /** @brief PLDM Firmware update completion codes

@@ -208,7 +209,7 @@
 	PLDM_FWUP_VENDOR_TRANSFER_RESULT_RANGE_MAX = 0x8F

 };

 

-/**@brief VerifyResult values in the response of VerifyComplete

+/**@brief VerifyResult values in the request of VerifyComplete

  */

 enum pldm_firmware_update_verify_result_values {

 	PLDM_FWUP_VERIFY_SUCCESS = 0x00,

@@ -803,6 +804,21 @@
 int decode_verify_complete_req(const struct pldm_msg *msg,

 			       size_t payload_length, uint8_t *verify_result);

 

+/** @brief Create PLDM response message for VerifyComplete

+ *

+ *  @param[in] instance_id - Message's instance id

+ *  @param[in] completion_code - CompletionCode

+ *  @param[in,out] msg - Message will be written to this

+ *  @param[in] payload_length - Length of response message payload

+ *

+ *  @return pldm_completion_codes

+ *

+ *  @note  Caller is responsible for memory alloc and dealloc of param

+ *         'msg.payload'

+ */

+int encode_verify_complete_resp(uint8_t instance_id, uint8_t completion_code,

+				struct pldm_msg *msg, size_t payload_length);

+

 #ifdef __cplusplus

 }

 #endif