Update libpldm api encode_*_req functions to have payload_length param

There were a few of the APIs in libpldm's fru and platform
that Hostboot was using downstream that did not have the
payload_length param which the Hostboot templates expect. All
encode_*_req functions should end with a payload_length parameter
and this commit moves us towards that goal.

Tested: I ran run-unit-test-docker.sh from the openbmc-build-scripts
repo with the script pointed at my pldm directory.

Change-Id: Ief825111970db2faffaf00e431bc0f43f7a11b02
Signed-off-by: Christian Geddes <crgeddes@us.ibm.com>
diff --git a/libpldm/fru.c b/libpldm/fru.c
index 13d14e8..242fc28 100644
--- a/libpldm/fru.c
+++ b/libpldm/fru.c
@@ -4,12 +4,17 @@
 #include "fru.h"
 
 int encode_get_fru_record_table_metadata_req(uint8_t instance_id,
-					     struct pldm_msg *msg)
+					     struct pldm_msg *msg,
+					     size_t payload_length)
 {
 	if (msg == NULL) {
 		return PLDM_ERROR_INVALID_DATA;
 	}
 
+	if (payload_length != PLDM_GET_FRU_RECORD_TABLE_METADATA_REQ_BYTES) {
+		return PLDM_ERROR_INVALID_LENGTH;
+	}
+
 	struct pldm_header_info header = {0};
 	header.instance = instance_id;
 	header.msg_type = PLDM_REQUEST;
@@ -19,6 +24,7 @@
 	if (PLDM_SUCCESS != rc) {
 		return rc;
 	}
+
 	return PLDM_SUCCESS;
 }