diff --git a/libpldm/meson.build b/libpldm/meson.build
index eed73b0..9c719d3 100644
--- a/libpldm/meson.build
+++ b/libpldm/meson.build
@@ -28,18 +28,18 @@
 
 if get_option('oem-ibm').enabled()
   headers += [
-    '../oem/ibm/libpldm/entity_oem_ibm.h',
-    '../oem/ibm/libpldm/file_io.h',
-    '../oem/ibm/libpldm/host.h',
-    '../oem/ibm/libpldm/platform_oem_ibm.h',
-    '../oem/ibm/libpldm/state_set_oem_ibm.h'
+    'oem/ibm/libpldm/entity_oem_ibm.h',
+    'oem/ibm/libpldm/file_io.h',
+    'oem/ibm/libpldm/host.h',
+    'oem/ibm/libpldm/platform_oem_ibm.h',
+    'oem/ibm/libpldm/state_set_oem_ibm.h'
   ]
   sources += [
-    '../oem/ibm/libpldm/file_io.c',
-    '../oem/ibm/libpldm/host.c',
-    '../oem/ibm/libpldm/platform_oem_ibm.c'
+    'oem/ibm/libpldm/file_io.c',
+    'oem/ibm/libpldm/host.c',
+    'oem/ibm/libpldm/platform_oem_ibm.c'
   ]
-  libpldm_headers += ['../oem/ibm']
+  libpldm_headers += ['oem/ibm']
 endif
 
 if get_option('requester-api').enabled()
diff --git a/libpldm/oem/ibm/libpldm/entity_oem_ibm.h b/libpldm/oem/ibm/libpldm/entity_oem_ibm.h
new file mode 100644
index 0000000..dd80f56
--- /dev/null
+++ b/libpldm/oem/ibm/libpldm/entity_oem_ibm.h
@@ -0,0 +1,17 @@
+#ifndef OEM_IBM_ENTITY_H
+#define OEM_IBM_ENTITY_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum pldm_oem_ibm_entity_id_codes {
+	PLDM_OEM_IBM_ENTITY_TPM = 24576,
+	PLDM_OEM_IBM_ENTITY_FIRMWARE_UPDATE = 24577,
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* OEM_IBM_ENTITY_H */
diff --git a/libpldm/oem/ibm/libpldm/file_io.c b/libpldm/oem/ibm/libpldm/file_io.c
new file mode 100644
index 0000000..fae3a9c
--- /dev/null
+++ b/libpldm/oem/ibm/libpldm/file_io.c
@@ -0,0 +1,1056 @@
+#include "file_io.h"
+#include <endian.h>
+#include <string.h>
+
+int decode_rw_file_memory_req(const struct pldm_msg *msg, size_t payload_length,
+			      uint32_t *file_handle, uint32_t *offset,
+			      uint32_t *length, uint64_t *address)
+{
+	if (msg == NULL || file_handle == NULL || offset == NULL ||
+	    length == NULL || address == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	if (payload_length != PLDM_RW_FILE_MEM_REQ_BYTES) {
+		return PLDM_ERROR_INVALID_LENGTH;
+	}
+
+	struct pldm_read_write_file_memory_req *request =
+	    (struct pldm_read_write_file_memory_req *)msg->payload;
+
+	*file_handle = le32toh(request->file_handle);
+	*offset = le32toh(request->offset);
+	*length = le32toh(request->length);
+	*address = le64toh(request->address);
+
+	return PLDM_SUCCESS;
+}
+
+int encode_rw_file_memory_resp(uint8_t instance_id, uint8_t command,
+			       uint8_t completion_code, uint32_t length,
+			       struct pldm_msg *msg)
+{
+	if (msg == NULL) {
+		return PLDM_ERROR_INVALID_LENGTH;
+	}
+
+	struct pldm_header_info header = {0};
+	header.msg_type = PLDM_RESPONSE;
+	header.instance = instance_id;
+	header.pldm_type = PLDM_OEM;
+	header.command = command;
+	uint8_t rc = pack_pldm_header(&header, &(msg->hdr));
+	if (rc != PLDM_SUCCESS) {
+		return rc;
+	}
+
+	struct pldm_read_write_file_memory_resp *response =
+	    (struct pldm_read_write_file_memory_resp *)msg->payload;
+	response->completion_code = completion_code;
+	if (response->completion_code == PLDM_SUCCESS) {
+		response->length = htole32(length);
+	}
+
+	return PLDM_SUCCESS;
+}
+
+int encode_rw_file_memory_req(uint8_t instance_id, uint8_t command,
+			      uint32_t file_handle, uint32_t offset,
+			      uint32_t length, uint64_t address,
+			      struct pldm_msg *msg)
+{
+	if (msg == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	struct pldm_header_info header = {0};
+	header.msg_type = PLDM_REQUEST;
+	header.instance = instance_id;
+	header.pldm_type = PLDM_OEM;
+	header.command = command;
+	uint8_t rc = pack_pldm_header(&header, &(msg->hdr));
+	if (rc != PLDM_SUCCESS) {
+		return rc;
+	}
+
+	struct pldm_read_write_file_memory_req *req =
+	    (struct pldm_read_write_file_memory_req *)msg->payload;
+	req->file_handle = htole32(file_handle);
+	req->offset = htole32(offset);
+	req->length = htole32(length);
+	req->address = htole64(address);
+	return PLDM_SUCCESS;
+}
+
+int decode_rw_file_memory_resp(const struct pldm_msg *msg,
+			       size_t payload_length, uint8_t *completion_code,
+			       uint32_t *length)
+{
+	if (msg == NULL || length == NULL || completion_code == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	if (payload_length != PLDM_RW_FILE_MEM_RESP_BYTES) {
+		return PLDM_ERROR_INVALID_LENGTH;
+	}
+
+	struct pldm_read_write_file_memory_resp *response =
+	    (struct pldm_read_write_file_memory_resp *)msg->payload;
+	*completion_code = response->completion_code;
+	if (*completion_code == PLDM_SUCCESS) {
+		*length = le32toh(response->length);
+	}
+
+	return PLDM_SUCCESS;
+}
+
+int decode_get_file_table_req(const struct pldm_msg *msg, size_t payload_length,
+			      uint32_t *transfer_handle,
+			      uint8_t *transfer_opflag, uint8_t *table_type)
+{
+	if (msg == NULL || transfer_handle == NULL || transfer_opflag == NULL ||
+	    table_type == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	if (payload_length != PLDM_GET_FILE_TABLE_REQ_BYTES) {
+		return PLDM_ERROR_INVALID_LENGTH;
+	}
+
+	struct pldm_get_file_table_req *request =
+	    (struct pldm_get_file_table_req *)msg->payload;
+
+	*transfer_handle = le32toh(request->transfer_handle);
+	*transfer_opflag = request->operation_flag;
+	*table_type = request->table_type;
+
+	return PLDM_SUCCESS;
+}
+
+int encode_get_file_table_resp(uint8_t instance_id, uint8_t completion_code,
+			       uint32_t next_transfer_handle,
+			       uint8_t transfer_flag, const uint8_t *table_data,
+			       size_t table_size, struct pldm_msg *msg)
+{
+	if (msg == NULL) {
+		return PLDM_ERROR_INVALID_LENGTH;
+	}
+
+	struct pldm_header_info header = {0};
+	header.msg_type = PLDM_RESPONSE;
+	header.instance = instance_id;
+	header.pldm_type = PLDM_OEM;
+	header.command = PLDM_GET_FILE_TABLE;
+	uint8_t rc = pack_pldm_header(&header, &(msg->hdr));
+	if (rc != PLDM_SUCCESS) {
+		return rc;
+	}
+
+	struct pldm_get_file_table_resp *response =
+	    (struct pldm_get_file_table_resp *)msg->payload;
+	response->completion_code = completion_code;
+
+	if (completion_code == PLDM_SUCCESS) {
+		response->next_transfer_handle = htole32(next_transfer_handle);
+		response->transfer_flag = transfer_flag;
+		memcpy(response->table_data, table_data, table_size);
+	}
+
+	return PLDM_SUCCESS;
+}
+
+int encode_get_file_table_req(uint8_t instance_id, uint32_t transfer_handle,
+			      uint8_t transfer_opflag, uint8_t table_type,
+			      struct pldm_msg *msg)
+{
+	if (msg == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	struct pldm_header_info header = {0};
+	header.msg_type = PLDM_REQUEST;
+	header.instance = instance_id;
+	header.pldm_type = PLDM_OEM;
+	header.command = PLDM_GET_FILE_TABLE;
+	uint8_t rc = pack_pldm_header(&header, &(msg->hdr));
+	if (rc != PLDM_SUCCESS) {
+		return rc;
+	}
+
+	struct pldm_get_file_table_req *request =
+	    (struct pldm_get_file_table_req *)msg->payload;
+
+	request->transfer_handle = htole32(transfer_handle);
+	request->operation_flag = transfer_opflag;
+	request->table_type = table_type;
+	return PLDM_SUCCESS;
+}
+
+int decode_get_file_table_resp(const struct pldm_msg *msg,
+			       size_t payload_length, uint8_t *completion_code,
+			       uint32_t *next_transfer_handle,
+			       uint8_t *transfer_flag,
+			       uint8_t *file_table_data_start_offset,
+			       size_t *file_table_length)
+{
+	if (msg == NULL || transfer_flag == NULL ||
+	    next_transfer_handle == NULL || completion_code == NULL ||
+	    file_table_data_start_offset == NULL || file_table_length == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	if (payload_length <= PLDM_GET_FILE_TABLE_MIN_RESP_BYTES) {
+		return PLDM_ERROR_INVALID_LENGTH;
+	}
+
+	*completion_code = msg->payload[0];
+
+	if (PLDM_SUCCESS != *completion_code) {
+		return PLDM_SUCCESS;
+	}
+
+	struct pldm_get_file_table_resp *response =
+	    (struct pldm_get_file_table_resp *)msg->payload;
+
+	*next_transfer_handle = le32toh(response->next_transfer_handle);
+	*transfer_flag = response->transfer_flag;
+	*file_table_data_start_offset = sizeof(*completion_code) +
+					sizeof(*next_transfer_handle) +
+					sizeof(*transfer_flag);
+	*file_table_length =
+	    payload_length - PLDM_GET_FILE_TABLE_MIN_RESP_BYTES;
+
+	return PLDM_SUCCESS;
+}
+
+int decode_read_file_req(const struct pldm_msg *msg, size_t payload_length,
+			 uint32_t *file_handle, uint32_t *offset,
+			 uint32_t *length)
+{
+	if (msg == NULL || file_handle == NULL || offset == NULL ||
+	    length == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	if (payload_length != PLDM_READ_FILE_REQ_BYTES) {
+		return PLDM_ERROR_INVALID_LENGTH;
+	}
+
+	struct pldm_read_file_req *request =
+	    (struct pldm_read_file_req *)msg->payload;
+
+	*file_handle = le32toh(request->file_handle);
+	*offset = le32toh(request->offset);
+	*length = le32toh(request->length);
+
+	return PLDM_SUCCESS;
+}
+
+int encode_read_file_req(uint8_t instance_id, uint32_t file_handle,
+			 uint32_t offset, uint32_t length, struct pldm_msg *msg)
+{
+	if (msg == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	if (length == 0) {
+		return PLDM_ERROR_INVALID_LENGTH;
+	}
+
+	struct pldm_header_info header = {0};
+	header.msg_type = PLDM_REQUEST;
+	header.instance = instance_id;
+	header.pldm_type = PLDM_OEM;
+	header.command = PLDM_READ_FILE;
+	uint8_t rc = pack_pldm_header(&header, &(msg->hdr));
+	if (rc != PLDM_SUCCESS) {
+		return rc;
+	}
+
+	struct pldm_read_file_req *request =
+	    (struct pldm_read_file_req *)msg->payload;
+
+	request->file_handle = htole32(file_handle);
+	request->offset = htole32(offset);
+	request->length = htole32(length);
+
+	return PLDM_SUCCESS;
+}
+
+int decode_read_file_resp(const struct pldm_msg *msg, size_t payload_length,
+			  uint8_t *completion_code, uint32_t *length,
+			  size_t *file_data_offset)
+{
+	if (msg == NULL || completion_code == NULL || length == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	if (payload_length < PLDM_READ_FILE_RESP_BYTES) {
+		return PLDM_ERROR_INVALID_LENGTH;
+	}
+
+	struct pldm_read_file_resp *response =
+	    (struct pldm_read_file_resp *)msg->payload;
+
+	*completion_code = response->completion_code;
+	if (*completion_code == PLDM_SUCCESS) {
+		*length = le32toh(response->length);
+		if (payload_length != PLDM_READ_FILE_RESP_BYTES + *length) {
+			return PLDM_ERROR_INVALID_LENGTH;
+		}
+		*file_data_offset = sizeof(*completion_code) + sizeof(*length);
+	}
+
+	return PLDM_SUCCESS;
+}
+
+int encode_read_file_resp(uint8_t instance_id, uint8_t completion_code,
+			  uint32_t length, struct pldm_msg *msg)
+{
+	if (msg == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	struct pldm_header_info header = {0};
+	header.msg_type = PLDM_RESPONSE;
+	header.instance = instance_id;
+	header.pldm_type = PLDM_OEM;
+	header.command = PLDM_READ_FILE;
+	uint8_t rc = pack_pldm_header(&header, &(msg->hdr));
+	if (rc != PLDM_SUCCESS) {
+		return rc;
+	}
+
+	struct pldm_read_file_resp *response =
+	    (struct pldm_read_file_resp *)msg->payload;
+	response->completion_code = completion_code;
+
+	if (response->completion_code == PLDM_SUCCESS) {
+		response->length = htole32(length);
+	}
+
+	return PLDM_SUCCESS;
+}
+
+int decode_write_file_req(const struct pldm_msg *msg, size_t payload_length,
+			  uint32_t *file_handle, uint32_t *offset,
+			  uint32_t *length, size_t *file_data_offset)
+{
+	if (msg == NULL || file_handle == NULL || length == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	if (payload_length < PLDM_WRITE_FILE_REQ_BYTES) {
+		return PLDM_ERROR_INVALID_LENGTH;
+	}
+
+	struct pldm_write_file_req *request =
+	    (struct pldm_write_file_req *)msg->payload;
+
+	*file_handle = le32toh(request->file_handle);
+	*offset = le32toh(request->offset);
+	*length = le32toh(request->length);
+	if (payload_length != PLDM_WRITE_FILE_REQ_BYTES + *length) {
+		return PLDM_ERROR_INVALID_LENGTH;
+	}
+	*file_data_offset =
+	    sizeof(*file_handle) + sizeof(*offset) + sizeof(*length);
+
+	return PLDM_SUCCESS;
+}
+
+int encode_write_file_req(uint8_t instance_id, uint32_t file_handle,
+			  uint32_t offset, uint32_t length,
+			  struct pldm_msg *msg)
+{
+	if (msg == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	if (length == 0) {
+		return PLDM_ERROR_INVALID_LENGTH;
+	}
+
+	struct pldm_header_info header = {0};
+	header.msg_type = PLDM_REQUEST;
+	header.instance = instance_id;
+	header.pldm_type = PLDM_OEM;
+	header.command = PLDM_WRITE_FILE;
+	uint8_t rc = pack_pldm_header(&header, &(msg->hdr));
+	if (rc != PLDM_SUCCESS) {
+		return rc;
+	}
+
+	struct pldm_write_file_req *request =
+	    (struct pldm_write_file_req *)msg->payload;
+
+	request->file_handle = htole32(file_handle);
+	request->offset = htole32(offset);
+	request->length = htole32(length);
+
+	return PLDM_SUCCESS;
+}
+
+int decode_write_file_resp(const struct pldm_msg *msg, size_t payload_length,
+			   uint8_t *completion_code, uint32_t *length)
+{
+	if (msg == NULL || completion_code == NULL || length == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	if (payload_length != PLDM_WRITE_FILE_RESP_BYTES) {
+		return PLDM_ERROR_INVALID_LENGTH;
+	}
+
+	struct pldm_write_file_resp *response =
+	    (struct pldm_write_file_resp *)msg->payload;
+
+	*completion_code = le32toh(response->completion_code);
+	if (response->completion_code == PLDM_SUCCESS) {
+		*length = le32toh(response->length);
+	}
+
+	return PLDM_SUCCESS;
+}
+
+int encode_write_file_resp(uint8_t instance_id, uint8_t completion_code,
+			   uint32_t length, struct pldm_msg *msg)
+{
+	if (msg == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	struct pldm_header_info header = {0};
+	header.msg_type = PLDM_RESPONSE;
+	header.instance = instance_id;
+	header.pldm_type = PLDM_OEM;
+	header.command = PLDM_WRITE_FILE;
+	uint8_t rc = pack_pldm_header(&header, &(msg->hdr));
+	if (rc != PLDM_SUCCESS) {
+		return rc;
+	}
+
+	struct pldm_write_file_resp *response =
+	    (struct pldm_write_file_resp *)msg->payload;
+	response->completion_code = completion_code;
+
+	if (response->completion_code == PLDM_SUCCESS) {
+		response->length = htole32(length);
+	}
+
+	return PLDM_SUCCESS;
+}
+
+int decode_rw_file_by_type_memory_req(const struct pldm_msg *msg,
+				      size_t payload_length,
+				      uint16_t *file_type,
+				      uint32_t *file_handle, uint32_t *offset,
+				      uint32_t *length, uint64_t *address)
+{
+	if (msg == NULL || file_type == NULL || file_handle == NULL ||
+	    offset == NULL || length == NULL || address == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	if (payload_length != PLDM_RW_FILE_BY_TYPE_MEM_REQ_BYTES) {
+		return PLDM_ERROR_INVALID_LENGTH;
+	}
+
+	struct pldm_read_write_file_by_type_memory_req *request =
+	    (struct pldm_read_write_file_by_type_memory_req *)msg->payload;
+	*file_type = le16toh(request->file_type);
+	*file_handle = le32toh(request->file_handle);
+	*offset = le32toh(request->offset);
+	*length = le32toh(request->length);
+	*address = le64toh(request->address);
+
+	return PLDM_SUCCESS;
+}
+
+int encode_rw_file_by_type_memory_resp(uint8_t instance_id, uint8_t command,
+				       uint8_t completion_code, uint32_t length,
+				       struct pldm_msg *msg)
+{
+	if (msg == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	struct pldm_header_info header = {0};
+	header.msg_type = PLDM_RESPONSE;
+	header.instance = instance_id;
+	header.pldm_type = PLDM_OEM;
+	header.command = command;
+	uint8_t rc = pack_pldm_header(&header, &(msg->hdr));
+	if (rc != PLDM_SUCCESS) {
+		return rc;
+	}
+
+	struct pldm_read_write_file_by_type_memory_resp *response =
+	    (struct pldm_read_write_file_by_type_memory_resp *)msg->payload;
+	response->completion_code = completion_code;
+	if (response->completion_code == PLDM_SUCCESS) {
+		response->length = htole32(length);
+	}
+
+	return PLDM_SUCCESS;
+}
+
+int encode_rw_file_by_type_memory_req(uint8_t instance_id, uint8_t command,
+				      uint16_t file_type, uint32_t file_handle,
+				      uint32_t offset, uint32_t length,
+				      uint64_t address, struct pldm_msg *msg)
+{
+	if (msg == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	struct pldm_header_info header = {0};
+	header.msg_type = PLDM_REQUEST;
+	header.instance = instance_id;
+	header.pldm_type = PLDM_OEM;
+	header.command = command;
+	uint8_t rc = pack_pldm_header(&header, &(msg->hdr));
+	if (rc != PLDM_SUCCESS) {
+		return rc;
+	}
+
+	struct pldm_read_write_file_by_type_memory_req *req =
+	    (struct pldm_read_write_file_by_type_memory_req *)msg->payload;
+	req->file_type = htole16(file_type);
+	req->file_handle = htole32(file_handle);
+	req->offset = htole32(offset);
+	req->length = htole32(length);
+	req->address = htole64(address);
+
+	return PLDM_SUCCESS;
+}
+
+int decode_rw_file_by_type_memory_resp(const struct pldm_msg *msg,
+				       size_t payload_length,
+				       uint8_t *completion_code,
+				       uint32_t *length)
+{
+	if (msg == NULL || length == NULL || completion_code == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	if (payload_length != PLDM_RW_FILE_BY_TYPE_MEM_RESP_BYTES) {
+		return PLDM_ERROR_INVALID_LENGTH;
+	}
+
+	struct pldm_read_write_file_by_type_memory_resp *response =
+	    (struct pldm_read_write_file_by_type_memory_resp *)msg->payload;
+	*completion_code = response->completion_code;
+	if (*completion_code == PLDM_SUCCESS) {
+		*length = le32toh(response->length);
+	}
+
+	return PLDM_SUCCESS;
+}
+
+int decode_new_file_req(const struct pldm_msg *msg, size_t payload_length,
+			uint16_t *file_type, uint32_t *file_handle,
+			uint64_t *length)
+{
+	if (msg == NULL || file_type == NULL || file_handle == NULL ||
+	    length == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	if (payload_length != PLDM_NEW_FILE_REQ_BYTES) {
+		return PLDM_ERROR_INVALID_LENGTH;
+	}
+
+	struct pldm_new_file_req *request =
+	    (struct pldm_new_file_req *)msg->payload;
+	*file_type = le16toh(request->file_type);
+	*file_handle = le32toh(request->file_handle);
+	*length = le64toh(request->length);
+
+	return PLDM_SUCCESS;
+}
+
+int encode_new_file_resp(uint8_t instance_id, uint8_t completion_code,
+			 struct pldm_msg *msg)
+{
+	if (msg == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	struct pldm_header_info header = {0};
+	header.msg_type = PLDM_RESPONSE;
+	header.instance = instance_id;
+	header.pldm_type = PLDM_OEM;
+	header.command = PLDM_NEW_FILE_AVAILABLE;
+	uint8_t rc = pack_pldm_header(&header, &(msg->hdr));
+	if (rc != PLDM_SUCCESS) {
+		return rc;
+	}
+
+	struct pldm_new_file_resp *response =
+	    (struct pldm_new_file_resp *)msg->payload;
+	response->completion_code = completion_code;
+
+	return PLDM_SUCCESS;
+}
+
+int encode_new_file_req(uint8_t instance_id, uint16_t file_type,
+			uint32_t file_handle, uint64_t length,
+			struct pldm_msg *msg)
+{
+	if (msg == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	struct pldm_header_info header = {0};
+	header.msg_type = PLDM_REQUEST;
+	header.instance = instance_id;
+	header.pldm_type = PLDM_OEM;
+	header.command = PLDM_NEW_FILE_AVAILABLE;
+	uint8_t rc = pack_pldm_header(&header, &(msg->hdr));
+	if (rc != PLDM_SUCCESS) {
+		return rc;
+	}
+
+	struct pldm_new_file_req *req =
+	    (struct pldm_new_file_req *)msg->payload;
+	req->file_type = htole16(file_type);
+	req->file_handle = htole32(file_handle);
+	req->length = htole64(length);
+
+	return PLDM_SUCCESS;
+}
+
+int decode_new_file_resp(const struct pldm_msg *msg, size_t payload_length,
+			 uint8_t *completion_code)
+{
+	if (msg == NULL || completion_code == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	if (payload_length != PLDM_NEW_FILE_RESP_BYTES) {
+		return PLDM_ERROR_INVALID_LENGTH;
+	}
+
+	struct pldm_new_file_resp *response =
+	    (struct pldm_new_file_resp *)msg->payload;
+	*completion_code = response->completion_code;
+
+	return PLDM_SUCCESS;
+}
+
+int decode_rw_file_by_type_req(const struct pldm_msg *msg,
+			       size_t payload_length, uint16_t *file_type,
+			       uint32_t *file_handle, uint32_t *offset,
+			       uint32_t *length)
+{
+	if (msg == NULL || file_type == NULL || file_handle == NULL ||
+	    offset == NULL || length == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	if (payload_length < PLDM_RW_FILE_BY_TYPE_REQ_BYTES) {
+		return PLDM_ERROR_INVALID_LENGTH;
+	}
+
+	struct pldm_read_write_file_by_type_req *request =
+	    (struct pldm_read_write_file_by_type_req *)msg->payload;
+	*file_type = le16toh(request->file_type);
+	*file_handle = le32toh(request->file_handle);
+	*offset = le32toh(request->offset);
+	*length = le32toh(request->length);
+
+	return PLDM_SUCCESS;
+}
+
+int encode_rw_file_by_type_resp(uint8_t instance_id, uint8_t command,
+				uint8_t completion_code, uint32_t length,
+				struct pldm_msg *msg)
+{
+	if (msg == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+	if (command != PLDM_READ_FILE_BY_TYPE &&
+	    command != PLDM_WRITE_FILE_BY_TYPE) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	struct pldm_header_info header = {0};
+	header.msg_type = PLDM_RESPONSE;
+	header.instance = instance_id;
+	header.pldm_type = PLDM_OEM;
+	header.command = command;
+	uint8_t rc = pack_pldm_header(&header, &(msg->hdr));
+	if (rc != PLDM_SUCCESS) {
+		return rc;
+	}
+
+	struct pldm_read_write_file_by_type_resp *response =
+	    (struct pldm_read_write_file_by_type_resp *)msg->payload;
+	response->completion_code = completion_code;
+	if (response->completion_code == PLDM_SUCCESS) {
+		response->length = htole32(length);
+	}
+
+	return PLDM_SUCCESS;
+}
+
+int encode_rw_file_by_type_req(uint8_t instance_id, uint8_t command,
+			       uint16_t file_type, uint32_t file_handle,
+			       uint32_t offset, uint32_t length,
+			       struct pldm_msg *msg)
+{
+	if (msg == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+	if (command != PLDM_READ_FILE_BY_TYPE &&
+	    command != PLDM_WRITE_FILE_BY_TYPE) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	struct pldm_header_info header = {0};
+	header.msg_type = PLDM_REQUEST;
+	header.instance = instance_id;
+	header.pldm_type = PLDM_OEM;
+	header.command = command;
+	uint8_t rc = pack_pldm_header(&header, &(msg->hdr));
+	if (rc != PLDM_SUCCESS) {
+		return rc;
+	}
+
+	struct pldm_read_write_file_by_type_req *req =
+	    (struct pldm_read_write_file_by_type_req *)msg->payload;
+	req->file_type = htole16(file_type);
+	req->file_handle = htole32(file_handle);
+	req->offset = htole32(offset);
+	req->length = htole32(length);
+
+	return PLDM_SUCCESS;
+}
+
+int decode_rw_file_by_type_resp(const struct pldm_msg *msg,
+				size_t payload_length, uint8_t *completion_code,
+				uint32_t *length)
+{
+	if (msg == NULL || length == NULL || completion_code == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	if (payload_length != PLDM_RW_FILE_BY_TYPE_RESP_BYTES) {
+		return PLDM_ERROR_INVALID_LENGTH;
+	}
+
+	struct pldm_read_write_file_by_type_resp *response =
+	    (struct pldm_read_write_file_by_type_resp *)msg->payload;
+	*completion_code = response->completion_code;
+	if (*completion_code == PLDM_SUCCESS) {
+		*length = le32toh(response->length);
+	}
+
+	return PLDM_SUCCESS;
+}
+
+int decode_file_ack_req(const struct pldm_msg *msg, size_t payload_length,
+			uint16_t *file_type, uint32_t *file_handle,
+			uint8_t *file_status)
+{
+	if (msg == NULL || file_type == NULL || file_handle == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	if (payload_length != PLDM_FILE_ACK_REQ_BYTES) {
+		return PLDM_ERROR_INVALID_LENGTH;
+	}
+
+	struct pldm_file_ack_req *request =
+	    (struct pldm_file_ack_req *)msg->payload;
+	*file_type = le16toh(request->file_type);
+	*file_handle = le32toh(request->file_handle);
+	*file_status = request->file_status;
+
+	return PLDM_SUCCESS;
+}
+
+int encode_file_ack_resp(uint8_t instance_id, uint8_t completion_code,
+			 struct pldm_msg *msg)
+{
+	if (msg == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	struct pldm_header_info header = {0};
+	header.msg_type = PLDM_RESPONSE;
+	header.instance = instance_id;
+	header.pldm_type = PLDM_OEM;
+	header.command = PLDM_FILE_ACK;
+	uint8_t rc = pack_pldm_header(&header, &(msg->hdr));
+	if (rc != PLDM_SUCCESS) {
+		return rc;
+	}
+
+	struct pldm_file_ack_resp *response =
+	    (struct pldm_file_ack_resp *)msg->payload;
+	response->completion_code = completion_code;
+
+	return PLDM_SUCCESS;
+}
+
+int encode_file_ack_req(uint8_t instance_id, uint16_t file_type,
+			uint32_t file_handle, uint8_t file_status,
+			struct pldm_msg *msg)
+{
+	if (msg == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	struct pldm_header_info header = {0};
+	header.msg_type = PLDM_REQUEST;
+	header.instance = instance_id;
+	header.pldm_type = PLDM_OEM;
+	header.command = PLDM_FILE_ACK;
+	uint8_t rc = pack_pldm_header(&header, &(msg->hdr));
+	if (rc != PLDM_SUCCESS) {
+		return rc;
+	}
+
+	struct pldm_file_ack_req *req =
+	    (struct pldm_file_ack_req *)msg->payload;
+	req->file_type = htole16(file_type);
+	req->file_handle = htole32(file_handle);
+	req->file_status = file_status;
+
+	return PLDM_SUCCESS;
+}
+
+int decode_file_ack_resp(const struct pldm_msg *msg, size_t payload_length,
+			 uint8_t *completion_code)
+{
+	if (msg == NULL || completion_code == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	if (payload_length != PLDM_FILE_ACK_RESP_BYTES) {
+		return PLDM_ERROR_INVALID_LENGTH;
+	}
+
+	struct pldm_file_ack_resp *response =
+	    (struct pldm_file_ack_resp *)msg->payload;
+	*completion_code = response->completion_code;
+
+	return PLDM_SUCCESS;
+}
+
+int encode_file_ack_with_meta_data_req(
+    uint8_t instance_id, uint16_t file_type, uint32_t file_handle,
+    uint8_t file_status, uint32_t file_meta_data_1, uint32_t file_meta_data_2,
+    uint32_t file_meta_data_3, uint32_t file_meta_data_4, struct pldm_msg *msg)
+{
+	if (msg == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	struct pldm_header_info header = {0};
+	header.msg_type = PLDM_REQUEST;
+	header.instance = instance_id;
+	header.pldm_type = PLDM_OEM;
+	header.command = PLDM_FILE_ACK_WITH_META_DATA;
+	uint8_t rc = pack_pldm_header(&header, &(msg->hdr));
+	if (rc != PLDM_SUCCESS) {
+		return rc;
+	}
+
+	struct pldm_file_ack_with_meta_data_req *req =
+	    (struct pldm_file_ack_with_meta_data_req *)msg->payload;
+	req->file_type = htole16(file_type);
+	req->file_handle = htole32(file_handle);
+	req->file_status = file_status;
+	req->file_meta_data_1 = htole32(file_meta_data_1);
+	req->file_meta_data_2 = htole32(file_meta_data_2);
+	req->file_meta_data_3 = htole32(file_meta_data_3);
+	req->file_meta_data_4 = htole32(file_meta_data_4);
+
+	return PLDM_SUCCESS;
+}
+
+int decode_file_ack_with_meta_data_resp(const struct pldm_msg *msg,
+					size_t payload_length,
+					uint8_t *completion_code)
+{
+	if (msg == NULL || completion_code == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	if (payload_length != PLDM_FILE_ACK_WITH_META_DATA_RESP_BYTES) {
+		return PLDM_ERROR_INVALID_LENGTH;
+	}
+
+	struct pldm_file_ack_with_meta_data_resp *response =
+	    (struct pldm_file_ack_with_meta_data_resp *)msg->payload;
+	*completion_code = response->completion_code;
+
+	return PLDM_SUCCESS;
+}
+
+int decode_file_ack_with_meta_data_req(
+    const struct pldm_msg *msg, size_t payload_length, uint16_t *file_type,
+    uint32_t *file_handle, uint8_t *file_status, uint32_t *file_meta_data_1,
+    uint32_t *file_meta_data_2, uint32_t *file_meta_data_3,
+    uint32_t *file_meta_data_4)
+{
+	if (msg == NULL || file_type == NULL || file_handle == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	if (payload_length != PLDM_FILE_ACK_WITH_META_DATA_REQ_BYTES) {
+		return PLDM_ERROR_INVALID_LENGTH;
+	}
+
+	struct pldm_file_ack_with_meta_data_req *request =
+	    (struct pldm_file_ack_with_meta_data_req *)msg->payload;
+	*file_type = le16toh(request->file_type);
+	*file_handle = le32toh(request->file_handle);
+	*file_status = request->file_status;
+	*file_meta_data_1 = le32toh(request->file_meta_data_1);
+	*file_meta_data_2 = le32toh(request->file_meta_data_2);
+	*file_meta_data_3 = le32toh(request->file_meta_data_3);
+	*file_meta_data_4 = le32toh(request->file_meta_data_4);
+
+	return PLDM_SUCCESS;
+}
+
+int encode_file_ack_with_meta_data_resp(uint8_t instance_id,
+					uint8_t completion_code,
+					struct pldm_msg *msg)
+{
+	if (msg == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	struct pldm_header_info header = {0};
+	header.msg_type = PLDM_RESPONSE;
+	header.instance = instance_id;
+	header.pldm_type = PLDM_OEM;
+	header.command = PLDM_FILE_ACK_WITH_META_DATA;
+	uint8_t rc = pack_pldm_header(&header, &(msg->hdr));
+	if (rc != PLDM_SUCCESS) {
+		return rc;
+	}
+
+	struct pldm_file_ack_with_meta_data_resp *response =
+	    (struct pldm_file_ack_with_meta_data_resp *)msg->payload;
+	response->completion_code = completion_code;
+
+	return PLDM_SUCCESS;
+}
+
+int encode_new_file_with_metadata_req(
+    uint8_t instance_id, uint16_t file_type, uint32_t file_handle,
+    uint64_t length, uint32_t file_meta_data_1, uint32_t file_meta_data_2,
+    uint32_t file_meta_data_3, uint32_t file_meta_data_4, struct pldm_msg *msg)
+{
+	if (msg == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	struct pldm_header_info header = {0};
+	header.msg_type = PLDM_REQUEST;
+	header.instance = instance_id;
+	header.pldm_type = PLDM_OEM;
+	header.command = PLDM_NEW_FILE_AVAILABLE_WITH_META_DATA;
+	uint8_t rc = pack_pldm_header(&header, &(msg->hdr));
+	if (rc != PLDM_SUCCESS) {
+		return rc;
+	}
+
+	struct pldm_new_file_with_metadata_req *req =
+	    (struct pldm_new_file_with_metadata_req *)msg->payload;
+	req->file_type = htole16(file_type);
+	req->file_handle = htole32(file_handle);
+	req->length = htole64(length);
+	req->file_meta_data_1 = htole32(file_meta_data_1);
+	req->file_meta_data_2 = htole32(file_meta_data_2);
+	req->file_meta_data_3 = htole32(file_meta_data_3);
+	req->file_meta_data_4 = htole32(file_meta_data_4);
+
+	return PLDM_SUCCESS;
+}
+
+int decode_new_file_with_metadata_resp(const struct pldm_msg *msg,
+				       size_t payload_length,
+				       uint8_t *completion_code)
+{
+	if (msg == NULL || completion_code == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	if (payload_length !=
+	    PLDM_NEW_FILE_AVAILABLE_WITH_META_DATA_RESP_BYTES) {
+		return PLDM_ERROR_INVALID_LENGTH;
+	}
+
+	struct pldm_new_file_with_metadata_resp *response =
+	    (struct pldm_new_file_with_metadata_resp *)msg->payload;
+
+	*completion_code = msg->payload[0];
+	if (*completion_code == PLDM_SUCCESS) {
+		*completion_code = response->completion_code;
+	}
+	return PLDM_SUCCESS;
+}
+
+int decode_new_file_with_metadata_req(
+    const struct pldm_msg *msg, size_t payload_length, uint16_t *file_type,
+    uint32_t *file_handle, uint64_t *length, uint32_t *file_meta_data_1,
+    uint32_t *file_meta_data_2, uint32_t *file_meta_data_3,
+    uint32_t *file_meta_data_4)
+{
+	if (msg == NULL || file_type == NULL || file_handle == NULL ||
+	    length == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	if (payload_length !=
+	    PLDM_NEW_FILE_AVAILABLE_WITH_META_DATA_REQ_BYTES) {
+		return PLDM_ERROR_INVALID_LENGTH;
+	}
+
+	struct pldm_new_file_with_metadata_req *request =
+	    (struct pldm_new_file_with_metadata_req *)msg->payload;
+	*file_type = le16toh(request->file_type);
+	*file_handle = le32toh(request->file_handle);
+	*length = le64toh(request->length);
+	*file_meta_data_1 = le32toh(request->file_meta_data_1);
+	*file_meta_data_2 = le32toh(request->file_meta_data_2);
+	*file_meta_data_3 = le32toh(request->file_meta_data_3);
+	*file_meta_data_4 = le32toh(request->file_meta_data_4);
+
+	return PLDM_SUCCESS;
+}
+
+int encode_new_file_with_metadata_resp(uint8_t instance_id,
+				       uint8_t completion_code,
+				       struct pldm_msg *msg)
+{
+	if (msg == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	struct pldm_header_info header = {0};
+	header.msg_type = PLDM_RESPONSE;
+	header.instance = instance_id;
+	header.pldm_type = PLDM_OEM;
+	header.command = PLDM_NEW_FILE_AVAILABLE_WITH_META_DATA;
+	uint8_t rc = pack_pldm_header(&header, &(msg->hdr));
+	if (rc != PLDM_SUCCESS) {
+		return rc;
+	}
+
+	struct pldm_new_file_with_metadata_resp *response =
+	    (struct pldm_new_file_with_metadata_resp *)msg->payload;
+
+	if (response->completion_code == PLDM_SUCCESS) {
+		response->completion_code = completion_code;
+	}
+
+	return PLDM_SUCCESS;
+}
diff --git a/libpldm/oem/ibm/libpldm/file_io.h b/libpldm/oem/ibm/libpldm/file_io.h
new file mode 100644
index 0000000..e5765a6
--- /dev/null
+++ b/libpldm/oem/ibm/libpldm/file_io.h
@@ -0,0 +1,899 @@
+#ifndef FILEIO_H
+#define FILEIO_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stddef.h>
+#include <stdint.h>
+
+#include "base.h"
+
+/** @brief PLDM Commands in IBM OEM type
+ */
+enum pldm_fileio_commands {
+	PLDM_GET_FILE_TABLE = 0x1,
+	PLDM_READ_FILE = 0x4,
+	PLDM_WRITE_FILE = 0x5,
+	PLDM_READ_FILE_INTO_MEMORY = 0x6,
+	PLDM_WRITE_FILE_FROM_MEMORY = 0x7,
+	PLDM_READ_FILE_BY_TYPE_INTO_MEMORY = 0x8,
+	PLDM_WRITE_FILE_BY_TYPE_FROM_MEMORY = 0x9,
+	PLDM_NEW_FILE_AVAILABLE = 0xA,
+	PLDM_READ_FILE_BY_TYPE = 0xB,
+	PLDM_WRITE_FILE_BY_TYPE = 0xC,
+	PLDM_FILE_ACK = 0xD,
+	PLDM_NEW_FILE_AVAILABLE_WITH_META_DATA = 0xE,
+	PLDM_FILE_ACK_WITH_META_DATA = 0xF,
+};
+
+/** @brief PLDM Command specific codes
+ */
+enum pldm_fileio_completion_codes {
+	PLDM_FILE_TABLE_UNAVAILABLE = 0x83,
+	PLDM_INVALID_FILE_TABLE_TYPE = 0x85,
+	PLDM_INVALID_FILE_HANDLE = 0x86,
+	PLDM_DATA_OUT_OF_RANGE = 0x87,
+	PLDM_INVALID_FILE_TYPE = 0x89,
+};
+
+/** @brief PLDM File I/O table types
+ */
+enum pldm_fileio_table_type {
+	PLDM_FILE_ATTRIBUTE_TABLE = 0,
+	PLDM_OEM_FILE_ATTRIBUTE_TABLE = 1,
+};
+
+/** @brief PLDM File I/O table types
+ */
+enum pldm_fileio_file_type {
+	PLDM_FILE_TYPE_PEL = 0x0,
+	PLDM_FILE_TYPE_LID_PERM = 0x1,
+	PLDM_FILE_TYPE_LID_TEMP = 0x2,
+	PLDM_FILE_TYPE_DUMP = 0x3,
+	PLDM_FILE_TYPE_CERT_SIGNING_REQUEST = 0x4,
+	PLDM_FILE_TYPE_SIGNED_CERT = 0x5,
+	PLDM_FILE_TYPE_ROOT_CERT = 0x6,
+	PLDM_FILE_TYPE_LID_MARKER = 0x7,
+	PLDM_FILE_TYPE_RESOURCE_DUMP_PARMS = 0x8,
+	PLDM_FILE_TYPE_RESOURCE_DUMP = 0x9,
+	PLDM_FILE_TYPE_PROGRESS_SRC = 0xA,
+};
+
+#define PLDM_RW_FILE_MEM_REQ_BYTES 20
+#define PLDM_RW_FILE_MEM_RESP_BYTES 5
+#define PLDM_GET_FILE_TABLE_REQ_BYTES 6
+#define PLDM_GET_FILE_TABLE_MIN_RESP_BYTES 6
+#define PLDM_READ_FILE_REQ_BYTES 12
+#define PLDM_READ_FILE_RESP_BYTES 5
+#define PLDM_WRITE_FILE_REQ_BYTES 12
+#define PLDM_WRITE_FILE_RESP_BYTES 5
+#define PLDM_RW_FILE_BY_TYPE_MEM_REQ_BYTES 22
+#define PLDM_RW_FILE_BY_TYPE_MEM_RESP_BYTES 5
+#define PLDM_NEW_FILE_REQ_BYTES 14
+#define PLDM_NEW_FILE_RESP_BYTES 1
+#define PLDM_RW_FILE_BY_TYPE_REQ_BYTES 14
+#define PLDM_RW_FILE_BY_TYPE_RESP_BYTES 5
+#define PLDM_FILE_ACK_REQ_BYTES 7
+#define PLDM_FILE_ACK_RESP_BYTES 1
+#define PLDM_FILE_ACK_WITH_META_DATA_REQ_BYTES 23
+#define PLDM_FILE_ACK_WITH_META_DATA_RESP_BYTES 1
+#define PLDM_NEW_FILE_AVAILABLE_WITH_META_DATA_REQ_BYTES 30
+#define PLDM_NEW_FILE_AVAILABLE_WITH_META_DATA_RESP_BYTES 1
+
+/** @struct pldm_read_write_file_memory_req
+ *
+ *  Structure representing ReadFileIntoMemory request and WriteFileFromMemory
+ *  request
+ */
+struct pldm_read_write_file_memory_req {
+	uint32_t file_handle; //!< A Handle to the file
+	uint32_t offset;      //!< Offset to the file
+	uint32_t length;      //!< Number of bytes to be read/write
+	uint64_t address;     //!< Memory address of the file
+} __attribute__((packed));
+
+/** @struct pldm_read_write_file_memory_resp
+ *
+ *  Structure representing ReadFileIntoMemory response and WriteFileFromMemory
+ *  response
+ */
+struct pldm_read_write_file_memory_resp {
+	uint8_t completion_code; //!< completion code
+	uint32_t length;	 //!< Number of bytes read/written
+} __attribute__((packed));
+
+/** @brief Decode ReadFileIntoMemory and WriteFileFromMemory commands request
+ *         data
+ *
+ *  @param[in] msg - Pointer to PLDM request message
+ *  @param[in] payload_length - Length of request payload
+ *  @param[out] file_handle - A handle to the file
+ *  @param[out] offset - Offset to the file at which the read should begin
+ *  @param[out] length - Number of bytes to be read
+ *  @param[out] address - Memory address where the file content has to be
+ *                        written to
+ *  @return pldm_completion_codes
+ */
+int decode_rw_file_memory_req(const struct pldm_msg *msg, size_t payload_length,
+			      uint32_t *file_handle, uint32_t *offset,
+			      uint32_t *length, uint64_t *address);
+
+/** @brief Create a PLDM response for ReadFileIntoMemory and
+ *         WriteFileFromMemory
+ *
+ *  @param[in] instance_id - Message's instance id
+ *  @param[in] command - PLDM command
+ *  @param[in] completion_code - PLDM completion code
+ *  @param[in] length - Number of bytes read. This could be less than what the
+			 requester asked for.
+ *  @param[in,out] msg - Message will be written to this
+ *  @return pldm_completion_codes
+ *  @note  Caller is responsible for memory alloc and dealloc of param 'msg'
+ */
+int encode_rw_file_memory_resp(uint8_t instance_id, uint8_t command,
+			       uint8_t completion_code, uint32_t length,
+			       struct pldm_msg *msg);
+
+/** @brief Encode ReadFileIntoMemory and WriteFileFromMemory
+ *         commands request data
+ *
+ *  @param[in] instance_id - Message's instance id
+ *  @param[in] command - PLDM command
+ *  @param[in] file_handle - A handle to the file
+ *  @param[in] offset -  Offset to the file at which the read should begin
+ *  @param[in] length -  Number of bytes to be read/written
+ *  @param[in] address - Memory address where the file content has to be
+ *                       written to
+ *  @param[out] msg - Message will be written to this
+ *  @return pldm_completion_codes
+ */
+int encode_rw_file_memory_req(uint8_t instance_id, uint8_t command,
+			      uint32_t file_handle, uint32_t offset,
+			      uint32_t length, uint64_t address,
+			      struct pldm_msg *msg);
+
+/** @brief Decode ReadFileIntoMemory and WriteFileFromMemory
+ *         commands response data
+ *
+ *  @param[in] msg - pointer to PLDM response message
+ *  @param[in] payload_length - Length of response payload
+ *  @param[out] completion_code - PLDM completion code
+ *  @param[out] length - Number of bytes to be read/written
+ *  @return pldm_completion_codes
+ */
+int decode_rw_file_memory_resp(const struct pldm_msg *msg,
+			       size_t payload_length, uint8_t *completion_code,
+			       uint32_t *length);
+
+/** @struct pldm_get_file_table_req
+ *
+ *  Structure representing GetFileTable request
+ */
+struct pldm_get_file_table_req {
+	uint32_t transfer_handle; //!< Data transfer handle
+	uint8_t operation_flag;	  //!< Transfer operation flag
+	uint8_t table_type;	  //!< Table type
+} __attribute__((packed));
+
+/** @struct pldm_get_file_table_resp
+ *
+ *  Structure representing GetFileTable response fixed data
+ */
+struct pldm_get_file_table_resp {
+	uint8_t completion_code;       //!< Completion code
+	uint32_t next_transfer_handle; //!< Next data transfer handle
+	uint8_t transfer_flag;	       //!< Transfer flag
+	uint8_t table_data[1];	       //!< Table Data
+} __attribute__((packed));
+
+/** @struct pldm_file_attr_table_entry
+ *
+ * Structure representing File attribute table entry
+ */
+struct pldm_file_attr_table_entry {
+	uint32_t file_handle;		//!< File Handle
+	uint16_t file_name_length;	//!< File name length
+	uint8_t file_attr_table_nst[1]; //!< File name size traits
+} __attribute__((packed));
+
+/** @brief Decode GetFileTable command request data
+ *
+ *  @param[in] msg - Pointer to PLDM request message
+ *  @param[in] payload_length - Length of request payload
+ *  @param[out] trasnfer_handle - the handle of data
+ *  @param[out] transfer_opflag - Transfer operation flag
+ *  @param[out] table_type - the type of file table
+ *  @return pldm_completion_codes
+ */
+int decode_get_file_table_req(const struct pldm_msg *msg, size_t payload_length,
+			      uint32_t *transfer_handle,
+			      uint8_t *transfer_opflag, uint8_t *table_type);
+
+/** @brief Create a PLDM response for GetFileTable command
+ *
+ *  @param[in] instance_id - Message's instance id
+ *  @param[in] completion_code - PLDM completion code
+ *  @param[in] next_transfer_handle - Handle to identify next portion of
+ *              data transfer
+ *  @param[in] transfer_flag - Represents the part of transfer
+ *  @param[in] table_data - pointer to file table data
+ *  @param[in] table_size - file table size
+ *  @param[in,out] msg - Message will be written to this
+ *  @return pldm_completion_codes
+ *  @note  Caller is responsible for memory alloc and dealloc of param 'msg'
+ */
+int encode_get_file_table_resp(uint8_t instance_id, uint8_t completion_code,
+			       uint32_t next_transfer_handle,
+			       uint8_t transfer_flag, const uint8_t *table_data,
+			       size_t table_size, struct pldm_msg *msg);
+
+/** @brief Encode GetFileTable command request data
+ *
+ * @param[in] instance_id - Message's instance id
+ * @param[in] transfer_handle - the handle of data
+ * @param[in] transfer_opflag - Transfer operation flag
+ * @param[in] table_type - the type of file table
+ * @param[out] msg - Message will be written to this
+ * @return pldm_completion_codes
+ */
+int encode_get_file_table_req(uint8_t instance_id, uint32_t transfer_handle,
+			      uint8_t transfer_opflag, uint8_t table_type,
+			      struct pldm_msg *msg);
+
+/** @brief Decode GetFileTable command response data
+ * @param[in] msg - Response message
+ * @param[in] payload_length - length of response message payload
+ * @param[out] completion_code - PLDM completion code
+ * @param[out] next_transfer_handle -  Handle to identify next portion of data
+ * transfer
+ * @param[out] transfer_flag - Represents the part of transfer
+ * @param[out] file_table_data_start_offset - This data is a portion of the
+ * overall File Table
+ * @param[out] file_table_length - Length of the File table data
+ * @return pldm_completion_codes
+ */
+int decode_get_file_table_resp(const struct pldm_msg *msg,
+			       size_t payload_length, uint8_t *completion_code,
+			       uint32_t *next_transfer_handle,
+			       uint8_t *transfer_flag,
+			       uint8_t *file_table_data_start_offset,
+			       size_t *file_table_length);
+
+/** @struct pldm_read_file_req
+ *
+ *  Structure representing ReadFile request
+ */
+struct pldm_read_file_req {
+	uint32_t file_handle; //!< Handle to file
+	uint32_t offset;      //!< Offset to file where read starts
+	uint32_t length;      //!< Bytes to be read
+} __attribute__((packed));
+
+/** @struct pldm_read_file_resp
+ *
+ *  Structure representing ReadFile response data
+ */
+struct pldm_read_file_resp {
+	uint8_t completion_code; //!< Completion code
+	uint32_t length;	 //!< Number of bytes read
+	uint8_t file_data[1];	 //!< Address of this is where file data starts
+} __attribute__((packed));
+
+/** @struct pldm_write_file_req
+ *
+ *  Structure representing WriteFile request
+ */
+struct pldm_write_file_req {
+	uint32_t file_handle; //!< Handle to file
+	uint32_t offset;      //!< Offset to file where write starts
+	uint32_t length;      //!< Bytes to be written
+	uint8_t file_data[1]; //!< Address of this is where file data starts
+} __attribute__((packed));
+
+/** @struct pldm_write_file_resp
+ *
+ *  Structure representing WriteFile response data
+ */
+struct pldm_write_file_resp {
+	uint8_t completion_code; //!< Completion code
+	uint32_t length;	 //!< Bytes written
+} __attribute__((packed));
+
+/** @brief Decode Read File commands request
+ *
+ *  @param[in] msg - PLDM request message payload
+ *  @param[in] payload_length - Length of request payload
+ *  @param[out] file_handle - A handle to the file
+ *  @param[out] offset - Offset to the file at which the read should begin
+ *  @param[out] length - Number of bytes read
+ *  @return pldm_completion_codes
+ */
+int decode_read_file_req(const struct pldm_msg *msg, size_t payload_length,
+			 uint32_t *file_handle, uint32_t *offset,
+			 uint32_t *length);
+
+/** @brief Encode Read File commands request
+ *
+ *  @param[in] instance_id - Message's instance id
+ *  @param[in] file_handle - A handle to the file
+ *  @param[in] offset - Offset to the file at which the read should begin
+ *  @param[in] length - Number of bytes read
+ *  @param[in,out] msg - Message will be written to this
+ *  @return pldm_completion_codes
+ *  @note  Caller is responsible for memory alloc and dealloc of param 'msg'
+ */
+int encode_read_file_req(uint8_t instance_id, uint32_t file_handle,
+			 uint32_t offset, uint32_t length,
+			 struct pldm_msg *msg);
+
+/** @brief Decode Read File commands response
+ *
+ *  @param[in] msg - PLDM response message payload
+ *  @param[in] payload_length - Length of request payload
+ *  @param[out] completion_code - PLDM completion code
+ *  @param[out] length - Number of bytes read. This could be less than what the
+ *                       requester asked for.
+ *  @param[out] file_data_offset - Offset where file data should be read in pldm
+ * msg.
+ *  @return pldm_completion_codes
+ */
+int decode_read_file_resp(const struct pldm_msg *msg, size_t payload_length,
+			  uint8_t *completion_code, uint32_t *length,
+			  size_t *file_data_offset);
+
+/** @brief Create a PLDM response for Read File
+ *
+ *  @param[in] instance_id - Message's instance id
+ *  @param[in] completion_code - PLDM completion code
+ *  @param[in] length - Number of bytes read. This could be less than what the
+ *                      requester asked for.
+ *  @param[in,out] msg - Message will be written to this
+ *  @return pldm_completion_codes
+ *  @note  Caller is responsible for memory alloc and dealloc of param 'msg'.
+ *  Although read file command response includes file data, this function
+ *  does not encode the file data to prevent additional copying of the data.
+ *  The position of file data is calculated by caller from address and size
+ *  of other input arguments.
+ */
+int encode_read_file_resp(uint8_t instance_id, uint8_t completion_code,
+			  uint32_t length, struct pldm_msg *msg);
+
+/** @brief Decode Write File commands request
+ *
+ *  @param[in] msg - PLDM request message payload
+ *  @param[in] payload_length - Length of request payload
+ *  @param[out] file_handle - A handle to the file
+ *  @param[out] offset - Offset to the file at which the write should begin
+ *  @param[out] length - Number of bytes to write
+ *  @param[out] file_data_offset - Offset where file data write begins in pldm
+ * msg.
+ *  @return pldm_completion_codes
+ */
+int decode_write_file_req(const struct pldm_msg *msg, size_t payload_length,
+			  uint32_t *file_handle, uint32_t *offset,
+			  uint32_t *length, size_t *file_data_offset);
+
+/** @brief Create a PLDM request for Write File
+ *
+ *  @param[in] instance_id - Message's instance id
+ *  @param[in] file_handle - A handle to the file
+ *  @param[in] offset - Offset to the file at which the read should begin
+ *  @param[in] length - Number of bytes written. This could be less than what
+ *                      the requester asked for.
+ *  @param[in,out] msg - Message will be written to this
+ *  @return pldm_completion_codes
+ *  @note  Caller is responsible for memory alloc and dealloc of param 'msg'.
+ *  Although write file command request includes file data, this function
+ *  does not encode the file data to prevent additional copying of the data.
+ *  The position of file data is calculated by caller from address and size
+ *  of other input arguments.
+ */
+int encode_write_file_req(uint8_t instance_id, uint32_t file_handle,
+			  uint32_t offset, uint32_t length,
+			  struct pldm_msg *msg);
+
+/** @brief Decode Write File commands response
+ *
+ *  @param[in] msg - PLDM request message payload
+ *  @param[in] payload_length - Length of request payload
+ *  @param[out] completion_code - PLDM completion code
+ *  @param[out] length - Number of bytes written
+ *  @return pldm_completion_codes
+ */
+int decode_write_file_resp(const struct pldm_msg *msg, size_t payload_length,
+			   uint8_t *completion_code, uint32_t *length);
+
+/** @brief Create a PLDM response for Write File
+ *
+ *  @param[in] instance_id - Message's instance id
+ *  @param[in] completion_code - PLDM completion code
+ *  @param[in] length - Number of bytes written. This could be less than what
+ *                      the requester asked for.
+ *  @param[in,out] msg - Message will be written to this
+ *  @return pldm_completion_codes
+ *  @note  Caller is responsible for memory alloc and dealloc of param 'msg'
+ */
+int encode_write_file_resp(uint8_t instance_id, uint8_t completion_code,
+			   uint32_t length, struct pldm_msg *msg);
+
+/** @struct pldm_read_write_file_by_type_memory_req
+ *
+ *  Structure representing ReadFileByTypeIntoMemory and
+ * WriteFileByTypeFromMemory request
+ */
+struct pldm_read_write_file_by_type_memory_req {
+	uint16_t file_type;   //!< Type of file
+	uint32_t file_handle; //!< Handle to file
+	uint32_t offset;      //!< Offset to file where read starts
+	uint32_t length;      //!< Bytes to be read
+	uint64_t address;     //!< Memory address of the file
+} __attribute__((packed));
+
+/** @struct pldm_read_write_file_by_type_memory_resp
+ *
+ *  Structure representing ReadFileByTypeIntoMemory and
+ * WriteFileByTypeFromMemory response
+ */
+struct pldm_read_write_file_by_type_memory_resp {
+	uint8_t completion_code; //!< Completion code
+	uint32_t length;	 //!< Number of bytes read
+} __attribute__((packed));
+
+/** @brief Decode ReadFileByTypeIntoMemory and WriteFileByTypeFromMemory
+ * commands request data
+ *
+ *  @param[in] msg - Pointer to PLDM request message
+ *  @param[in] payload_length - Length of request payload
+ *  @param[in] file_type - Type of the file
+ *  @param[out] file_handle - A handle to the file
+ *  @param[out] offset - Offset to the file at which the read should begin
+ *  @param[out] length - Number of bytes to be read
+ *  @param[out] address - Memory address of the file content
+ *  @return pldm_completion_codes
+ */
+int decode_rw_file_by_type_memory_req(const struct pldm_msg *msg,
+				      size_t payload_length,
+				      uint16_t *file_type,
+				      uint32_t *file_handle, uint32_t *offset,
+				      uint32_t *length, uint64_t *address);
+
+/** @brief Create a PLDM response for ReadFileByTypeIntoMemory and
+ * WriteFileByTypeFromMemory
+ *
+ *  @param[in] instance_id - Message's instance id
+ *  @param[in] command - PLDM command
+ *  @param[in] completion_code - PLDM completion code
+ *  @param[in] length - Number of bytes read. This could be less than what the
+ *                      requester asked for.
+ *  @param[in,out] msg - Message will be written to this
+ *  @return pldm_completion_codes
+ *  @note  Caller is responsible for memory alloc and dealloc of param 'msg'
+ */
+int encode_rw_file_by_type_memory_resp(uint8_t instance_id, uint8_t command,
+				       uint8_t completion_code, uint32_t length,
+				       struct pldm_msg *msg);
+
+/** @brief Encode ReadFileByTypeIntoMemory and WriteFileByTypeFromMemory
+ *         commands request data
+ *
+ *  @param[in] instance_id - Message's instance id
+ *  @param[in] command - PLDM command
+ *  @param[in] file_type - Type of the file
+ *  @param[in] file_handle - A handle to the file
+ *  @param[in] offset -  Offset to the file at which the read should begin
+ *  @param[in] length -  Number of bytes to be read/written
+ *  @param[in] address - Memory address where the file content has to be
+ *                       written to
+ *  @param[out] msg - Message will be written to this
+ *  @return pldm_completion_codes
+ */
+int encode_rw_file_by_type_memory_req(uint8_t instance_id, uint8_t command,
+				      uint16_t file_type, uint32_t file_handle,
+				      uint32_t offset, uint32_t length,
+				      uint64_t address, struct pldm_msg *msg);
+
+/** @brief Decode ReadFileTypeIntoMemory and WriteFileTypeFromMemory
+ *         commands response data
+ *
+ *  @param[in] msg - pointer to PLDM response message
+ *  @param[in] payload_length - Length of response payload
+ *  @param[out] completion_code - PLDM completion code
+ *  @param[out] length - Number of bytes to be read/written
+ *  @return pldm_completion_codes
+ */
+int decode_rw_file_by_type_memory_resp(const struct pldm_msg *msg,
+				       size_t payload_length,
+				       uint8_t *completion_code,
+				       uint32_t *length);
+
+/** @struct pldm_new_file_req
+ *
+ *  Structure representing NewFile request
+ */
+struct pldm_new_file_req {
+	uint16_t file_type;   //!< Type of file
+	uint32_t file_handle; //!< Handle to file
+	uint64_t length;      //!< Number of bytes in new file
+} __attribute__((packed));
+
+/** @struct pldm_new_file_resp
+ *
+ *  Structure representing NewFile response data
+ */
+struct pldm_new_file_resp {
+	uint8_t completion_code; //!< Completion code
+} __attribute__((packed));
+
+/** @brief Decode NewFileAvailable command request data
+ *
+ *  @param[in] msg - Pointer to PLDM request message
+ *  @param[in] payload_length - Length of request payload
+ *  @param[in] file_type - Type of the file
+ *  @param[out] file_handle - A handle to the file
+ *  @param[out] length - Number of bytes in new file
+ *  @return pldm_completion_codes
+ */
+int decode_new_file_req(const struct pldm_msg *msg, size_t payload_length,
+			uint16_t *file_type, uint32_t *file_handle,
+			uint64_t *length);
+
+/** @brief Create a PLDM response for NewFileAvailable
+ *
+ *  @param[in] instance_id - Message's instance id
+ *  @param[in] completion_code - PLDM completion code
+ *  @param[in,out] msg - Message will be written to this
+ *  @return pldm_completion_codes
+ *  @note  Caller is responsible for memory alloc and dealloc of param 'msg'
+ */
+int encode_new_file_resp(uint8_t instance_id, uint8_t completion_code,
+			 struct pldm_msg *msg);
+
+/** @brief Encode NewFileAvailable command request data
+ *
+ *  @param[in] instance_id - Message's instance id
+ *  @param[in] file_type - Type of the file
+ *  @param[in] file_handle - A handle to the file
+ *  @param[in] length -  Number of bytes in new file
+ *  @param[out] msg - Message will be written to this
+ *  @return pldm_completion_codes
+ */
+int encode_new_file_req(uint8_t instance_id, uint16_t file_type,
+			uint32_t file_handle, uint64_t length,
+			struct pldm_msg *msg);
+
+/** @brief Decode NewFileAvailable command response data
+ *
+ *  @param[in] msg - pointer to PLDM response message
+ *  @param[in] payload_length - Length of response payload
+ *  @param[out] completion_code - PLDM completion code
+ *  @return pldm_completion_codes
+ */
+int decode_new_file_resp(const struct pldm_msg *msg, size_t payload_length,
+			 uint8_t *completion_code);
+
+/** @struct pldm_read_write_file_by_type_req
+ *
+ *  Structure representing ReadFileByType and
+ *  WriteFileByType request
+ */
+struct pldm_read_write_file_by_type_req {
+	uint16_t file_type;   //!< Type of file
+	uint32_t file_handle; //!< Handle to file
+	uint32_t offset;      //!< Offset to file where read/write starts
+	uint32_t length;      //!< Bytes to be read
+} __attribute__((packed));
+
+/** @struct pldm_read_write_file_by_type_resp
+ *
+ *  Structure representing ReadFileByType and
+ *  WriteFileByType response
+ */
+struct pldm_read_write_file_by_type_resp {
+	uint8_t completion_code; //!< Completion code
+	uint32_t length;	 //!< Number of bytes read
+} __attribute__((packed));
+
+/** @brief Decode ReadFileByType and WriteFileByType
+ *  commands request data
+ *
+ *  @param[in] msg - Pointer to PLDM request message
+ *  @param[in] payload_length - Length of request payload
+ *  @param[out] file_type - Type of the file
+ *  @param[out] file_handle - A handle to the file
+ *  @param[out] offset - Offset to the file at which the read/write should begin
+ *  @param[out] length - Number of bytes to be read/written
+ *  @return pldm_completion_codes
+ */
+int decode_rw_file_by_type_req(const struct pldm_msg *msg,
+			       size_t payload_length, uint16_t *file_type,
+			       uint32_t *file_handle, uint32_t *offset,
+			       uint32_t *length);
+
+/** @brief Create a PLDM response for ReadFileByType and
+ *  WriteFileByType
+ *
+ *  @param[in] instance_id - Message's instance id
+ *  @param[in] command - PLDM command
+ *  @param[in] completion_code - PLDM completion code
+ *  @param[in] length - Number of bytes read/written. This could be less than
+ *                      what the requester asked for.
+ *  @param[in,out] msg - Message will be written to this
+ *  @return pldm_completion_codes
+ *  @note  Caller is responsible for memory alloc and dealloc of param 'msg'
+ *  @note File content has to be copied directly by the caller.
+ */
+int encode_rw_file_by_type_resp(uint8_t instance_id, uint8_t command,
+				uint8_t completion_code, uint32_t length,
+				struct pldm_msg *msg);
+
+/** @brief Encode ReadFileByType and WriteFileByType
+ *         commands request data
+ *
+ *  @param[in] instance_id - Message's instance id
+ *  @param[in] command - PLDM command
+ *  @param[in] file_type - Type of the file
+ *  @param[in] file_handle - A handle to the file
+ *  @param[in] offset -  Offset to the file at which the read should begin
+ *  @param[in] length -  Number of bytes to be read/written
+ *  @param[out] msg - Message will be written to this
+ *  @return pldm_completion_codes
+ *  @note File content has to be read directly by the caller.
+ */
+int encode_rw_file_by_type_req(uint8_t instance_id, uint8_t command,
+			       uint16_t file_type, uint32_t file_handle,
+			       uint32_t offset, uint32_t length,
+			       struct pldm_msg *msg);
+
+/** @brief Decode ReadFileByType and WriteFileByType
+ *         commands response data
+ *
+ *  @param[in] msg - pointer to PLDM response message
+ *  @param[in] payload_length - Length of response payload
+ *  @param[out] completion_code - PLDM completion code
+ *  @param[out] length - Number of bytes to be read/written
+ *  @return pldm_completion_codes
+ */
+int decode_rw_file_by_type_resp(const struct pldm_msg *msg,
+				size_t payload_length, uint8_t *completion_code,
+				uint32_t *length);
+
+/** @struct pldm_file_ack_req
+ *
+ *  Structure representing FileAck request
+ */
+struct pldm_file_ack_req {
+	uint16_t file_type;   //!< Type of file
+	uint32_t file_handle; //!< Handle to file
+	uint8_t file_status;  //!< Status of file processing
+} __attribute__((packed));
+
+/** @struct pldm_file_ack_resp
+ *
+ *  Structure representing NewFile response data
+ */
+struct pldm_file_ack_resp {
+	uint8_t completion_code; //!< Completion code
+} __attribute__((packed));
+
+/** @brief Decode FileAck command request data
+ *
+ *  @param[in] msg - Pointer to PLDM request message
+ *  @param[in] payload_length - Length of request payload
+ *  @param[out] file_type - Type of the file
+ *  @param[out] file_handle - A handle to the file
+ *  @param[out] file_status - Status of file processing
+ *  @return pldm_completion_codes
+ */
+int decode_file_ack_req(const struct pldm_msg *msg, size_t payload_length,
+			uint16_t *file_type, uint32_t *file_handle,
+			uint8_t *file_status);
+
+/** @brief Create a PLDM response for FileAck
+ *
+ *  @param[in] instance_id - Message's instance id
+ *  @param[in] completion_code - PLDM completion code
+ *  @param[in,out] msg - Message will be written to this
+ *  @return pldm_completion_codes
+ *  @note  Caller is responsible for memory alloc and dealloc of param 'msg'
+ */
+int encode_file_ack_resp(uint8_t instance_id, uint8_t completion_code,
+			 struct pldm_msg *msg);
+
+/** @brief Encode FileAck command request data
+ *
+ *  @param[in] instance_id - Message's instance id
+ *  @param[in] file_type - Type of the file
+ *  @param[in] file_handle - A handle to the file
+ *  @param[in] file_status - Status of file processing
+ *  @param[out] msg - Message will be written to this
+ *  @return pldm_completion_codes
+ */
+int encode_file_ack_req(uint8_t instance_id, uint16_t file_type,
+			uint32_t file_handle, uint8_t file_status,
+			struct pldm_msg *msg);
+
+/** @brief Decode FileAck command response data
+ *
+ *  @param[in] msg - pointer to PLDM response message
+ *  @param[in] payload_length - Length of response payload
+ *  @param[out] completion_code - PLDM completion code
+ *  @return pldm_completion_codes
+ */
+int decode_file_ack_resp(const struct pldm_msg *msg, size_t payload_length,
+			 uint8_t *completion_code);
+
+/* FileAckWithMetadata */
+
+/** @struct pldm_file_ack_with_meta_data_req
+ *
+ *  Structure representing FileAckWithMetadata request
+ */
+struct pldm_file_ack_with_meta_data_req {
+	uint16_t file_type;	   //!< Type of file
+	uint32_t file_handle;	   //!< Handle to file
+	uint8_t file_status;	   //!< Status of file processing
+	uint32_t file_meta_data_1; //!< Meta data specific to file type 1
+	uint32_t file_meta_data_2; //!< Meta data specific to file type 2
+	uint32_t file_meta_data_3; //!< Meta data specific to file type 3
+	uint32_t file_meta_data_4; //!< meta data specific to file type 4
+} __attribute__((packed));
+
+/** @struct pldm_file_ack_with_meta_data_resp
+ *
+ *  Structure representing FileAckWithMetadata response
+ */
+struct pldm_file_ack_with_meta_data_resp {
+	uint8_t completion_code; //!< Completion code
+} __attribute__((packed));
+
+/** @brief Encode FileAckWithMetadata request data
+ *
+ *  @param[in] instance_id - Message's instance id
+ *  @param[in] file_type - Type of the file
+ *  @param[in] file_handle - A handle to the file
+ *  @param[in] file_status - Status of file processing
+ *  @param[in] file_meta_data_1 - meta data specific to file type 1
+ *  @param[in] file_meta_data_2 - meta data specific to file type 2
+ *  @param[in] file_meta_data_3 - meta data specific to file type 3
+ *  @param[in] file_meta_data_4 - Meta data specific to file type 4
+ *  @param[out] msg - Message will be written to this
+ *  @return pldm_completion_codes
+ */
+int encode_file_ack_with_meta_data_req(
+    uint8_t instance_id, uint16_t file_type, uint32_t file_handle,
+    uint8_t file_status, uint32_t file_meta_data_1, uint32_t file_meta_data_2,
+    uint32_t file_meta_data_3, uint32_t file_meta_data_4, struct pldm_msg *msg);
+
+/** @brief Decode FileAckWithMetadata command response data
+ *
+ * @param[in] msg - pointer to PLDM response message
+ * @param[in] payload_length - Length of response payload
+ * @param[out] completion_code - PLDM completion code
+ * @return pldm_completion_codes
+ */
+int decode_file_ack_with_meta_data_resp(const struct pldm_msg *msg,
+					size_t payload_length,
+					uint8_t *completion_code);
+
+/** @brief Decode FileAckWithMetadata request data
+ *
+ * @param[in] msg - Pointer to PLDM request message
+ * @param[in] payload_length - Length of request payload
+ * @param[out] file_type - Type of the file
+ * @param[out] file_handle - A handle to the file
+ * @param[out] file_status - Status of file processing
+ * @param[out] file_meta_data_1 - meta data specific to file type 1
+ * @param[out] file_meta_data_2 - meta data specific to file type 2
+ * @param[out] file_meta_data_3 - meta data specific to file type 3
+ * @param[out] file_meta_data_4 - Meta data specific to file type 4
+ * @return pldm_completion_codes
+ */
+int decode_file_ack_with_meta_data_req(
+    const struct pldm_msg *msg, size_t payload_length, uint16_t *file_type,
+    uint32_t *file_handle, uint8_t *file_status, uint32_t *file_meta_data_1,
+    uint32_t *file_meta_data_2, uint32_t *file_meta_data_3,
+    uint32_t *file_meta_data_4);
+
+/** @brief Create a PLDM response message for FileAckWithMetadata
+ *
+ * @param[in] instance_id - Message's instance id
+ * @param[in] completion_code - PLDM completion code
+ * @param[in,out] msg - Message will be written to this
+ * @return pldm_completion_codes
+ */
+int encode_file_ack_with_meta_data_resp(uint8_t instance_id,
+					uint8_t completion_code,
+					struct pldm_msg *msg);
+
+/* NewFileAvailableWithMetaData */
+
+/** @struct pldm_new_file_with_metadata_req
+ *
+ *  Structure representing NewFileAvailableWithMetaData request
+ */
+
+struct pldm_new_file_with_metadata_req {
+	uint16_t file_type;	   //!< Type of file
+	uint32_t file_handle;	   //!< Handle to file
+	uint64_t length;	   //!< Number of bytes in new file
+	uint32_t file_meta_data_1; //!< Meta data specific to file type 1
+	uint32_t file_meta_data_2; //!< Meta data specific to file type 2
+	uint32_t file_meta_data_3; //!< Meta data specific to file type 3
+	uint32_t file_meta_data_4; //!< Meta data specific to file type 4
+} __attribute__((packed));
+
+/** @struct pldm_new_file_with_metadata_resp
+ *
+ *  Structure representing NewFileAvailableWithMetaData response data
+ */
+struct pldm_new_file_with_metadata_resp {
+	uint8_t completion_code; //!< Completion code
+} __attribute__((packed));
+
+/** @brief Encode NewFileAvailableWithMetaData request data
+ *
+ *  @param[in] instance_id - Message's instance id
+ *  @param[in] file_type - Type of the file
+ *  @param[in] file_handle - A handle to the file
+ *  @param[in] length -  Number of bytes in new file
+ *  @param[in] file_meta_data_1 - Meta data specific to file type 1
+ *  @param[in] file_meta_data_2 - Meta data specific to file type 2
+ *  @param[in] file_meta_data_3 - Meta data specific to file type 3
+ *  @param[in] file_meta_data_4 - Meta data specific to file type 4
+ *  @param[out] msg - Message will be written to this
+ *  @return pldm_completion_codes
+ */
+int encode_new_file_with_metadata_req(
+    uint8_t instance_id, uint16_t file_type, uint32_t file_handle,
+    uint64_t length, uint32_t file_meta_data_1, uint32_t file_meta_data_2,
+    uint32_t file_meta_data_3, uint32_t file_meta_data_4, struct pldm_msg *msg);
+
+/** @brief Decode NewFileAvailableWithMetaData response data
+ *
+ *  @param[in] msg - pointer to PLDM response message
+ *  @param[in] payload_length - Length of response payload
+ *  @param[out] completion_code - PLDM completion code
+ *  @return pldm_completion_codes
+ */
+int decode_new_file_with_metadata_resp(const struct pldm_msg *msg,
+				       size_t payload_length,
+				       uint8_t *completion_code);
+
+/** @brief Decode NewFileAvailableWithMetaData request data
+ *
+ *  @param[in] msg - Pointer to PLDM request message
+ *  @param[in] payload_length - Length of request payload
+ *  @param[out] file_type - Type of the file
+ *  @param[out] file_handle - A handle to the file
+ *  @param[out] length - Number of bytes in new file
+ *  @param[out] file_meta_data_1 - Meta data specific to file type 1
+ *  @param[out] file_meta_data_2 - Meta data specific to file type 2
+ *  @param[out] file_meta_data_3 - Meta data specific to file type 3
+ *  @param[out] file_meta_data_4 - Meta data specific to file type 4
+ *  @return pldm_completion_codes
+ */
+int decode_new_file_with_metadata_req(
+    const struct pldm_msg *msg, size_t payload_length, uint16_t *file_type,
+    uint32_t *file_handle, uint64_t *length, uint32_t *file_meta_data_1,
+    uint32_t *file_meta_data_2, uint32_t *file_meta_data_3,
+    uint32_t *file_meta_data_4);
+
+/** @brief Create a PLDM response for NewFileAvailableWithMetaData
+ *
+ *  @param[in] instance_id - Message's instance id
+ *  @param[in] completion_code - PLDM completion code
+ *  @param[in,out] msg - Message will be written to this
+ *  @return pldm_completion_codes
+ *  @note  Caller is responsible for memory alloc and dealloc of param 'msg'
+ */
+int encode_new_file_with_metadata_resp(uint8_t instance_id,
+				       uint8_t completion_code,
+				       struct pldm_msg *msg);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* FILEIO_H */
diff --git a/libpldm/oem/ibm/libpldm/fru.h b/libpldm/oem/ibm/libpldm/fru.h
new file mode 100644
index 0000000..c97f8b0
--- /dev/null
+++ b/libpldm/oem/ibm/libpldm/fru.h
@@ -0,0 +1,21 @@
+#ifndef OEM_IBM_FRU_H
+#define OEM_IBM_FRU_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stddef.h>
+#include <stdint.h>
+
+enum pldm_oem_ibm_fru_field_type {
+	PLDM_OEM_FRU_FIELD_TYPE_IANA = 0X01,
+	PLDM_OEM_FRU_FIELD_TYPE_RT = 0X02,
+	PLDM_OEM_FRU_FIELD_TYPE_LOCATION_CODE = 0XFE,
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* OEM_IBM_FRU_H */
diff --git a/libpldm/oem/ibm/libpldm/host.c b/libpldm/oem/ibm/libpldm/host.c
new file mode 100644
index 0000000..caaaf9e
--- /dev/null
+++ b/libpldm/oem/ibm/libpldm/host.c
@@ -0,0 +1,106 @@
+#include <endian.h>
+#include <string.h>
+
+#include "host.h"
+
+int encode_get_alert_status_req(uint8_t instance_id, uint8_t version_id,
+				struct pldm_msg *msg, size_t payload_length)
+{
+	if (msg == NULL) {
+		return PLDM_ERROR_INVALID_LENGTH;
+	}
+
+	if (payload_length != PLDM_GET_ALERT_STATUS_REQ_BYTES) {
+		return PLDM_ERROR_INVALID_LENGTH;
+	}
+
+	struct pldm_header_info header = {0};
+	header.msg_type = PLDM_REQUEST;
+	header.instance = instance_id;
+	header.pldm_type = PLDM_OEM;
+	header.command = PLDM_HOST_GET_ALERT_STATUS;
+	uint8_t rc = pack_pldm_header(&header, &(msg->hdr));
+	if (rc != PLDM_SUCCESS) {
+		return rc;
+	}
+
+	msg->payload[0] = version_id;
+
+	return PLDM_SUCCESS;
+}
+
+int decode_get_alert_status_resp(const struct pldm_msg *msg,
+				 size_t payload_length,
+				 uint8_t *completion_code, uint32_t *rack_entry,
+				 uint32_t *pri_cec_node)
+{
+	if (msg == NULL || completion_code == NULL || rack_entry == NULL ||
+	    pri_cec_node == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	*completion_code = msg->payload[0];
+	if (PLDM_SUCCESS != *completion_code) {
+		return PLDM_SUCCESS;
+	}
+
+	if (payload_length != PLDM_GET_ALERT_STATUS_RESP_BYTES) {
+		return PLDM_ERROR_INVALID_LENGTH;
+	}
+
+	struct pldm_get_alert_status_resp *response =
+	    (struct pldm_get_alert_status_resp *)msg->payload;
+
+	*rack_entry = le32toh(response->rack_entry);
+	*pri_cec_node = le32toh(response->pri_cec_node);
+
+	return PLDM_SUCCESS;
+}
+
+int decode_get_alert_status_req(const struct pldm_msg *msg,
+				size_t payload_length, uint8_t *version_id)
+{
+	if (msg == NULL || version_id == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	if (payload_length != PLDM_GET_ALERT_STATUS_REQ_BYTES) {
+		return PLDM_ERROR_INVALID_LENGTH;
+	}
+
+	*version_id = msg->payload[0];
+
+	return PLDM_SUCCESS;
+}
+
+int encode_get_alert_status_resp(uint8_t instance_id, uint8_t completion_code,
+				 uint32_t rack_entry, uint32_t pri_cec_node,
+				 struct pldm_msg *msg, size_t payload_length)
+{
+	if (msg == NULL) {
+		return PLDM_ERROR_INVALID_LENGTH;
+	}
+
+	if (payload_length != PLDM_GET_ALERT_STATUS_RESP_BYTES) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	struct pldm_header_info header = {0};
+	header.msg_type = PLDM_RESPONSE;
+	header.instance = instance_id;
+	header.pldm_type = PLDM_OEM;
+	header.command = PLDM_HOST_GET_ALERT_STATUS;
+	uint8_t rc = pack_pldm_header(&header, &(msg->hdr));
+	if (rc != PLDM_SUCCESS) {
+		return rc;
+	}
+
+	struct pldm_get_alert_status_resp *response =
+	    (struct pldm_get_alert_status_resp *)msg->payload;
+
+	response->completion_code = completion_code;
+	response->rack_entry = htole32(rack_entry);
+	response->pri_cec_node = htole32(pri_cec_node);
+
+	return PLDM_SUCCESS;
+}
diff --git a/libpldm/oem/ibm/libpldm/host.h b/libpldm/oem/ibm/libpldm/host.h
new file mode 100644
index 0000000..ed121ae
--- /dev/null
+++ b/libpldm/oem/ibm/libpldm/host.h
@@ -0,0 +1,108 @@
+#ifndef OEM_IBM_HOST_H
+#define OEM_IBM_HOST_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stddef.h>
+#include <stdint.h>
+
+#include "base.h"
+
+/* Maximum size for request */
+#define PLDM_GET_ALERT_STATUS_REQ_BYTES 1
+
+/* Response lengths are inclusive of completion code */
+#define PLDM_GET_ALERT_STATUS_RESP_BYTES 9
+
+enum pldm_host_commands {
+	PLDM_HOST_GET_ALERT_STATUS = 0xF0 // Custom oem cmd
+};
+
+/** @brief PLDM Command specific codes
+ */
+enum pldm_host_completion_codes { PLDM_HOST_UNSUPPORTED_FORMAT_VERSION = 0x81 };
+
+/** @struct pldm_get_alert_states_resp
+ *
+ * Structure representing GetAlertStatus response packet
+ */
+struct pldm_get_alert_status_resp {
+	uint8_t completion_code;
+	uint32_t rack_entry;
+	uint32_t pri_cec_node;
+} __attribute__((packed));
+
+/* Requester */
+
+/* GetAlertStatus */
+
+/** @brief Create a PLDM request message for GetAlertStatus
+ *
+ *  @param[in] instance_id - Message's instance id
+ *  @param[in] version_id - The command/response format. 0x00 for this format
+ *  @param[out] msg - Message will be written to this
+ *  @param[in] payload_length - Length of request message payload
+ *  @return pldm_completion_codes
+ *  @note  Caller is responsible for memory alloc and dealloc of param
+ *         'msg.payload'
+ */
+int encode_get_alert_status_req(uint8_t instance_id, uint8_t version_id,
+				struct pldm_msg *msg, size_t payload_length);
+
+/** @brief Decode GetAlertStatus response data
+ *
+ *  Note:
+ *  * If the return value is not PLDM_SUCCESS, it represents a
+ * transport layer error.
+ *  * If the completion_code value is not PLDM_SUCCESS, it represents a
+ * protocol layer error and all the out-parameters are invalid.
+ *
+ *  @param[in] msg - Request message
+ *  @param[in] payload_length - Length of request message payload
+ *  @param[out] completion_code - PLDM completion code
+ *  @param[out] rack_entry - Enclosure ID, Alert Status, Flags, Config ID
+ *  @param[out] pri_cec_node - Enclosure ID, Alert Status, Flags, Config ID
+ *  @return pldm_completion_codes
+ */
+int decode_get_alert_status_resp(const struct pldm_msg *msg,
+				 size_t payload_length,
+				 uint8_t *completion_code, uint32_t *rack_entry,
+				 uint32_t *pri_cec_node);
+
+/* Responder */
+
+/* GetAlertStatus */
+
+/** @brief Decode GetAlertStatus request data
+ *
+ *  @param[in] msg - Request message
+ *  @param[in] payload_length - Length of request message payload
+ *  @param[out] version_id - the command/response format. 0x00 for this format
+ *  @return pldm_completion_codes
+ */
+int decode_get_alert_status_req(const struct pldm_msg *msg,
+				size_t payload_length, uint8_t *version_id);
+
+/** @brief Create a PLDM OEM response message for GetAlertStatus
+ *
+ *  @param[in] instance_id - Message's instance id
+ *  @param[in] completion_code - PLDM completion code
+ *  @param[in] rack_entry - Enclosure ID, Alert Status, Flags, Config ID
+ *  @param[in] pri_cec_node - Enclosure ID, Alert Status, Flags, Config ID
+ *  @param[out] msg - Message will be written to this
+ *  @param[in] payload_length - Length of request message payload
+ *  @return pldm_completion_codes
+ *  @note  Caller is responsible for memory alloc and dealloc of param
+ *         'msg.body.payload'
+ */
+int encode_get_alert_status_resp(uint8_t instance_id, uint8_t completion_code,
+				 uint32_t rack_entry, uint32_t pri_cec_node,
+				 struct pldm_msg *msg, size_t payload_length);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* OEM_IBM_HOST_H */
diff --git a/libpldm/oem/ibm/libpldm/platform_oem_ibm.c b/libpldm/oem/ibm/libpldm/platform_oem_ibm.c
new file mode 100644
index 0000000..db7090a
--- /dev/null
+++ b/libpldm/oem/ibm/libpldm/platform_oem_ibm.c
@@ -0,0 +1,50 @@
+#include "platform_oem_ibm.h"
+#include "platform.h"
+#include <string.h>
+
+int encode_bios_attribute_update_event_req(uint8_t instance_id,
+					   uint8_t format_version, uint8_t tid,
+					   uint8_t num_handles,
+					   const uint8_t *list_of_handles,
+					   size_t payload_length,
+					   struct pldm_msg *msg)
+{
+	if (format_version != 1) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	if (msg == NULL || list_of_handles == NULL) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	if (num_handles == 0) {
+		return PLDM_ERROR_INVALID_DATA;
+	}
+
+	if (payload_length !=
+	    (PLDM_PLATFORM_EVENT_MESSAGE_MIN_REQ_BYTES + sizeof(num_handles) +
+	     (num_handles * sizeof(uint16_t)))) {
+		return PLDM_ERROR_INVALID_LENGTH;
+	}
+
+	struct pldm_header_info header = {0};
+	header.msg_type = PLDM_REQUEST;
+	header.instance = instance_id;
+	header.pldm_type = PLDM_PLATFORM;
+	header.command = PLDM_PLATFORM_EVENT_MESSAGE;
+	uint8_t rc = pack_pldm_header(&header, &(msg->hdr));
+	if (rc != PLDM_SUCCESS) {
+		return rc;
+	}
+
+	struct pldm_bios_attribute_update_event_req *request =
+	    (struct pldm_bios_attribute_update_event_req *)msg->payload;
+	request->format_version = format_version;
+	request->tid = tid;
+	request->event_class = PLDM_EVENT_TYPE_OEM_EVENT_BIOS_ATTRIBUTE_UPDATE;
+	request->num_handles = num_handles;
+	memcpy(request->bios_attribute_handles, list_of_handles,
+	       num_handles * sizeof(uint16_t));
+
+	return PLDM_SUCCESS;
+}
\ No newline at end of file
diff --git a/libpldm/oem/ibm/libpldm/platform_oem_ibm.h b/libpldm/oem/ibm/libpldm/platform_oem_ibm.h
new file mode 100644
index 0000000..f0aafd3
--- /dev/null
+++ b/libpldm/oem/ibm/libpldm/platform_oem_ibm.h
@@ -0,0 +1,56 @@
+#ifndef PLATFORM_OEM_IBM_H
+#define PLATFORM_OEM_IBM_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "base.h"
+#include <stddef.h>
+#include <stdint.h>
+
+enum pldm_event_types_ibm_oem {
+	PLDM_EVENT_TYPE_OEM_EVENT_BIOS_ATTRIBUTE_UPDATE = 0xF0,
+};
+
+/** @struct pldm_bios_attribute_update_event_req
+ *
+ * 	Structure representing PlatformEventMessage command request data for OEM
+ *  event type BIOS attribute update.
+ */
+struct pldm_bios_attribute_update_event_req {
+	uint8_t format_version;
+	uint8_t tid;
+	uint8_t event_class;
+	uint8_t num_handles;
+	uint8_t bios_attribute_handles[1];
+} __attribute__((packed));
+
+/** @brief Encode PlatformEventMessage request data for BIOS attribute update
+ *
+ *  @param[in] instance_id - Message's instance id
+ *  @param[in] format_version - Version of the event format
+ *  @param[in] tid - Terminus ID for the terminus that originated the event
+ *                   message
+ *  @param[in] num_handles - Number of BIOS handles with an update
+ *  @param[in] list_of_handles - Pointer to the list of BIOS attribute handles
+ *  @param[in] payload_length - Length of request message payload
+ *  @param[out] msg - Message will be written to this
+ *
+ *  @return pldm_completion_codes
+ *
+ *  @note  Caller is responsible for memory alloc and dealloc of param
+ *         'msg.payload'
+ */
+int encode_bios_attribute_update_event_req(uint8_t instance_id,
+					   uint8_t format_version, uint8_t tid,
+					   uint8_t num_handles,
+					   const uint8_t *list_of_handles,
+					   size_t payload_length,
+					   struct pldm_msg *msg);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* PLATFORM_OEM_IBM_H */
\ No newline at end of file
diff --git a/libpldm/oem/ibm/libpldm/state_set_oem_ibm.h b/libpldm/oem/ibm/libpldm/state_set_oem_ibm.h
new file mode 100644
index 0000000..cf5cb41
--- /dev/null
+++ b/libpldm/oem/ibm/libpldm/state_set_oem_ibm.h
@@ -0,0 +1,51 @@
+#ifndef STATE_SET_OEM_IBM_H
+#define STATE_SET_OEM_IBM_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @brief IBM OEM State Set IDs */
+enum ibm_oem_pldm_state_set_ids {
+	PLDM_OEM_IBM_FIRMWARE_UPDATE_STATE = 32768,
+	PLDM_OEM_IBM_BOOT_STATE = 32769,
+	PLDM_OEM_IBM_VERIFICATION_STATE = 32770,
+	PLDM_OEM_IBM_SYSTEM_POWER_STATE = 32771,
+	PLDM_OEM_IBM_SBE_MAINTENANCE_STATE = 32772,
+};
+
+enum ibm_oem_pldm_state_set_firmware_update_state_values {
+	START = 0x1,
+	END = 0x2,
+	FAIL = 0x3,
+	ABORT = 0x4,
+	ACCEPT = 0x5,
+	REJECT = 0x6,
+};
+
+enum ibm_oem_pldm_state_set_boot_state_values {
+	P = 0x1,
+	T = 0x2,
+};
+
+enum ibm_oem_pldm_state_set_verification_state_values {
+	VALID = 0x0,
+	ENTITLEMENT_FAIL = 0x1,
+	BANNED_PLATFORM_FAIL = 0x2,
+	MIN_MIF_FAIL = 0x4,
+};
+
+enum ibm_oem_pldm_state_set_system_power_state_values {
+	POWER_CYCLE_HARD = 0x1
+};
+
+enum ibm_oem_pldm_state_set_sbe_dump_state_values {
+	SBE_DUMP_COMPLETED = 0x1,
+	SBE_RETRY_REQUIRED = 0x2,
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* STATE_SET_OEM_IBM_H */
\ No newline at end of file
diff --git a/libpldm/oem/ibm/libpldm/tests/libpldm_fileio_test.cpp b/libpldm/oem/ibm/libpldm/tests/libpldm_fileio_test.cpp
new file mode 100644
index 0000000..5979ff4
--- /dev/null
+++ b/libpldm/oem/ibm/libpldm/tests/libpldm_fileio_test.cpp
@@ -0,0 +1,2180 @@
+#include "libpldm/base.h"
+#include "libpldm/file_io.h"
+
+#include <string.h>
+
+#include <array>
+
+#include <gtest/gtest.h>
+
+constexpr auto hdrSize = sizeof(pldm_msg_hdr);
+
+TEST(ReadWriteFileMemory, testGoodDecodeRequest)
+{
+	std::array<uint8_t, PLDM_RW_FILE_MEM_REQ_BYTES + hdrSize> requestMsg{};
+
+	// Random value for fileHandle, offset, length, address
+	uint32_t fileHandle = 0x12345678;
+	uint32_t offset = 0x87654321;
+	uint32_t length = 0x13245768;
+	uint64_t address = 0x124356879ACBDE0F;
+	uint32_t fileHandleLe = htole32(fileHandle);
+	uint32_t offsetLe = htole32(offset);
+	uint32_t lengthLe = htole32(length);
+	uint64_t addressLe = htole64(address);
+
+	memcpy(requestMsg.data() + hdrSize, &fileHandleLe,
+	       sizeof(fileHandleLe));
+	memcpy(requestMsg.data() + sizeof(fileHandleLe) + hdrSize, &offsetLe,
+	       sizeof(offsetLe));
+	memcpy(requestMsg.data() + sizeof(fileHandleLe) + sizeof(offsetLe) +
+		   hdrSize,
+	       &lengthLe, sizeof(lengthLe));
+	memcpy(requestMsg.data() + sizeof(fileHandleLe) + sizeof(offsetLe) +
+		   sizeof(lengthLe) + hdrSize,
+	       &addressLe, sizeof(addressLe));
+
+	uint32_t retFileHandle = 0;
+	uint32_t retOffset = 0;
+	uint32_t retLength = 0;
+	uint64_t retAddress = 0;
+
+	auto request = reinterpret_cast<pldm_msg *>(requestMsg.data());
+
+	// Invoke decode the read file memory request
+	auto rc = decode_rw_file_memory_req(
+	    request, requestMsg.size() - hdrSize, &retFileHandle, &retOffset,
+	    &retLength, &retAddress);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(fileHandle, retFileHandle);
+	ASSERT_EQ(offset, retOffset);
+	ASSERT_EQ(length, retLength);
+	ASSERT_EQ(address, retAddress);
+}
+
+TEST(ReadWriteFileMemory, testBadDecodeRequest)
+{
+	uint32_t fileHandle = 0;
+	uint32_t offset = 0;
+	uint32_t length = 0;
+	uint64_t address = 0;
+
+	// Request payload message is missing
+	auto rc = decode_rw_file_memory_req(NULL, 0, &fileHandle, &offset,
+					    &length, &address);
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+
+	std::array<uint8_t, PLDM_RW_FILE_MEM_REQ_BYTES> requestMsg{};
+
+	auto request = reinterpret_cast<pldm_msg *>(requestMsg.data());
+
+	// Address is NULL
+	rc = decode_rw_file_memory_req(request, requestMsg.size() - hdrSize,
+				       &fileHandle, &offset, &length, NULL);
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+
+	// Payload length is invalid
+	rc = decode_rw_file_memory_req(request, 0, &fileHandle, &offset,
+				       &length, &address);
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_LENGTH);
+}
+
+TEST(ReadWriteFileMemory, testGoodEncodeResponse)
+{
+	std::array<uint8_t, sizeof(pldm_msg_hdr) + PLDM_RW_FILE_MEM_RESP_BYTES>
+	    responseMsg{};
+	uint32_t length = 0xFF00EE11;
+	uint32_t lengthLe = htole32(length);
+	pldm_msg *response = reinterpret_cast<pldm_msg *>(responseMsg.data());
+
+	// ReadFileIntoMemory
+	auto rc = encode_rw_file_memory_resp(0, PLDM_READ_FILE_INTO_MEMORY,
+					     PLDM_SUCCESS, length, response);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(response->hdr.request, PLDM_RESPONSE);
+	ASSERT_EQ(response->hdr.instance_id, 0);
+	ASSERT_EQ(response->hdr.type, PLDM_OEM);
+	ASSERT_EQ(response->hdr.command, PLDM_READ_FILE_INTO_MEMORY);
+	ASSERT_EQ(response->payload[0], PLDM_SUCCESS);
+	ASSERT_EQ(0, memcmp(response->payload + sizeof(response->payload[0]),
+			    &lengthLe, sizeof(lengthLe)));
+
+	// WriteFileFromMemory
+	rc = encode_rw_file_memory_resp(0, PLDM_WRITE_FILE_FROM_MEMORY,
+					PLDM_SUCCESS, length, response);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(response->hdr.request, PLDM_RESPONSE);
+	ASSERT_EQ(response->hdr.instance_id, 0);
+	ASSERT_EQ(response->hdr.type, PLDM_OEM);
+	ASSERT_EQ(response->hdr.command, PLDM_WRITE_FILE_FROM_MEMORY);
+	ASSERT_EQ(response->payload[0], PLDM_SUCCESS);
+	ASSERT_EQ(0, memcmp(response->payload + sizeof(response->payload[0]),
+			    &lengthLe, sizeof(lengthLe)));
+}
+
+TEST(ReadWriteFileMemory, testBadEncodeResponse)
+{
+	std::array<uint8_t, sizeof(pldm_msg_hdr) + PLDM_RW_FILE_MEM_RESP_BYTES>
+	    responseMsg{};
+	uint32_t length = 0;
+	pldm_msg *response = reinterpret_cast<pldm_msg *>(responseMsg.data());
+
+	// ReadFileIntoMemory
+	auto rc = encode_rw_file_memory_resp(0, PLDM_READ_FILE_INTO_MEMORY,
+					     PLDM_ERROR, length, response);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(response->hdr.request, PLDM_RESPONSE);
+	ASSERT_EQ(response->hdr.instance_id, 0);
+	ASSERT_EQ(response->hdr.type, PLDM_OEM);
+	ASSERT_EQ(response->hdr.command, PLDM_READ_FILE_INTO_MEMORY);
+	ASSERT_EQ(response->payload[0], PLDM_ERROR);
+
+	// WriteFileFromMemory
+	rc = encode_rw_file_memory_resp(0, PLDM_WRITE_FILE_FROM_MEMORY,
+					PLDM_ERROR, length, response);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(response->hdr.request, PLDM_RESPONSE);
+	ASSERT_EQ(response->hdr.instance_id, 0);
+	ASSERT_EQ(response->hdr.type, PLDM_OEM);
+	ASSERT_EQ(response->hdr.command, PLDM_WRITE_FILE_FROM_MEMORY);
+	ASSERT_EQ(response->payload[0], PLDM_ERROR);
+}
+
+TEST(ReadWriteFileIntoMemory, testGoodDecodeResponse)
+{
+	std::array<uint8_t, PLDM_RW_FILE_MEM_RESP_BYTES + hdrSize>
+	    responseMsg{};
+	// Random value for length
+	uint32_t length = 0xFF00EE12;
+	uint32_t lengthLe = htole32(length);
+	uint8_t completionCode = 0;
+
+	memcpy(responseMsg.data() + hdrSize, &completionCode,
+	       sizeof(completionCode));
+	memcpy(responseMsg.data() + sizeof(completionCode) + hdrSize, &lengthLe,
+	       sizeof(lengthLe));
+
+	uint8_t retCompletionCode = 0;
+	uint32_t retLength = 0;
+
+	auto response = reinterpret_cast<pldm_msg *>(responseMsg.data());
+
+	// Invoke decode the read file memory response
+	auto rc =
+	    decode_rw_file_memory_resp(response, responseMsg.size() - hdrSize,
+				       &retCompletionCode, &retLength);
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(completionCode, retCompletionCode);
+	ASSERT_EQ(length, retLength);
+}
+
+TEST(ReadWriteFileIntoMemory, testBadDecodeResponse)
+{
+	uint32_t length = 0;
+	uint8_t completionCode = 0;
+
+	// Request payload message is missing
+	auto rc = decode_rw_file_memory_resp(NULL, 0, &completionCode, &length);
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+
+	std::array<uint8_t, PLDM_RW_FILE_MEM_RESP_BYTES> responseMsg{};
+
+	auto response = reinterpret_cast<pldm_msg *>(responseMsg.data());
+
+	// Payload length is invalid
+	rc = decode_rw_file_memory_resp(response, 0, &completionCode, &length);
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_LENGTH);
+}
+
+TEST(ReadWriteFileIntoMemory, testGoodEncodeRequest)
+{
+	std::array<uint8_t, sizeof(pldm_msg_hdr) + PLDM_RW_FILE_MEM_REQ_BYTES>
+	    requestMsg{};
+
+	uint32_t fileHandle = 0x12345678;
+	uint32_t offset = 0x87654321;
+	uint32_t length = 0x13245768;
+	uint64_t address = 0x124356879ACBDE0F;
+	uint32_t fileHandleLe = htole32(fileHandle);
+	uint32_t offsetLe = htole32(offset);
+	uint32_t lengthLe = htole32(length);
+	uint64_t addressLe = htole64(address);
+
+	pldm_msg *request = reinterpret_cast<pldm_msg *>(requestMsg.data());
+
+	auto rc =
+	    encode_rw_file_memory_req(0, PLDM_READ_FILE_INTO_MEMORY, fileHandle,
+				      offset, length, address, request);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(request->hdr.request, PLDM_REQUEST);
+	ASSERT_EQ(request->hdr.instance_id, 0);
+	ASSERT_EQ(request->hdr.type, PLDM_OEM);
+	ASSERT_EQ(request->hdr.command, PLDM_READ_FILE_INTO_MEMORY);
+
+	ASSERT_EQ(
+	    0, memcmp(request->payload, &fileHandleLe, sizeof(fileHandleLe)));
+
+	ASSERT_EQ(0, memcmp(request->payload + sizeof(fileHandleLe), &offsetLe,
+			    sizeof(offsetLe)));
+	ASSERT_EQ(0, memcmp(request->payload + sizeof(fileHandleLe) +
+				sizeof(offsetLe),
+			    &lengthLe, sizeof(lengthLe)));
+	ASSERT_EQ(0, memcmp(request->payload + sizeof(fileHandleLe) +
+				sizeof(offsetLe) + sizeof(lengthLe),
+			    &addressLe, sizeof(addressLe)));
+}
+
+TEST(ReadWriteFileIntoMemory, testBadEncodeRequest)
+{
+	uint32_t fileHandle = 0;
+	uint32_t offset = 0;
+	uint32_t length = 0;
+	uint64_t address = 0;
+
+	auto rc =
+	    encode_rw_file_memory_req(0, PLDM_READ_FILE_INTO_MEMORY, fileHandle,
+				      offset, length, address, NULL);
+
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+}
+
+TEST(GetFileTable, GoodDecodeRequest)
+{
+	std::array<uint8_t, PLDM_GET_FILE_TABLE_REQ_BYTES + hdrSize>
+	    requestMsg{};
+
+	// Random value for DataTransferHandle, TransferOperationFlag, TableType
+	uint32_t transferHandle = 0x12345678;
+	uint32_t transferHandleLe = htole32(transferHandle);
+	uint8_t transferOpFlag = 1;
+	uint8_t tableType = 1;
+
+	memcpy(requestMsg.data() + hdrSize, &transferHandleLe,
+	       sizeof(transferHandleLe));
+	memcpy(requestMsg.data() + sizeof(transferHandle) + hdrSize,
+	       &transferOpFlag, sizeof(transferOpFlag));
+	memcpy(requestMsg.data() + sizeof(transferHandle) +
+		   sizeof(transferOpFlag) + hdrSize,
+	       &tableType, sizeof(tableType));
+
+	uint32_t retTransferHandle = 0;
+	uint8_t retTransferOpFlag = 0;
+	uint8_t retTableType = 0;
+
+	auto request = reinterpret_cast<pldm_msg *>(requestMsg.data());
+
+	// Invoke decode get file table request
+	auto rc = decode_get_file_table_req(
+	    request, requestMsg.size() - hdrSize, &retTransferHandle,
+	    &retTransferOpFlag, &retTableType);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(transferHandle, retTransferHandle);
+	ASSERT_EQ(transferOpFlag, retTransferOpFlag);
+	ASSERT_EQ(tableType, retTableType);
+}
+
+TEST(GetFileTable, BadDecodeRequest)
+{
+	uint32_t transferHandle = 0;
+	uint8_t transferOpFlag = 0;
+	uint8_t tableType = 0;
+
+	// Request payload message is missing
+	auto rc = decode_get_file_table_req(nullptr, 0, &transferHandle,
+					    &transferOpFlag, &tableType);
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+
+	std::array<uint8_t, PLDM_GET_FILE_TABLE_REQ_BYTES> requestMsg{};
+
+	auto request = reinterpret_cast<pldm_msg *>(requestMsg.data());
+
+	// TableType is NULL
+	rc = decode_get_file_table_req(request, requestMsg.size() - hdrSize,
+				       &transferHandle, &transferOpFlag,
+				       nullptr);
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+
+	// Payload length is invalid
+	rc = decode_get_file_table_req(request, 0, &transferHandle,
+				       &transferOpFlag, &tableType);
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_LENGTH);
+}
+
+TEST(GetFileTable, GoodEncodeResponse)
+{
+	// Random value for NextDataTransferHandle and TransferFlag
+	uint8_t completionCode = 0;
+	uint32_t nextTransferHandle = 0x87654321;
+	uint32_t nextTransferHandleLe = htole32(nextTransferHandle);
+	uint8_t transferFlag = 5;
+	// Mock file table contents of size 5
+	std::array<uint8_t, 5> fileTable = {1, 2, 3, 4, 5};
+	constexpr size_t responseSize = sizeof(completionCode) +
+					sizeof(nextTransferHandle) +
+					sizeof(transferFlag) + fileTable.size();
+
+	std::array<uint8_t, sizeof(pldm_msg_hdr) + responseSize> responseMsg{};
+	pldm_msg *response = reinterpret_cast<pldm_msg *>(responseMsg.data());
+
+	// GetFileTable
+	auto rc = encode_get_file_table_resp(
+	    0, PLDM_SUCCESS, nextTransferHandle, transferFlag, fileTable.data(),
+	    fileTable.size(), response);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(response->hdr.request, PLDM_RESPONSE);
+	ASSERT_EQ(response->hdr.instance_id, 0);
+	ASSERT_EQ(response->hdr.type, PLDM_OEM);
+	ASSERT_EQ(response->hdr.command, PLDM_GET_FILE_TABLE);
+	ASSERT_EQ(response->payload[0], PLDM_SUCCESS);
+	ASSERT_EQ(0, memcmp(response->payload + sizeof(response->payload[0]),
+			    &nextTransferHandleLe, sizeof(nextTransferHandle)));
+	ASSERT_EQ(0, memcmp(response->payload + sizeof(response->payload[0]) +
+				sizeof(nextTransferHandle),
+			    &transferFlag, sizeof(transferFlag)));
+	ASSERT_EQ(0, memcmp(response->payload + sizeof(response->payload[0]) +
+				sizeof(nextTransferHandle),
+			    &transferFlag, sizeof(transferFlag)));
+	ASSERT_EQ(0,
+		  memcmp(response->payload + sizeof(response->payload[0]) +
+			     sizeof(nextTransferHandle) + sizeof(transferFlag),
+			 fileTable.data(), fileTable.size()));
+}
+
+TEST(GetFileTable, BadEncodeResponse)
+{
+	uint8_t completionCode = 0;
+	uint32_t nextTransferHandle = 0;
+	uint8_t transferFlag = 0;
+	constexpr size_t responseSize = sizeof(completionCode) +
+					sizeof(nextTransferHandle) +
+					sizeof(transferFlag);
+
+	std::array<uint8_t, sizeof(pldm_msg_hdr) + responseSize> responseMsg{};
+	pldm_msg *response = reinterpret_cast<pldm_msg *>(responseMsg.data());
+
+	// GetFileTable
+	auto rc =
+	    encode_get_file_table_resp(0, PLDM_ERROR, nextTransferHandle,
+				       transferFlag, nullptr, 0, response);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(response->hdr.request, PLDM_RESPONSE);
+	ASSERT_EQ(response->hdr.instance_id, 0);
+	ASSERT_EQ(response->hdr.type, PLDM_OEM);
+	ASSERT_EQ(response->hdr.command, PLDM_GET_FILE_TABLE);
+	ASSERT_EQ(response->payload[0], PLDM_ERROR);
+}
+
+TEST(GetFileTable, GoodEncodeRequest)
+{
+	std::array<uint8_t,
+		   sizeof(pldm_msg_hdr) + PLDM_GET_FILE_TABLE_REQ_BYTES>
+	    requestMsg{};
+	uint32_t transferHandle = 0x0;
+	uint8_t transferOpFlag = 0x01;
+	uint8_t tableType = PLDM_FILE_ATTRIBUTE_TABLE;
+
+	auto request = reinterpret_cast<pldm_msg *>(requestMsg.data());
+	auto rc = encode_get_file_table_req(0, transferHandle, transferOpFlag,
+					    tableType, request);
+	EXPECT_EQ(rc, PLDM_SUCCESS);
+
+	struct pldm_get_file_table_req *req =
+	    reinterpret_cast<struct pldm_get_file_table_req *>(
+		request->payload);
+	EXPECT_EQ(transferHandle, le32toh(req->transfer_handle));
+	EXPECT_EQ(transferOpFlag, req->operation_flag);
+	EXPECT_EQ(tableType, req->table_type);
+}
+
+TEST(GetFileTable, BadEncodeRequest)
+{
+	uint32_t transferHandle = 0x0;
+	uint8_t transferOpFlag = 0x01;
+	uint8_t tableType = PLDM_FILE_ATTRIBUTE_TABLE;
+
+	auto rc = encode_get_file_table_req(0, transferHandle, transferOpFlag,
+					    tableType, nullptr);
+
+	EXPECT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+}
+
+TEST(GetFileTable, GoodDecodeResponse)
+{
+	uint32_t nextTransferHandle = 32;
+	uint8_t completionCode = PLDM_SUCCESS;
+	uint8_t transferFlag = PLDM_START_AND_END;
+	std::vector<uint8_t> fileTableData = {1, 2, 3, 4, 5, 6, 7, 8, 9};
+
+	std::vector<uint8_t> responseMsg(hdrSize +
+					 PLDM_GET_FILE_TABLE_MIN_RESP_BYTES +
+					 fileTableData.size());
+
+	auto responsePtr = reinterpret_cast<pldm_msg *>(responseMsg.data());
+	size_t payload_length = responseMsg.size() - hdrSize;
+
+	auto resp = reinterpret_cast<struct pldm_get_file_table_resp *>(
+	    responsePtr->payload);
+
+	resp->completion_code = completionCode;
+	resp->next_transfer_handle = htole32(nextTransferHandle);
+	resp->transfer_flag = transferFlag;
+	memcpy(resp->table_data, fileTableData.data(), fileTableData.size());
+
+	uint8_t retCompletionCode;
+	uint32_t retNextTransferHandle;
+	uint8_t retTransferFlag;
+	std::vector<uint8_t> retFileTableData(9, 0);
+	size_t retFileTableDataLength = 0;
+
+	auto rc = decode_get_file_table_resp(
+	    responsePtr, payload_length, &retCompletionCode,
+	    &retNextTransferHandle, &retTransferFlag, retFileTableData.data(),
+	    &retFileTableDataLength);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(completionCode, retCompletionCode);
+	ASSERT_EQ(nextTransferHandle, retNextTransferHandle);
+	ASSERT_EQ(transferFlag, retTransferFlag);
+	ASSERT_EQ(0, memcmp(fileTableData.data(), resp->table_data,
+			    retFileTableDataLength));
+	ASSERT_EQ(fileTableData.size(), retFileTableDataLength);
+}
+
+TEST(GetFileTable, BadDecodeResponse)
+{
+	uint32_t nextTransferHandle = 32;
+	uint8_t completionCode = PLDM_SUCCESS;
+	uint8_t transferFlag = PLDM_START_AND_END;
+	std::vector<uint8_t> fileTableData(9, 0);
+	size_t file_table_data_length = 0;
+
+	std::vector<uint8_t> responseMsg(hdrSize +
+					 PLDM_GET_FILE_TABLE_MIN_RESP_BYTES +
+					 fileTableData.size());
+
+	auto responsePtr = reinterpret_cast<pldm_msg *>(responseMsg.data());
+
+	auto rc = decode_get_file_table_resp(
+	    nullptr, 0, &completionCode, &nextTransferHandle, &transferFlag,
+	    fileTableData.data(), &file_table_data_length);
+
+	EXPECT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+
+	rc = decode_get_file_table_resp(
+	    responsePtr, 0, &completionCode, &nextTransferHandle, &transferFlag,
+	    fileTableData.data(), &file_table_data_length);
+
+	EXPECT_EQ(rc, PLDM_ERROR_INVALID_LENGTH);
+}
+
+TEST(ReadFile, testGoodDecodeRequest)
+{
+	std::array<uint8_t, PLDM_READ_FILE_REQ_BYTES + sizeof(pldm_msg_hdr)>
+	    requestMsg{};
+
+	auto requestPtr = reinterpret_cast<pldm_msg *>(requestMsg.data());
+	size_t payload_length = requestMsg.size() - sizeof(pldm_msg_hdr);
+	auto request =
+	    reinterpret_cast<pldm_read_file_req *>(requestPtr->payload);
+
+	// Random value for fileHandle, offset and length
+	uint32_t fileHandle = 0x12345678;
+	uint32_t offset = 0x87654321;
+	uint32_t length = 0x13245768;
+
+	request->file_handle = htole32(fileHandle);
+	request->offset = htole32(offset);
+	request->length = htole32(length);
+
+	uint32_t retFileHandle = 0;
+	uint32_t retOffset = 0;
+	uint32_t retLength = 0;
+
+	// Invoke decode the read file request
+	auto rc = decode_read_file_req(requestPtr, payload_length,
+				       &retFileHandle, &retOffset, &retLength);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(fileHandle, retFileHandle);
+	ASSERT_EQ(offset, retOffset);
+	ASSERT_EQ(length, retLength);
+}
+
+TEST(WriteFile, testGoodDecodeRequest)
+{
+	// Random value for fileHandle, offset, length and file data
+	uint32_t fileHandle = 0x12345678;
+	uint32_t offset = 0x87654321;
+	uint32_t length = 0x467;
+
+	std::vector<uint8_t> requestMsg(PLDM_WRITE_FILE_REQ_BYTES +
+					sizeof(pldm_msg_hdr) + length);
+	auto requestPtr = reinterpret_cast<pldm_msg *>(requestMsg.data());
+	size_t payload_length = requestMsg.size() - sizeof(pldm_msg_hdr);
+	auto request =
+	    reinterpret_cast<pldm_write_file_req *>(requestPtr->payload);
+
+	size_t fileDataOffset =
+	    sizeof(fileHandle) + sizeof(offset) + sizeof(length);
+
+	request->file_handle = htole32(fileHandle);
+	request->offset = htole32(offset);
+	request->length = htole32(length);
+
+	uint32_t retFileHandle = 0;
+	uint32_t retOffset = 0;
+	uint32_t retLength = 0;
+	size_t retFileDataOffset = 0;
+
+	// Invoke decode the write file request
+	auto rc =
+	    decode_write_file_req(requestPtr, payload_length, &retFileHandle,
+				  &retOffset, &retLength, &retFileDataOffset);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(fileHandle, retFileHandle);
+	ASSERT_EQ(offset, retOffset);
+	ASSERT_EQ(length, retLength);
+	ASSERT_EQ(fileDataOffset, retFileDataOffset);
+}
+
+TEST(ReadFile, testGoodDecodeResponse)
+{
+	// Random value for length
+	uint32_t length = 0x10;
+	uint8_t completionCode = PLDM_SUCCESS;
+
+	std::vector<uint8_t> responseMsg(PLDM_READ_FILE_RESP_BYTES +
+					 sizeof(pldm_msg_hdr) + length);
+	auto responsePtr = reinterpret_cast<pldm_msg *>(responseMsg.data());
+	size_t payload_length = responseMsg.size() - sizeof(pldm_msg_hdr);
+	auto response =
+	    reinterpret_cast<pldm_read_file_resp *>(responsePtr->payload);
+
+	response->completion_code = completionCode;
+	response->length = htole32(length);
+
+	size_t fileDataOffset = sizeof(completionCode) + sizeof(length);
+
+	uint32_t retLength = 0;
+	uint8_t retCompletionCode = 0;
+	size_t retFileDataOffset = 0;
+
+	// Invoke decode the read file response
+	auto rc = decode_read_file_resp(responsePtr, payload_length,
+					&retCompletionCode, &retLength,
+					&retFileDataOffset);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(completionCode, retCompletionCode);
+	ASSERT_EQ(length, retLength);
+	ASSERT_EQ(fileDataOffset, retFileDataOffset);
+}
+
+TEST(WriteFile, testGoodDecodeResponse)
+{
+	std::array<uint8_t, PLDM_WRITE_FILE_RESP_BYTES + sizeof(pldm_msg_hdr)>
+	    responseMsg{};
+	auto responsePtr = reinterpret_cast<pldm_msg *>(responseMsg.data());
+	size_t payload_length = responseMsg.size() - sizeof(pldm_msg_hdr);
+	auto response =
+	    reinterpret_cast<pldm_write_file_resp *>(responsePtr->payload);
+
+	uint8_t completionCode = PLDM_SUCCESS;
+	uint32_t length = 0x4678;
+
+	response->completion_code = completionCode;
+	response->length = htole32(length);
+
+	uint32_t retLength = 0;
+	uint8_t retCompletionCode = 0;
+
+	// Invoke decode the write file response
+	auto rc = decode_write_file_resp(responsePtr, payload_length,
+					 &retCompletionCode, &retLength);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(completionCode, retCompletionCode);
+	ASSERT_EQ(length, retLength);
+}
+
+TEST(ReadWriteFile, testBadDecodeResponse)
+{
+	uint32_t length = 0;
+	uint8_t completionCode = 0;
+	size_t fileDataOffset = 0;
+
+	// Bad decode response for read file
+	std::vector<uint8_t> responseMsg(PLDM_READ_FILE_RESP_BYTES +
+					 sizeof(pldm_msg_hdr) + length);
+	auto responsePtr = reinterpret_cast<pldm_msg *>(responseMsg.data());
+
+	// Request payload message is missing
+	auto rc = decode_read_file_resp(NULL, 0, &completionCode, &length,
+					&fileDataOffset);
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+
+	// Payload length is invalid
+	rc = decode_read_file_resp(responsePtr, 0, &completionCode, &length,
+				   &fileDataOffset);
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_LENGTH);
+
+	// Bad decode response for write file
+	std::array<uint8_t, PLDM_WRITE_FILE_RESP_BYTES + sizeof(pldm_msg_hdr)>
+	    responseMsgWr{};
+	auto responseWr = reinterpret_cast<pldm_msg *>(responseMsgWr.data());
+
+	// Request payload message is missing
+	rc = decode_write_file_resp(NULL, 0, &completionCode, &length);
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+
+	// Payload length is invalid
+	rc = decode_write_file_resp(responseWr, 0, &completionCode, &length);
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_LENGTH);
+}
+
+TEST(ReadWriteFile, testBadDecodeRequest)
+{
+	uint32_t fileHandle = 0;
+	uint32_t offset = 0;
+	uint32_t length = 0;
+
+	// Bad decode request for read file
+	std::array<uint8_t, PLDM_READ_FILE_REQ_BYTES + sizeof(pldm_msg_hdr)>
+	    requestMsg{};
+	auto requestPtr = reinterpret_cast<pldm_msg *>(requestMsg.data());
+
+	// Request payload message is missing
+	auto rc = decode_read_file_req(NULL, 0, &fileHandle, &offset, &length);
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+
+	// Payload length is invalid
+	rc = decode_read_file_req(requestPtr, 0, &fileHandle, &offset, &length);
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_LENGTH);
+
+	// Bad decode request for write file
+	size_t fileDataOffset = 0;
+	std::array<uint8_t, PLDM_WRITE_FILE_REQ_BYTES> requestMsgWr{};
+	auto requestWr = reinterpret_cast<pldm_msg *>(requestMsgWr.data());
+
+	// Request payload message is missing
+	rc = decode_write_file_req(NULL, 0, &fileHandle, &offset, &length,
+				   &fileDataOffset);
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+
+	// Payload length is invalid
+	rc = decode_write_file_req(requestWr, 0, &fileHandle, &offset, &length,
+				   &fileDataOffset);
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_LENGTH);
+}
+
+TEST(ReadFile, testGoodEncodeResponse)
+{
+	// Good encode response for read file
+	uint32_t length = 0x4;
+
+	std::vector<uint8_t> responseMsg(PLDM_READ_FILE_RESP_BYTES +
+					 sizeof(pldm_msg_hdr) + length);
+	auto responsePtr = reinterpret_cast<pldm_msg *>(responseMsg.data());
+	auto response =
+	    reinterpret_cast<pldm_read_file_resp *>(responsePtr->payload);
+
+	// ReadFile
+	auto rc = encode_read_file_resp(0, PLDM_SUCCESS, length, responsePtr);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(responsePtr->hdr.request, PLDM_RESPONSE);
+	ASSERT_EQ(responsePtr->hdr.instance_id, 0);
+	ASSERT_EQ(responsePtr->hdr.type, PLDM_OEM);
+	ASSERT_EQ(responsePtr->hdr.command, PLDM_READ_FILE);
+	ASSERT_EQ(response->completion_code, PLDM_SUCCESS);
+	ASSERT_EQ(le32toh(response->length), length);
+}
+
+TEST(WriteFile, testGoodEncodeResponse)
+{
+	uint32_t length = 0x467;
+
+	std::array<uint8_t, sizeof(pldm_msg_hdr) + PLDM_WRITE_FILE_RESP_BYTES>
+	    responseMsg{};
+
+	auto responsePtr = reinterpret_cast<pldm_msg *>(responseMsg.data());
+	auto response =
+	    reinterpret_cast<pldm_write_file_resp *>(responsePtr->payload);
+
+	// WriteFile
+	auto rc = encode_write_file_resp(0, PLDM_SUCCESS, length, responsePtr);
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(responsePtr->hdr.request, PLDM_RESPONSE);
+	ASSERT_EQ(responsePtr->hdr.instance_id, 0);
+	ASSERT_EQ(responsePtr->hdr.type, PLDM_OEM);
+	ASSERT_EQ(responsePtr->hdr.command, PLDM_WRITE_FILE);
+	ASSERT_EQ(response->completion_code, PLDM_SUCCESS);
+	ASSERT_EQ(le32toh(response->length), length);
+}
+
+TEST(ReadFile, testGoodEncodeRequest)
+{
+	std::array<uint8_t, sizeof(pldm_msg_hdr) + PLDM_READ_FILE_REQ_BYTES>
+	    requestMsg{};
+
+	uint32_t fileHandle = 0x12345678;
+	uint32_t offset = 0x87654321;
+	uint32_t length = 0x13245768;
+	auto requestPtr = reinterpret_cast<pldm_msg *>(requestMsg.data());
+	auto request =
+	    reinterpret_cast<pldm_read_file_req *>(requestPtr->payload);
+
+	// ReadFile
+	auto rc =
+	    encode_read_file_req(0, fileHandle, offset, length, requestPtr);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(requestPtr->hdr.request, PLDM_REQUEST);
+	ASSERT_EQ(requestPtr->hdr.instance_id, 0);
+	ASSERT_EQ(requestPtr->hdr.type, PLDM_OEM);
+	ASSERT_EQ(requestPtr->hdr.command, PLDM_READ_FILE);
+	ASSERT_EQ(le32toh(request->file_handle), fileHandle);
+	ASSERT_EQ(le32toh(request->offset), offset);
+	ASSERT_EQ(le32toh(request->length), length);
+}
+
+TEST(WriteFile, testGoodEncodeRequest)
+{
+	uint32_t fileHandle = 0x12345678;
+	uint32_t offset = 0x87654321;
+	uint32_t length = 0x456;
+
+	std::vector<uint8_t> requestMsg(PLDM_WRITE_FILE_REQ_BYTES +
+					sizeof(pldm_msg_hdr) + length);
+	auto requestPtr = reinterpret_cast<pldm_msg *>(requestMsg.data());
+	auto request =
+	    reinterpret_cast<pldm_write_file_req *>(requestPtr->payload);
+
+	// WriteFile
+	auto rc =
+	    encode_write_file_req(0, fileHandle, offset, length, requestPtr);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(requestPtr->hdr.request, PLDM_REQUEST);
+	ASSERT_EQ(requestPtr->hdr.instance_id, 0);
+	ASSERT_EQ(requestPtr->hdr.type, PLDM_OEM);
+	ASSERT_EQ(requestPtr->hdr.command, PLDM_WRITE_FILE);
+	ASSERT_EQ(le32toh(request->file_handle), fileHandle);
+	ASSERT_EQ(le32toh(request->offset), offset);
+	ASSERT_EQ(le32toh(request->length), length);
+}
+
+TEST(ReadWriteFile, testBadEncodeRequest)
+{
+	// Bad encode request for read file
+	uint32_t fileHandle = 0;
+	uint32_t offset = 0;
+	uint32_t length = 0;
+
+	std::array<uint8_t, sizeof(pldm_msg_hdr) + PLDM_READ_FILE_REQ_BYTES>
+	    requestMsg{};
+	auto requestPtr = reinterpret_cast<pldm_msg *>(requestMsg.data());
+
+	// ReadFile check invalid file length
+	auto rc =
+	    encode_read_file_req(0, fileHandle, offset, length, requestPtr);
+
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_LENGTH);
+
+	// Bad encode request for write file
+	std::array<uint8_t, sizeof(pldm_msg_hdr) + PLDM_WRITE_FILE_REQ_BYTES>
+	    requestMsgWr{};
+	auto requestWr = reinterpret_cast<pldm_msg *>(requestMsgWr.data());
+
+	// WriteFile check for invalid file length
+	rc = encode_write_file_req(0, fileHandle, offset, length, requestWr);
+
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_LENGTH);
+}
+
+TEST(ReadWriteFile, testBadEncodeResponse)
+{
+	// Bad encode response for read file
+	uint32_t length = 0;
+
+	std::array<uint8_t, sizeof(pldm_msg_hdr) + PLDM_READ_FILE_RESP_BYTES>
+	    responseMsg{};
+	auto responsePtr = reinterpret_cast<pldm_msg *>(responseMsg.data());
+
+	// ReadFile
+	auto rc = encode_read_file_resp(0, PLDM_ERROR, length, responsePtr);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(responsePtr->hdr.request, PLDM_RESPONSE);
+	ASSERT_EQ(responsePtr->hdr.instance_id, 0);
+	ASSERT_EQ(responsePtr->hdr.type, PLDM_OEM);
+	ASSERT_EQ(responsePtr->hdr.command, PLDM_READ_FILE);
+	ASSERT_EQ(responsePtr->payload[0], PLDM_ERROR);
+
+	// Bad encode response for write file
+	std::array<uint8_t, sizeof(pldm_msg_hdr) + PLDM_WRITE_FILE_RESP_BYTES>
+	    responseMsgWr{};
+	auto responseWr = reinterpret_cast<pldm_msg *>(responseMsgWr.data());
+
+	// WriteFile
+	rc = encode_write_file_resp(0, PLDM_ERROR, length, responseWr);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(responseWr->hdr.request, PLDM_RESPONSE);
+	ASSERT_EQ(responseWr->hdr.instance_id, 0);
+	ASSERT_EQ(responseWr->hdr.type, PLDM_OEM);
+	ASSERT_EQ(responseWr->hdr.command, PLDM_WRITE_FILE);
+	ASSERT_EQ(responseWr->payload[0], PLDM_ERROR);
+}
+
+TEST(ReadWriteFileByTypeMemory, testGoodDecodeRequest)
+{
+	std::array<uint8_t,
+		   PLDM_RW_FILE_BY_TYPE_MEM_REQ_BYTES + sizeof(pldm_msg_hdr)>
+	    requestMsg{};
+
+	auto requestPtr = reinterpret_cast<pldm_msg *>(requestMsg.data());
+	size_t payload_length = requestMsg.size() - sizeof(pldm_msg_hdr);
+	auto request =
+	    reinterpret_cast<pldm_read_write_file_by_type_memory_req *>(
+		requestPtr->payload);
+
+	// Random value for fileHandle, offset and length
+	uint16_t fileType = 0;
+	uint32_t fileHandle = 0x12345678;
+	uint32_t offset = 0x87654321;
+	uint32_t length = 0x13245768;
+	uint64_t address = 0x124356879ACBD456;
+
+	request->file_type = htole16(fileType);
+	request->file_handle = htole32(fileHandle);
+	request->offset = htole32(offset);
+	request->length = htole32(length);
+	request->address = htole64(address);
+
+	uint16_t retFileType = 0x1;
+	uint32_t retFileHandle = 0;
+	uint32_t retOffset = 0;
+	uint32_t retLength = 0;
+	uint64_t retAddress = 0;
+
+	// Invoke decode the read file request
+	auto rc = decode_rw_file_by_type_memory_req(
+	    requestPtr, payload_length, &retFileType, &retFileHandle,
+	    &retOffset, &retLength, &retAddress);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(fileType, retFileType);
+	ASSERT_EQ(fileHandle, retFileHandle);
+	ASSERT_EQ(offset, retOffset);
+	ASSERT_EQ(length, retLength);
+	ASSERT_EQ(address, retAddress);
+}
+
+TEST(ReadWriteFileByTypeMemory, testGoodDecodeResponse)
+{
+	std::array<uint8_t,
+		   PLDM_RW_FILE_BY_TYPE_MEM_RESP_BYTES + sizeof(pldm_msg_hdr)>
+	    responseMsg{};
+
+	auto responsePtr = reinterpret_cast<pldm_msg *>(responseMsg.data());
+	size_t payload_length = responseMsg.size() - sizeof(pldm_msg_hdr);
+	auto response =
+	    reinterpret_cast<pldm_read_write_file_by_type_memory_resp *>(
+		responsePtr->payload);
+
+	// Random value for completion code and length
+	uint8_t completionCode = 0x0;
+	uint32_t length = 0x13245768;
+
+	response->completion_code = completionCode;
+	response->length = htole32(length);
+
+	uint8_t retCompletionCode = 0x1;
+	uint32_t retLength = 0;
+
+	// Invoke decode the read/write file response
+	auto rc = decode_rw_file_by_type_memory_resp(
+	    responsePtr, payload_length, &retCompletionCode, &retLength);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(completionCode, retCompletionCode);
+	ASSERT_EQ(length, retLength);
+}
+
+TEST(ReadWriteFileByTypeMemory, testBadDecodeRequest)
+{
+	uint16_t fileType = 0;
+	uint32_t fileHandle = 0;
+	uint32_t offset = 0;
+	uint32_t length = 0;
+	uint64_t address = 0;
+
+	// Request payload message is missing
+	auto rc = decode_rw_file_by_type_memory_req(
+	    NULL, 0, &fileType, &fileHandle, &offset, &length, &address);
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+
+	std::array<uint8_t,
+		   PLDM_RW_FILE_BY_TYPE_MEM_REQ_BYTES + sizeof(pldm_msg_hdr)>
+	    requestMsg{};
+
+	auto requestPtr = reinterpret_cast<pldm_msg *>(requestMsg.data());
+
+	// Address is NULL
+	rc = decode_rw_file_by_type_memory_req(
+	    requestPtr, requestMsg.size() - hdrSize, &fileType, &fileHandle,
+	    &offset, &length, NULL);
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+
+	// Payload length is invalid
+	rc = decode_rw_file_by_type_memory_req(
+	    requestPtr, 0, &fileType, &fileHandle, &offset, &length, &address);
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_LENGTH);
+}
+
+TEST(ReadWriteFileByTypeMemory, testBadDecodeResponse)
+{
+	uint32_t length = 0;
+	uint8_t completionCode = 0;
+
+	// Request payload message is missing
+	auto rc = decode_rw_file_by_type_memory_resp(NULL, 0, &completionCode,
+						     &length);
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+
+	std::array<uint8_t,
+		   PLDM_RW_FILE_BY_TYPE_MEM_RESP_BYTES + sizeof(pldm_msg_hdr)>
+	    responseMsg{};
+
+	auto responsePtr = reinterpret_cast<pldm_msg *>(responseMsg.data());
+
+	// Length is NULL
+	rc = decode_rw_file_by_type_memory_resp(
+	    responsePtr, responseMsg.size() - hdrSize, &completionCode, NULL);
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+
+	// Payload length is invalid
+	rc = decode_rw_file_by_type_memory_resp(responsePtr, 0, &completionCode,
+						&length);
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_LENGTH);
+}
+
+TEST(ReadWriteFileByTypeMemory, testGoodEncodeRequest)
+{
+	std::array<uint8_t,
+		   sizeof(pldm_msg_hdr) + PLDM_RW_FILE_BY_TYPE_MEM_REQ_BYTES>
+	    requestMsg{};
+
+	uint16_t fileType = 0;
+	uint32_t fileHandle = 0x12345678;
+	uint32_t offset = 0x87654321;
+	uint32_t length = 0x13245768;
+	uint64_t address = 0x124356879ACBDE0F;
+	uint16_t fileTypeLe = htole16(fileType);
+	uint32_t fileHandleLe = htole32(fileHandle);
+	uint32_t offsetLe = htole32(offset);
+	uint32_t lengthLe = htole32(length);
+	uint64_t addressLe = htole64(address);
+
+	pldm_msg *request = reinterpret_cast<pldm_msg *>(requestMsg.data());
+
+	auto rc = encode_rw_file_by_type_memory_req(
+	    0, PLDM_READ_FILE_BY_TYPE_INTO_MEMORY, fileType, fileHandle, offset,
+	    length, address, request);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(request->hdr.request, PLDM_REQUEST);
+	ASSERT_EQ(request->hdr.instance_id, 0);
+	ASSERT_EQ(request->hdr.type, PLDM_OEM);
+	ASSERT_EQ(request->hdr.command, PLDM_READ_FILE_BY_TYPE_INTO_MEMORY);
+
+	ASSERT_EQ(0, memcmp(request->payload, &fileTypeLe, sizeof(fileTypeLe)));
+	ASSERT_EQ(0, memcmp(request->payload + sizeof(fileTypeLe),
+			    &fileHandleLe, sizeof(fileHandleLe)));
+
+	ASSERT_EQ(0, memcmp(request->payload + sizeof(fileTypeLe) +
+				sizeof(fileHandleLe),
+			    &offsetLe, sizeof(offsetLe)));
+	ASSERT_EQ(0, memcmp(request->payload + sizeof(fileTypeLe) +
+				sizeof(fileHandleLe) + sizeof(offsetLe),
+			    &lengthLe, sizeof(lengthLe)));
+	ASSERT_EQ(0, memcmp(request->payload + sizeof(fileTypeLe) +
+				sizeof(fileHandleLe) + sizeof(offsetLe) +
+				sizeof(lengthLe),
+			    &addressLe, sizeof(addressLe)));
+}
+
+TEST(ReadWriteFileByTypeMemory, testGoodEncodeResponse)
+{
+	std::array<uint8_t,
+		   sizeof(pldm_msg_hdr) + PLDM_RW_FILE_BY_TYPE_MEM_RESP_BYTES>
+	    responseMsg{};
+
+	uint32_t length = 0x13245768;
+	uint32_t lengthLe = htole32(length);
+	uint8_t completionCode = 0x0;
+
+	pldm_msg *response = reinterpret_cast<pldm_msg *>(responseMsg.data());
+
+	auto rc = encode_rw_file_by_type_memory_resp(
+	    0, PLDM_READ_FILE_BY_TYPE_INTO_MEMORY, completionCode, length,
+	    response);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(response->hdr.request, PLDM_RESPONSE);
+	ASSERT_EQ(response->hdr.instance_id, 0);
+	ASSERT_EQ(response->hdr.type, PLDM_OEM);
+	ASSERT_EQ(response->hdr.command, PLDM_READ_FILE_BY_TYPE_INTO_MEMORY);
+
+	ASSERT_EQ(0, memcmp(response->payload, &completionCode,
+			    sizeof(completionCode)));
+	ASSERT_EQ(0, memcmp(response->payload + sizeof(completionCode),
+			    &lengthLe, sizeof(lengthLe)));
+}
+
+TEST(ReadWriteFileByTypeMemory, testBadEncodeResponse)
+{
+	std::array<uint8_t,
+		   sizeof(pldm_msg_hdr) + PLDM_RW_FILE_BY_TYPE_MEM_RESP_BYTES>
+	    responseMsg{};
+	uint32_t length = 0;
+	pldm_msg *response = reinterpret_cast<pldm_msg *>(responseMsg.data());
+
+	// completion code is PLDM_ERROR
+	auto rc = encode_rw_file_by_type_memory_resp(
+	    0, PLDM_READ_FILE_BY_TYPE_INTO_MEMORY, PLDM_ERROR, length,
+	    response);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(response->hdr.request, PLDM_RESPONSE);
+	ASSERT_EQ(response->hdr.instance_id, 0);
+	ASSERT_EQ(response->hdr.type, PLDM_OEM);
+	ASSERT_EQ(response->hdr.command, PLDM_READ_FILE_BY_TYPE_INTO_MEMORY);
+	ASSERT_EQ(response->payload[0], PLDM_ERROR);
+
+	// response is NULL pointer
+	rc = encode_rw_file_by_type_memory_resp(
+	    0, PLDM_READ_FILE_BY_TYPE_INTO_MEMORY, PLDM_SUCCESS, length, NULL);
+
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+}
+
+TEST(ReadWriteFileByTypeMemory, testBadEncodeRequest)
+{
+	uint8_t fileType = 0;
+	uint32_t fileHandle = 0;
+	uint32_t offset = 0;
+	uint32_t length = 0;
+	uint64_t address = 0;
+
+	// request is NULL pointer
+	auto rc = encode_rw_file_by_type_memory_req(
+	    0, PLDM_READ_FILE_BY_TYPE_INTO_MEMORY, fileType, fileHandle, offset,
+	    length, address, NULL);
+
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+}
+
+TEST(NewFile, testGoodDecodeRequest)
+{
+	std::array<uint8_t, PLDM_NEW_FILE_REQ_BYTES + sizeof(pldm_msg_hdr)>
+	    requestMsg{};
+
+	auto requestPtr = reinterpret_cast<pldm_msg *>(requestMsg.data());
+	size_t payload_length = requestMsg.size() - sizeof(pldm_msg_hdr);
+	auto request =
+	    reinterpret_cast<pldm_new_file_req *>(requestPtr->payload);
+
+	// Random value for fileHandle and length
+	uint16_t fileType = 0xFF;
+	uint32_t fileHandle = 0x12345678;
+	uint64_t length = 0x13245768;
+
+	request->file_type = htole16(fileType);
+	request->file_handle = htole32(fileHandle);
+	request->length = htole64(length);
+
+	uint16_t retFileType = 0xFF;
+	uint32_t retFileHandle = 0;
+	uint64_t retLength = 0;
+
+	// Invoke decode the read file request
+	auto rc = decode_new_file_req(requestPtr, payload_length, &retFileType,
+				      &retFileHandle, &retLength);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(fileType, retFileType);
+	ASSERT_EQ(fileHandle, retFileHandle);
+	ASSERT_EQ(length, retLength);
+}
+
+TEST(NewFile, testGoodDecodeResponse)
+{
+	std::array<uint8_t, PLDM_NEW_FILE_RESP_BYTES + sizeof(pldm_msg_hdr)>
+	    responseMsg{};
+
+	auto responsePtr = reinterpret_cast<pldm_msg *>(responseMsg.data());
+	size_t payload_length = responseMsg.size() - sizeof(pldm_msg_hdr);
+	auto response =
+	    reinterpret_cast<pldm_new_file_resp *>(responsePtr->payload);
+
+	// Random value for completion code
+	uint8_t completionCode = 0x0;
+
+	response->completion_code = completionCode;
+
+	uint8_t retCompletionCode = PLDM_SUCCESS;
+
+	// Invoke decode the read/write file response
+	auto rc = decode_new_file_resp(responsePtr, payload_length,
+				       &retCompletionCode);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(completionCode, retCompletionCode);
+}
+
+TEST(NewFile, testBadDecodeRequest)
+{
+	uint16_t fileType = 0;
+	uint32_t fileHandle = 0;
+	uint64_t length = 0;
+
+	// Request payload message is missing
+	auto rc = decode_new_file_req(NULL, 0, &fileType, &fileHandle, &length);
+
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+
+	std::array<uint8_t, PLDM_NEW_FILE_REQ_BYTES + sizeof(pldm_msg_hdr)>
+	    requestMsg{};
+
+	auto requestPtr = reinterpret_cast<pldm_msg *>(requestMsg.data());
+
+	// Payload length is invalid
+	rc =
+	    decode_new_file_req(requestPtr, 0, &fileType, &fileHandle, &length);
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_LENGTH);
+}
+
+TEST(NewFile, testBadDecodeResponse)
+{
+	uint8_t completionCode = 0;
+
+	// Request payload message is missing
+	auto rc = decode_new_file_resp(NULL, 0, &completionCode);
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+
+	std::array<uint8_t, PLDM_NEW_FILE_RESP_BYTES + sizeof(pldm_msg_hdr)>
+	    responseMsg{};
+
+	auto responsePtr = reinterpret_cast<pldm_msg *>(responseMsg.data());
+
+	// Payload length is invalid
+	rc = decode_new_file_resp(responsePtr, 0, &completionCode);
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_LENGTH);
+}
+
+TEST(NewFile, testGoodEncodeRequest)
+{
+	std::array<uint8_t, sizeof(pldm_msg_hdr) + PLDM_NEW_FILE_REQ_BYTES>
+	    requestMsg{};
+
+	uint16_t fileType = 0xFF;
+	uint32_t fileHandle = 0x12345678;
+	uint32_t length = 0x13245768;
+	uint16_t fileTypeLe = htole16(fileType);
+	uint32_t fileHandleLe = htole32(fileHandle);
+	uint32_t lengthLe = htole32(length);
+
+	pldm_msg *request = reinterpret_cast<pldm_msg *>(requestMsg.data());
+
+	auto rc = encode_new_file_req(0, fileType, fileHandle, length, request);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(request->hdr.request, PLDM_REQUEST);
+	ASSERT_EQ(request->hdr.instance_id, 0);
+	ASSERT_EQ(request->hdr.type, PLDM_OEM);
+	ASSERT_EQ(request->hdr.command, PLDM_NEW_FILE_AVAILABLE);
+	ASSERT_EQ(0, memcmp(request->payload, &fileTypeLe, sizeof(fileTypeLe)));
+	ASSERT_EQ(0, memcmp(request->payload + sizeof(fileTypeLe),
+			    &fileHandleLe, sizeof(fileHandleLe)));
+	ASSERT_EQ(0, memcmp(request->payload + sizeof(fileTypeLe) +
+				sizeof(fileHandleLe),
+			    &lengthLe, sizeof(lengthLe)));
+}
+
+TEST(NewFile, testGoodEncodeResponse)
+{
+	std::array<uint8_t, sizeof(pldm_msg_hdr) + PLDM_NEW_FILE_RESP_BYTES>
+	    responseMsg{};
+
+	uint8_t completionCode = 0x0;
+
+	pldm_msg *response = reinterpret_cast<pldm_msg *>(responseMsg.data());
+
+	auto rc = encode_new_file_resp(0, completionCode, response);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(response->hdr.request, PLDM_RESPONSE);
+	ASSERT_EQ(response->hdr.instance_id, 0);
+	ASSERT_EQ(response->hdr.type, PLDM_OEM);
+	ASSERT_EQ(response->hdr.command, PLDM_NEW_FILE_AVAILABLE);
+	ASSERT_EQ(0, memcmp(response->payload, &completionCode,
+			    sizeof(completionCode)));
+}
+
+TEST(NewFile, testBadEncodeResponse)
+{
+	std::array<uint8_t, sizeof(pldm_msg_hdr) + PLDM_NEW_FILE_RESP_BYTES>
+	    responseMsg{};
+	pldm_msg *response = reinterpret_cast<pldm_msg *>(responseMsg.data());
+
+	// completion code is PLDM_ERROR
+	auto rc = encode_new_file_resp(0, PLDM_ERROR, response);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(response->hdr.request, PLDM_RESPONSE);
+	ASSERT_EQ(response->hdr.instance_id, 0);
+	ASSERT_EQ(response->hdr.type, PLDM_OEM);
+	ASSERT_EQ(response->hdr.command, PLDM_NEW_FILE_AVAILABLE);
+	ASSERT_EQ(response->payload[0], PLDM_ERROR);
+
+	// response is NULL pointer
+	rc = encode_new_file_resp(0, PLDM_SUCCESS, NULL);
+
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+}
+
+TEST(NewFile, testBadEncodeRequest)
+{
+	uint8_t fileType = 0xFF;
+	uint32_t fileHandle = 0;
+	uint32_t length = 0;
+
+	// request is NULL pointer
+	auto rc = encode_new_file_req(0, fileType, fileHandle, length, NULL);
+
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+}
+
+TEST(ReadWriteFileByType, testGoodDecodeRequest)
+{
+	std::array<uint8_t,
+		   PLDM_RW_FILE_BY_TYPE_REQ_BYTES + sizeof(pldm_msg_hdr)>
+	    requestMsg{};
+
+	auto requestPtr = reinterpret_cast<pldm_msg *>(requestMsg.data());
+	size_t payload_length = requestMsg.size() - sizeof(pldm_msg_hdr);
+	auto request = reinterpret_cast<pldm_read_write_file_by_type_req *>(
+	    requestPtr->payload);
+
+	// Random value for fileHandle, offset and length
+	uint16_t fileType = 0;
+	uint32_t fileHandle = 0x12345678;
+	uint32_t offset = 0x87654321;
+	uint32_t length = 0x13245768;
+
+	request->file_handle = htole32(fileHandle);
+	request->offset = htole32(offset);
+	request->length = htole32(length);
+
+	uint16_t retFileType = 0x1;
+	uint32_t retFileHandle = 0;
+	uint32_t retOffset = 0;
+	uint32_t retLength = 0;
+
+	// Invoke decode the read file request
+	auto rc =
+	    decode_rw_file_by_type_req(requestPtr, payload_length, &retFileType,
+				       &retFileHandle, &retOffset, &retLength);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(fileType, retFileType);
+	ASSERT_EQ(fileHandle, retFileHandle);
+	ASSERT_EQ(offset, retOffset);
+	ASSERT_EQ(length, retLength);
+}
+
+TEST(ReadWriteFileByType, testGoodDecodeResponse)
+{
+	std::array<uint8_t,
+		   PLDM_RW_FILE_BY_TYPE_RESP_BYTES + sizeof(pldm_msg_hdr)>
+	    responseMsg{};
+
+	auto responsePtr = reinterpret_cast<pldm_msg *>(responseMsg.data());
+	size_t payload_length = responseMsg.size() - sizeof(pldm_msg_hdr);
+	auto response = reinterpret_cast<pldm_read_write_file_by_type_resp *>(
+	    responsePtr->payload);
+
+	// Random value for completion code and length
+	uint8_t completionCode = 0x0;
+	uint32_t length = 0x13245768;
+
+	response->completion_code = completionCode;
+	response->length = htole32(length);
+
+	uint8_t retCompletionCode = 0x1;
+	uint32_t retLength = 0;
+
+	// Invoke decode the read/write file response
+	auto rc = decode_rw_file_by_type_resp(responsePtr, payload_length,
+					      &retCompletionCode, &retLength);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(completionCode, retCompletionCode);
+	ASSERT_EQ(length, retLength);
+}
+
+TEST(ReadWriteFileByType, testBadDecodeRequest)
+{
+	uint16_t fileType = 0;
+	uint32_t fileHandle = 0;
+	uint32_t offset = 0;
+	uint32_t length = 0;
+
+	// Request payload message is missing
+	auto rc = decode_rw_file_by_type_req(NULL, 0, &fileType, &fileHandle,
+					     &offset, &length);
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+
+	std::array<uint8_t,
+		   PLDM_RW_FILE_BY_TYPE_REQ_BYTES + sizeof(pldm_msg_hdr)>
+	    requestMsg{};
+
+	auto requestPtr = reinterpret_cast<pldm_msg *>(requestMsg.data());
+
+	// Payload length is invalid
+	rc = decode_rw_file_by_type_req(requestPtr, 0, &fileType, &fileHandle,
+					&offset, &length);
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_LENGTH);
+}
+
+TEST(ReadWriteFileByType, testBadDecodeResponse)
+{
+	uint32_t length = 0;
+	uint8_t completionCode = 0;
+
+	// Request payload message is missing
+	auto rc =
+	    decode_rw_file_by_type_resp(NULL, 0, &completionCode, &length);
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+
+	std::array<uint8_t,
+		   PLDM_RW_FILE_BY_TYPE_RESP_BYTES + sizeof(pldm_msg_hdr)>
+	    responseMsg{};
+
+	auto responsePtr = reinterpret_cast<pldm_msg *>(responseMsg.data());
+
+	// Length is NULL
+	rc = decode_rw_file_by_type_resp(
+	    responsePtr, responseMsg.size() - hdrSize, &completionCode, NULL);
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+
+	// Payload length is invalid
+	rc = decode_rw_file_by_type_resp(responsePtr, 0, &completionCode,
+					 &length);
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_LENGTH);
+}
+
+TEST(ReadWriteFileByType, testGoodEncodeRequest)
+{
+	std::array<uint8_t,
+		   sizeof(pldm_msg_hdr) + PLDM_RW_FILE_BY_TYPE_REQ_BYTES>
+	    requestMsg{};
+
+	uint16_t fileType = 0;
+	uint32_t fileHandle = 0x12345678;
+	uint32_t offset = 0x87654321;
+	uint32_t length = 0x13245768;
+	uint16_t fileTypeLe = htole16(fileType);
+	uint32_t fileHandleLe = htole32(fileHandle);
+	uint32_t offsetLe = htole32(offset);
+	uint32_t lengthLe = htole32(length);
+
+	pldm_msg *request = reinterpret_cast<pldm_msg *>(requestMsg.data());
+
+	auto rc =
+	    encode_rw_file_by_type_req(0, PLDM_READ_FILE_BY_TYPE, fileType,
+				       fileHandle, offset, length, request);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(request->hdr.request, PLDM_REQUEST);
+	ASSERT_EQ(request->hdr.instance_id, 0);
+	ASSERT_EQ(request->hdr.type, PLDM_OEM);
+	ASSERT_EQ(request->hdr.command, PLDM_READ_FILE_BY_TYPE);
+
+	ASSERT_EQ(0, memcmp(request->payload, &fileTypeLe, sizeof(fileTypeLe)));
+	ASSERT_EQ(0, memcmp(request->payload + sizeof(fileTypeLe),
+			    &fileHandleLe, sizeof(fileHandleLe)));
+
+	ASSERT_EQ(0, memcmp(request->payload + sizeof(fileTypeLe) +
+				sizeof(fileHandleLe),
+			    &offsetLe, sizeof(offsetLe)));
+	ASSERT_EQ(0, memcmp(request->payload + sizeof(fileTypeLe) +
+				sizeof(fileHandleLe) + sizeof(offsetLe),
+			    &lengthLe, sizeof(lengthLe)));
+}
+
+TEST(ReadWriteFileByType, testGoodEncodeResponse)
+{
+	std::array<uint8_t,
+		   sizeof(pldm_msg_hdr) + PLDM_RW_FILE_BY_TYPE_RESP_BYTES>
+	    responseMsg{};
+
+	uint32_t length = 0x13245768;
+	uint32_t lengthLe = htole32(length);
+	uint8_t completionCode = 0x0;
+	pldm_msg *response = reinterpret_cast<pldm_msg *>(responseMsg.data());
+
+	auto rc = encode_rw_file_by_type_resp(0, PLDM_READ_FILE_BY_TYPE,
+					      completionCode, length, response);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(response->hdr.request, PLDM_RESPONSE);
+	ASSERT_EQ(response->hdr.instance_id, 0);
+	ASSERT_EQ(response->hdr.type, PLDM_OEM);
+	ASSERT_EQ(response->hdr.command, PLDM_READ_FILE_BY_TYPE);
+
+	ASSERT_EQ(0, memcmp(response->payload, &completionCode,
+			    sizeof(completionCode)));
+	ASSERT_EQ(0, memcmp(response->payload + sizeof(completionCode),
+			    &lengthLe, sizeof(lengthLe)));
+}
+
+TEST(ReadWriteFileByType, testBadEncodeResponse)
+{
+	std::array<uint8_t,
+		   sizeof(pldm_msg_hdr) + PLDM_RW_FILE_BY_TYPE_RESP_BYTES>
+	    responseMsg{};
+	uint32_t length = 0;
+	pldm_msg *response = reinterpret_cast<pldm_msg *>(responseMsg.data());
+
+	// completion code is PLDM_ERROR
+	auto rc = encode_rw_file_by_type_resp(0, PLDM_READ_FILE_BY_TYPE,
+					      PLDM_ERROR, length, response);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(response->hdr.request, PLDM_RESPONSE);
+	ASSERT_EQ(response->hdr.instance_id, 0);
+	ASSERT_EQ(response->hdr.type, PLDM_OEM);
+	ASSERT_EQ(response->hdr.command, PLDM_READ_FILE_BY_TYPE);
+	ASSERT_EQ(response->payload[0], PLDM_ERROR);
+
+	// response is NULL pointer
+	rc = encode_rw_file_by_type_resp(0, PLDM_READ_FILE_BY_TYPE,
+					 PLDM_SUCCESS, length, NULL);
+
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+}
+
+TEST(ReadWriteFileByType, testBadEncodeRequest)
+{
+	uint8_t fileType = 0;
+	uint32_t fileHandle = 0;
+	uint32_t offset = 0;
+	uint32_t length = 0;
+
+	// request is NULL pointer
+	auto rc =
+	    encode_rw_file_by_type_req(0, PLDM_READ_FILE_BY_TYPE, fileType,
+				       fileHandle, offset, length, NULL);
+
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+}
+
+TEST(FileAck, testGoodDecodeRequest)
+{
+	std::array<uint8_t, PLDM_FILE_ACK_REQ_BYTES + sizeof(pldm_msg_hdr)>
+	    requestMsg{};
+
+	auto requestPtr = reinterpret_cast<pldm_msg *>(requestMsg.data());
+	size_t payload_length = requestMsg.size() - sizeof(pldm_msg_hdr);
+	auto request =
+	    reinterpret_cast<pldm_file_ack_req *>(requestPtr->payload);
+
+	// Random value for fileHandle
+	uint16_t fileType = 0xFFFF;
+	uint32_t fileHandle = 0x12345678;
+	uint8_t fileStatus = 0xFF;
+
+	request->file_type = htole16(fileType);
+	request->file_handle = htole32(fileHandle);
+	request->file_status = fileStatus;
+
+	uint16_t retFileType = 0xFF;
+	uint32_t retFileHandle = 0;
+	uint8_t retFileStatus = 0;
+
+	// Invoke decode the read file request
+	auto rc = decode_file_ack_req(requestPtr, payload_length, &retFileType,
+				      &retFileHandle, &retFileStatus);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(fileType, retFileType);
+	ASSERT_EQ(fileHandle, retFileHandle);
+	ASSERT_EQ(fileStatus, retFileStatus);
+}
+
+TEST(FileAck, testGoodDecodeResponse)
+{
+	std::array<uint8_t, PLDM_FILE_ACK_RESP_BYTES + sizeof(pldm_msg_hdr)>
+	    responseMsg{};
+
+	auto responsePtr = reinterpret_cast<pldm_msg *>(responseMsg.data());
+	size_t payload_length = responseMsg.size() - sizeof(pldm_msg_hdr);
+	auto response =
+	    reinterpret_cast<pldm_file_ack_resp *>(responsePtr->payload);
+
+	// Random value for completion code
+	uint8_t completionCode = 0x0;
+
+	response->completion_code = completionCode;
+
+	uint8_t retCompletionCode = PLDM_SUCCESS;
+
+	// Invoke decode the read/write file response
+	auto rc = decode_file_ack_resp(responsePtr, payload_length,
+				       &retCompletionCode);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(completionCode, retCompletionCode);
+}
+
+TEST(FileAck, testBadDecodeRequest)
+{
+	uint16_t fileType = 0;
+	uint32_t fileHandle = 0;
+	uint8_t fileStatus = 0;
+
+	// Request payload message is missing
+	auto rc =
+	    decode_file_ack_req(NULL, 0, &fileType, &fileHandle, &fileStatus);
+
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+
+	std::array<uint8_t, PLDM_FILE_ACK_REQ_BYTES + sizeof(pldm_msg_hdr)>
+	    requestMsg{};
+
+	auto requestPtr = reinterpret_cast<pldm_msg *>(requestMsg.data());
+
+	// Payload length is invalid
+	rc = decode_file_ack_req(requestPtr, 0, &fileType, &fileHandle,
+				 &fileStatus);
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_LENGTH);
+}
+
+TEST(FileAck, testBadDecodeResponse)
+{
+	uint8_t completionCode = 0;
+
+	// Request payload message is missing
+	auto rc = decode_file_ack_resp(NULL, 0, &completionCode);
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+
+	std::array<uint8_t, PLDM_FILE_ACK_RESP_BYTES + sizeof(pldm_msg_hdr)>
+	    responseMsg{};
+
+	auto responsePtr = reinterpret_cast<pldm_msg *>(responseMsg.data());
+
+	// Payload length is invalid
+	rc = decode_file_ack_resp(responsePtr, 0, &completionCode);
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_LENGTH);
+}
+
+TEST(FileAck, testGoodEncodeRequest)
+{
+	std::array<uint8_t, sizeof(pldm_msg_hdr) + PLDM_FILE_ACK_REQ_BYTES>
+	    requestMsg{};
+
+	uint16_t fileType = 0xFFFF;
+	uint32_t fileHandle = 0x12345678;
+	uint8_t fileStatus = 0xFF;
+	uint16_t fileTypeLe = htole16(fileType);
+	uint32_t fileHandleLe = htole32(fileHandle);
+
+	pldm_msg *request = reinterpret_cast<pldm_msg *>(requestMsg.data());
+
+	auto rc =
+	    encode_file_ack_req(0, fileType, fileHandle, fileStatus, request);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(request->hdr.request, PLDM_REQUEST);
+	ASSERT_EQ(request->hdr.instance_id, 0);
+	ASSERT_EQ(request->hdr.type, PLDM_OEM);
+	ASSERT_EQ(request->hdr.command, PLDM_FILE_ACK);
+	ASSERT_EQ(0, memcmp(request->payload, &fileTypeLe, sizeof(fileTypeLe)));
+	ASSERT_EQ(0, memcmp(request->payload + sizeof(fileTypeLe),
+			    &fileHandleLe, sizeof(fileHandleLe)));
+}
+
+TEST(FileAck, testGoodEncodeResponse)
+{
+	std::array<uint8_t, sizeof(pldm_msg_hdr) + PLDM_FILE_ACK_RESP_BYTES>
+	    responseMsg{};
+
+	uint8_t completionCode = 0x0;
+
+	pldm_msg *response = reinterpret_cast<pldm_msg *>(responseMsg.data());
+
+	auto rc = encode_file_ack_resp(0, completionCode, response);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(response->hdr.request, PLDM_RESPONSE);
+	ASSERT_EQ(response->hdr.instance_id, 0);
+	ASSERT_EQ(response->hdr.type, PLDM_OEM);
+	ASSERT_EQ(response->hdr.command, PLDM_FILE_ACK);
+	ASSERT_EQ(0, memcmp(response->payload, &completionCode,
+			    sizeof(completionCode)));
+}
+
+TEST(FileAck, testBadEncodeResponse)
+{
+	std::array<uint8_t, sizeof(pldm_msg_hdr) + PLDM_FILE_ACK_RESP_BYTES>
+	    responseMsg{};
+	pldm_msg *response = reinterpret_cast<pldm_msg *>(responseMsg.data());
+
+	// completion code is PLDM_ERROR
+	auto rc = encode_file_ack_resp(0, PLDM_ERROR, response);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(response->hdr.request, PLDM_RESPONSE);
+	ASSERT_EQ(response->hdr.instance_id, 0);
+	ASSERT_EQ(response->hdr.type, PLDM_OEM);
+	ASSERT_EQ(response->hdr.command, PLDM_FILE_ACK);
+	ASSERT_EQ(response->payload[0], PLDM_ERROR);
+
+	// response is NULL pointer
+	rc = encode_file_ack_resp(0, PLDM_SUCCESS, NULL);
+
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+}
+
+TEST(FileAck, testBadEncodeRequest)
+{
+	uint8_t fileType = 0xFF;
+	uint32_t fileHandle = 0;
+	uint8_t fileStatus = 0;
+
+	// request is NULL pointer
+	auto rc =
+	    encode_file_ack_req(0, fileType, fileHandle, fileStatus, nullptr);
+
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+}
+
+TEST(FileAckWithMetadata, testGoodEncodeResponse)
+{
+	std::array<uint8_t, sizeof(pldm_msg_hdr) +
+				PLDM_FILE_ACK_WITH_META_DATA_RESP_BYTES>
+	    responseMsg{};
+
+	uint8_t completionCode = 0x0;
+
+	pldm_msg *response = reinterpret_cast<pldm_msg *>(responseMsg.data());
+
+	auto rc =
+	    encode_file_ack_with_meta_data_resp(0, completionCode, response);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(response->hdr.request, PLDM_RESPONSE);
+	ASSERT_EQ(response->hdr.instance_id, 0);
+	ASSERT_EQ(response->hdr.type, PLDM_OEM);
+	ASSERT_EQ(response->hdr.command, PLDM_FILE_ACK_WITH_META_DATA);
+	ASSERT_EQ(0, memcmp(response->payload, &completionCode,
+			    sizeof(completionCode)));
+}
+
+TEST(FileAckWithMetadata, testBadEncodeResponse)
+{
+	std::array<uint8_t, sizeof(pldm_msg_hdr) +
+				PLDM_FILE_ACK_WITH_META_DATA_RESP_BYTES>
+	    responseMsg{};
+	pldm_msg *response = reinterpret_cast<pldm_msg *>(responseMsg.data());
+
+	// completion code is PLDM_ERROR
+	auto rc = encode_file_ack_with_meta_data_resp(0, PLDM_ERROR, response);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(response->hdr.request, PLDM_RESPONSE);
+	ASSERT_EQ(response->hdr.instance_id, 0);
+	ASSERT_EQ(response->hdr.type, PLDM_OEM);
+	ASSERT_EQ(response->hdr.command, PLDM_FILE_ACK_WITH_META_DATA);
+	ASSERT_EQ(response->payload[0], PLDM_ERROR);
+
+	// response is NULL pointer
+	rc = encode_file_ack_with_meta_data_resp(0, PLDM_SUCCESS, NULL);
+
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+}
+
+TEST(FileAckWithMetadata, testGoodDecodeResponse)
+{
+	std::array<uint8_t, PLDM_FILE_ACK_WITH_META_DATA_RESP_BYTES +
+				sizeof(pldm_msg_hdr)>
+	    responseMsg{};
+
+	auto responsePtr = reinterpret_cast<pldm_msg *>(responseMsg.data());
+	size_t payload_length = responseMsg.size() - sizeof(pldm_msg_hdr);
+	auto response = reinterpret_cast<pldm_file_ack_with_meta_data_resp *>(
+	    responsePtr->payload);
+
+	// Random value for completion code
+	uint8_t completionCode = 0x0;
+
+	response->completion_code = completionCode;
+
+	uint8_t retCompletionCode = PLDM_SUCCESS;
+
+	// Invoke decode the read/write file response
+	auto rc = decode_file_ack_with_meta_data_resp(
+	    responsePtr, payload_length, &retCompletionCode);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(completionCode, retCompletionCode);
+}
+
+TEST(FileAckWithMetadata, testBadDecodeResponse)
+{
+	uint8_t completionCode = 0;
+
+	// Request payload message is missing
+	auto rc = decode_file_ack_with_meta_data_resp(NULL, 0, &completionCode);
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+
+	std::array<uint8_t, PLDM_FILE_ACK_WITH_META_DATA_RESP_BYTES +
+				sizeof(pldm_msg_hdr)>
+	    responseMsg{};
+
+	auto responsePtr = reinterpret_cast<pldm_msg *>(responseMsg.data());
+
+	// Payload length is invalid
+	rc = decode_file_ack_with_meta_data_resp(responsePtr, 0,
+						 &completionCode);
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_LENGTH);
+}
+
+TEST(FileAckWithMetadata, testGoodEncodeRequest)
+{
+	std::array<uint8_t, sizeof(pldm_msg_hdr) +
+				PLDM_FILE_ACK_WITH_META_DATA_REQ_BYTES>
+	    requestMsg{};
+
+	uint16_t fileType = 0xFFFF;
+	uint32_t fileHandle = 0x12345678;
+	uint8_t fileStatus = 0xFF;
+	uint32_t fileMetaData1 = 0xFFFFFFFF;
+	uint32_t fileMetaData2 = 0xFFFFFFFF;
+	uint32_t fileMetaData3 = 0xFFFFFFFF;
+	uint32_t fileMetaData4 = 0xFFFFFFFF;
+
+	uint16_t fileTypeLe = htole16(fileType);
+	uint32_t fileHandleLe = htole32(fileHandle);
+	uint32_t fileMetaData1Le = htole32(fileMetaData1);
+	uint32_t fileMetaData2Le = htole32(fileMetaData2);
+	uint32_t fileMetaData3Le = htole32(fileMetaData3);
+	uint32_t fileMetaData4Le = htole32(fileMetaData4);
+
+	pldm_msg *request = reinterpret_cast<pldm_msg *>(requestMsg.data());
+
+	auto rc = encode_file_ack_with_meta_data_req(
+	    0, fileType, fileHandle, fileStatus, fileMetaData1, fileMetaData2,
+	    fileMetaData3, fileMetaData4, request);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(request->hdr.request, PLDM_REQUEST);
+	ASSERT_EQ(request->hdr.instance_id, 0);
+	ASSERT_EQ(request->hdr.type, PLDM_OEM);
+	ASSERT_EQ(request->hdr.command, PLDM_FILE_ACK_WITH_META_DATA);
+	ASSERT_EQ(0, memcmp(request->payload, &fileTypeLe, sizeof(fileTypeLe)));
+	ASSERT_EQ(0, memcmp(request->payload + sizeof(fileTypeLe),
+			    &fileHandleLe, sizeof(fileHandleLe)));
+	ASSERT_EQ(0, memcmp(request->payload + sizeof(fileTypeLe) +
+				sizeof(fileHandleLe),
+			    &fileStatus, sizeof(fileStatus)));
+	ASSERT_EQ(0, memcmp(request->payload + sizeof(fileTypeLe) +
+				sizeof(fileHandleLe) + sizeof(fileStatus),
+			    &fileMetaData1Le, sizeof(fileMetaData1Le)));
+	ASSERT_EQ(0, memcmp(request->payload + sizeof(fileTypeLe) +
+				sizeof(fileHandleLe) + sizeof(fileStatus) +
+				sizeof(fileMetaData1Le),
+			    &fileMetaData2Le, sizeof(fileMetaData2Le)));
+
+	ASSERT_EQ(0,
+		  memcmp(request->payload + sizeof(fileTypeLe) +
+			     sizeof(fileHandleLe) + sizeof(fileStatus) +
+			     sizeof(fileMetaData1Le) + sizeof(fileMetaData2Le),
+			 &fileMetaData3Le, sizeof(fileMetaData3Le)));
+
+	ASSERT_EQ(0,
+		  memcmp(request->payload + sizeof(fileTypeLe) +
+			     sizeof(fileHandleLe) + sizeof(fileStatus) +
+			     sizeof(fileMetaData1Le) + sizeof(fileMetaData2Le) +
+			     sizeof(fileMetaData3Le),
+			 &fileMetaData4Le, sizeof(fileMetaData4Le)));
+}
+
+TEST(FileAckWithMetadata, testBadEncodeRequest)
+{
+	uint8_t fileType = 0xFF;
+	uint32_t fileHandle = 0;
+	uint8_t fileStatus = 0;
+	uint32_t fileMetaData1 = 0;
+	uint32_t fileMetaData2 = 0;
+	uint32_t fileMetaData3 = 0;
+	uint32_t fileMetaData4 = 0;
+
+	// request is NULL pointer
+	auto rc = encode_file_ack_with_meta_data_req(
+	    0, fileType, fileHandle, fileStatus, fileMetaData1, fileMetaData2,
+	    fileMetaData3, fileMetaData4, nullptr);
+
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+}
+
+TEST(FileAckWithMetadata, testGoodDecodeRequest)
+{
+	std::array<uint8_t, sizeof(pldm_msg_hdr) +
+				PLDM_FILE_ACK_WITH_META_DATA_REQ_BYTES>
+	    requestMsg{};
+
+	auto requestPtr = reinterpret_cast<pldm_msg *>(requestMsg.data());
+	size_t payload_length = requestMsg.size() - sizeof(pldm_msg_hdr);
+	auto request = reinterpret_cast<pldm_file_ack_with_meta_data_req *>(
+	    requestPtr->payload);
+
+	uint16_t fileType = 0xFFFF;
+	uint32_t fileHandle = 0x12345678;
+	uint8_t fileStatus = 0xFF;
+	uint32_t fileMetaData1 = 0x12345678;
+	uint32_t fileMetaData2 = 0x87654321;
+	uint32_t fileMetaData3 = 0x22121117;
+	uint32_t fileMetaData4 = 0x12334345;
+
+	request->file_type = htole16(fileType);
+	request->file_handle = htole32(fileHandle);
+	request->file_status = fileStatus;
+	request->file_meta_data_1 = htole32(fileMetaData1);
+	request->file_meta_data_2 = htole32(fileMetaData2);
+	request->file_meta_data_3 = htole32(fileMetaData3);
+	request->file_meta_data_4 = htole32(fileMetaData4);
+
+	uint16_t retFileType = 0xFFFF;
+	uint32_t retFileHandle = 0;
+	uint8_t retFileStatus = 0;
+	uint32_t retFileMetaData1 = 0;
+	uint32_t retFileMetaData2 = 0;
+	uint32_t retFileMetaData3 = 0;
+	uint32_t retFileMetaData4 = 0;
+
+	auto rc = decode_file_ack_with_meta_data_req(
+	    requestPtr, payload_length, &retFileType, &retFileHandle,
+	    &retFileStatus, &retFileMetaData1, &retFileMetaData2,
+	    &retFileMetaData3, &retFileMetaData4);
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(fileType, retFileType);
+	ASSERT_EQ(fileHandle, retFileHandle);
+	ASSERT_EQ(fileStatus, retFileStatus);
+	ASSERT_EQ(fileMetaData1, retFileMetaData1);
+	ASSERT_EQ(fileMetaData2, retFileMetaData2);
+	ASSERT_EQ(fileMetaData3, retFileMetaData3);
+	ASSERT_EQ(fileMetaData4, retFileMetaData4);
+}
+
+TEST(FileAckWithMetadata, testBadDecodeRequest)
+{
+	uint16_t fileType = 0;
+	uint32_t fileHandle = 0;
+	uint8_t fileStatus = 0;
+	uint32_t fileMetaData1 = 0;
+	uint32_t fileMetaData2 = 0;
+	uint32_t fileMetaData3 = 0;
+	uint32_t fileMetaData4 = 0;
+
+	// Request payload message is missing
+	auto rc = decode_file_ack_with_meta_data_req(
+	    NULL, 0, &fileType, &fileHandle, &fileStatus, &fileMetaData1,
+	    &fileMetaData2, &fileMetaData3, &fileMetaData4);
+
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+
+	std::array<uint8_t, PLDM_FILE_ACK_WITH_META_DATA_REQ_BYTES +
+				sizeof(pldm_msg_hdr)>
+	    requestMsg{};
+
+	auto requestPtr = reinterpret_cast<pldm_msg *>(requestMsg.data());
+
+	// Payload length is invalid
+	rc = decode_file_ack_with_meta_data_req(
+	    requestPtr, 0, &fileType, &fileHandle, &fileStatus, &fileMetaData1,
+	    &fileMetaData2, &fileMetaData3, &fileMetaData4);
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_LENGTH);
+}
+
+TEST(NewFileAvailableWithMetaData, testGoodEncodeResponse)
+{
+	std::array<uint8_t,
+		   sizeof(pldm_msg_hdr) +
+		       PLDM_NEW_FILE_AVAILABLE_WITH_META_DATA_RESP_BYTES>
+	    responseMsg{};
+
+	uint8_t completionCode = 0x0;
+
+	pldm_msg *response = reinterpret_cast<pldm_msg *>(responseMsg.data());
+
+	auto rc =
+	    encode_new_file_with_metadata_resp(0, completionCode, response);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(response->hdr.request, PLDM_RESPONSE);
+	ASSERT_EQ(response->hdr.instance_id, 0);
+	ASSERT_EQ(response->hdr.type, PLDM_OEM);
+	ASSERT_EQ(response->hdr.command,
+		  PLDM_NEW_FILE_AVAILABLE_WITH_META_DATA);
+	ASSERT_EQ(0, memcmp(response->payload, &completionCode,
+			    sizeof(completionCode)));
+}
+
+TEST(NewFileAvailableWithMetaData, testBadEncodeResponse)
+{
+	std::array<uint8_t,
+		   sizeof(pldm_msg_hdr) +
+		       PLDM_NEW_FILE_AVAILABLE_WITH_META_DATA_RESP_BYTES>
+	    responseMsg{};
+	pldm_msg *response = reinterpret_cast<pldm_msg *>(responseMsg.data());
+
+	// completion code is PLDM_ERROR
+	auto rc = encode_new_file_with_metadata_resp(0, PLDM_ERROR, response);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(response->hdr.request, PLDM_RESPONSE);
+	ASSERT_EQ(response->hdr.instance_id, 0);
+	ASSERT_EQ(response->hdr.type, PLDM_OEM);
+	ASSERT_EQ(response->hdr.command,
+		  PLDM_NEW_FILE_AVAILABLE_WITH_META_DATA);
+	ASSERT_EQ(response->payload[0], PLDM_ERROR);
+
+	// response is NULL pointer
+	rc = encode_new_file_resp(0, PLDM_SUCCESS, NULL);
+
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+}
+
+TEST(NewFileAvailableWithMetaData, testGoodDecodeResponse)
+{
+	std::array<uint8_t, PLDM_NEW_FILE_AVAILABLE_WITH_META_DATA_RESP_BYTES +
+				sizeof(pldm_msg_hdr)>
+	    responseMsg{};
+
+	auto responsePtr = reinterpret_cast<pldm_msg *>(responseMsg.data());
+	size_t payload_length = responseMsg.size() - sizeof(pldm_msg_hdr);
+	auto response = reinterpret_cast<pldm_file_ack_with_meta_data_resp *>(
+	    responsePtr->payload);
+
+	// Random value for completion code
+	uint8_t completionCode = 0x0;
+
+	response->completion_code = completionCode;
+
+	uint8_t retCompletionCode = PLDM_SUCCESS;
+
+	// Invoke decode the read/write file response
+	auto rc = decode_new_file_with_metadata_resp(
+	    responsePtr, payload_length, &retCompletionCode);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(completionCode, retCompletionCode);
+}
+
+TEST(NewFileAvailableWithMetaData, testBadDecodeResponse)
+{
+	uint8_t completionCode = 0;
+
+	// Request payload message is missing
+	auto rc = decode_new_file_with_metadata_resp(NULL, 0, &completionCode);
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+
+	std::array<uint8_t, PLDM_NEW_FILE_AVAILABLE_WITH_META_DATA_RESP_BYTES +
+				sizeof(pldm_msg_hdr)>
+	    responseMsg{};
+
+	auto responsePtr = reinterpret_cast<pldm_msg *>(responseMsg.data());
+
+	// Payload length is invalid
+	rc =
+	    decode_new_file_with_metadata_resp(responsePtr, 0, &completionCode);
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_LENGTH);
+}
+
+TEST(NewFileAvailableWithMetaData, testGoodEncodeRequest)
+{
+	std::array<uint8_t,
+		   sizeof(pldm_msg_hdr) +
+		       PLDM_NEW_FILE_AVAILABLE_WITH_META_DATA_REQ_BYTES>
+	    requestMsg{};
+
+	uint16_t fileType = 0xFFFF;
+	uint32_t fileHandle = 0x12345678;
+	uint32_t length = 0x13245768;
+	uint64_t fileMetaData1 = 0xFFFFFFFF;
+	uint32_t fileMetaData2 = 0xFFFFFFFF;
+	uint32_t fileMetaData3 = 0xFFFFFFFF;
+	uint32_t fileMetaData4 = 0xFFFFFFFF;
+
+	uint16_t fileTypeLe = htole16(fileType);
+	uint32_t fileHandleLe = htole32(fileHandle);
+	uint64_t lengthLe = htole64(length);
+	uint32_t fileMetaData1Le = htole32(fileMetaData1);
+	uint32_t fileMetaData2Le = htole32(fileMetaData2);
+	uint32_t fileMetaData3Le = htole32(fileMetaData3);
+	uint32_t fileMetaData4Le = htole32(fileMetaData4);
+
+	pldm_msg *request = reinterpret_cast<pldm_msg *>(requestMsg.data());
+
+	auto rc = encode_new_file_with_metadata_req(
+	    0, fileType, fileHandle, length, fileMetaData1, fileMetaData2,
+	    fileMetaData3, fileMetaData4, request);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(request->hdr.request, PLDM_REQUEST);
+	ASSERT_EQ(request->hdr.instance_id, 0);
+	ASSERT_EQ(request->hdr.type, PLDM_OEM);
+	ASSERT_EQ(request->hdr.command, PLDM_NEW_FILE_AVAILABLE_WITH_META_DATA);
+	ASSERT_EQ(0, memcmp(request->payload, &fileTypeLe, sizeof(fileTypeLe)));
+	ASSERT_EQ(0, memcmp(request->payload + sizeof(fileTypeLe),
+			    &fileHandleLe, sizeof(fileHandleLe)));
+	ASSERT_EQ(0, memcmp(request->payload + sizeof(fileTypeLe) +
+				sizeof(fileHandleLe),
+			    &lengthLe, sizeof(lengthLe)));
+
+	ASSERT_EQ(0, memcmp(request->payload + sizeof(fileTypeLe) +
+				sizeof(fileHandleLe) + sizeof(lengthLe),
+			    &fileMetaData1Le, sizeof(fileMetaData1Le)));
+
+	ASSERT_EQ(0, memcmp(request->payload + sizeof(fileTypeLe) +
+				sizeof(fileHandleLe) + sizeof(lengthLe) +
+				sizeof(fileMetaData1Le),
+			    &fileMetaData2Le, sizeof(fileMetaData2Le)));
+
+	ASSERT_EQ(0,
+		  memcmp(request->payload + sizeof(fileTypeLe) +
+			     sizeof(fileHandleLe) + sizeof(lengthLe) +
+			     sizeof(fileMetaData1Le) + sizeof(fileMetaData2Le),
+			 &fileMetaData3Le, sizeof(fileMetaData3Le)));
+
+	ASSERT_EQ(0,
+		  memcmp(request->payload + sizeof(fileTypeLe) +
+			     sizeof(fileHandleLe) + sizeof(lengthLe) +
+			     sizeof(fileMetaData1Le) + sizeof(fileMetaData2Le) +
+			     sizeof(fileMetaData3Le),
+			 &fileMetaData4Le, sizeof(fileMetaData4Le)));
+}
+
+TEST(NewFileAvailableWithMetaData, testBadEncodeRequest)
+{
+	uint8_t fileType = 0xFF;
+	uint32_t fileHandle = 0;
+	uint32_t length = 0;
+	uint32_t fileMetaData1 = 0;
+	uint32_t fileMetaData2 = 0;
+	uint32_t fileMetaData3 = 0;
+	uint32_t fileMetaData4 = 0;
+
+	// request is NULL pointer
+	auto rc = encode_new_file_with_metadata_req(
+	    0, fileType, fileHandle, length, fileMetaData1, fileMetaData2,
+	    fileMetaData3, fileMetaData4, NULL);
+
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+}
+
+TEST(NewFileAvailableWithMetaData, testGoodDecodeRequest)
+{
+	std::array<uint8_t, PLDM_NEW_FILE_AVAILABLE_WITH_META_DATA_REQ_BYTES +
+				sizeof(pldm_msg_hdr)>
+	    requestMsg{};
+
+	auto requestPtr = reinterpret_cast<pldm_msg *>(requestMsg.data());
+	size_t payload_length = requestMsg.size() - sizeof(pldm_msg_hdr);
+	auto request = reinterpret_cast<pldm_new_file_with_metadata_req *>(
+	    requestPtr->payload);
+
+	// Random value for fileHandle and length
+	uint16_t fileType = 0xFFFF;
+	uint32_t fileHandle = 0x12345678;
+	uint64_t length = 0x13245768;
+	uint32_t fileMetaData1 = 0x12345678;
+	uint32_t fileMetaData2 = 0x87654321;
+	uint32_t fileMetaData3 = 0x22121117;
+	uint32_t fileMetaData4 = 0x12334345;
+
+	request->file_type = htole16(fileType);
+	request->file_handle = htole32(fileHandle);
+	request->length = htole64(length);
+	request->file_meta_data_1 = htole32(fileMetaData1);
+	request->file_meta_data_2 = htole32(fileMetaData2);
+	request->file_meta_data_3 = htole32(fileMetaData3);
+	request->file_meta_data_4 = htole32(fileMetaData4);
+
+	uint16_t retFileType = 0xFFFF;
+	uint32_t retFileHandle = 0;
+	uint64_t retLength = 0;
+	uint32_t retFileMetaData1 = 0;
+	uint32_t retFileMetaData2 = 0;
+	uint32_t retFileMetaData3 = 0;
+	uint32_t retFileMetaData4 = 0;
+
+	// Invoke decode the read file request
+	auto rc = decode_new_file_with_metadata_req(
+	    requestPtr, payload_length, &retFileType, &retFileHandle,
+	    &retLength, &retFileMetaData1, &retFileMetaData2, &retFileMetaData3,
+	    &retFileMetaData4);
+
+	ASSERT_EQ(rc, PLDM_SUCCESS);
+	ASSERT_EQ(fileType, retFileType);
+	ASSERT_EQ(fileHandle, retFileHandle);
+	ASSERT_EQ(length, retLength);
+	ASSERT_EQ(fileMetaData1, retFileMetaData1);
+	ASSERT_EQ(fileMetaData2, retFileMetaData2);
+	ASSERT_EQ(fileMetaData3, retFileMetaData3);
+	ASSERT_EQ(fileMetaData4, retFileMetaData4);
+}
+
+TEST(NewFileAvailableWithMetaData, testBadDecodeRequest)
+{
+	uint16_t fileType = 0;
+	uint32_t fileHandle = 0;
+	uint64_t length = 0;
+	uint32_t fileMetaData1 = 0;
+	uint32_t fileMetaData2 = 0;
+	uint32_t fileMetaData3 = 0;
+	uint32_t fileMetaData4 = 0;
+
+	// Request payload message is missing
+	auto rc = decode_new_file_with_metadata_req(
+	    NULL, 0, &fileType, &fileHandle, &length, &fileMetaData1,
+	    &fileMetaData2, &fileMetaData3, &fileMetaData4);
+
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+
+	std::array<uint8_t, PLDM_NEW_FILE_AVAILABLE_WITH_META_DATA_REQ_BYTES +
+				sizeof(pldm_msg_hdr)>
+	    requestMsg{};
+
+	auto requestPtr = reinterpret_cast<pldm_msg *>(requestMsg.data());
+
+	// Payload length is invalid
+	rc = decode_new_file_with_metadata_req(
+	    requestPtr, 0, &fileType, &fileHandle, &length, &fileMetaData1,
+	    &fileMetaData2, &fileMetaData3, &fileMetaData4);
+	ASSERT_EQ(rc, PLDM_ERROR_INVALID_LENGTH);
+}
diff --git a/libpldm/oem/ibm/libpldm/tests/libpldm_host_test.cpp b/libpldm/oem/ibm/libpldm/tests/libpldm_host_test.cpp
new file mode 100644
index 0000000..39f8e70
--- /dev/null
+++ b/libpldm/oem/ibm/libpldm/tests/libpldm_host_test.cpp
@@ -0,0 +1,169 @@
+#include "oem/ibm/libpldm/host.h"
+
+#include <string.h>
+
+#include <array>
+
+#include <gtest/gtest.h>
+
+constexpr auto hdrSize = sizeof(pldm_msg_hdr);
+
+TEST(GetAlertStatus, testGoodEncodeRequest)
+{
+	std::array<uint8_t, hdrSize + PLDM_GET_ALERT_STATUS_REQ_BYTES>
+	    requestMsg{};
+
+	uint8_t versionId = 0x0;
+
+	auto request = reinterpret_cast<pldm_msg *>(requestMsg.data());
+	auto rc = encode_get_alert_status_req(0, versionId, request,
+					      PLDM_GET_ALERT_STATUS_REQ_BYTES);
+	EXPECT_EQ(rc, PLDM_SUCCESS);
+	EXPECT_EQ(versionId, request->payload[0]);
+}
+
+TEST(GetAlertStatus, testBadEncodeRequest)
+{
+	std::array<uint8_t, hdrSize + PLDM_GET_ALERT_STATUS_REQ_BYTES>
+	    requestMsg{};
+
+	auto request = reinterpret_cast<pldm_msg *>(requestMsg.data());
+	auto rc = encode_get_alert_status_req(
+	    0, 0x0, request, PLDM_GET_ALERT_STATUS_REQ_BYTES + 1);
+	EXPECT_EQ(rc, PLDM_ERROR_INVALID_LENGTH);
+}
+
+TEST(GetAlertStatus, testGoodDecodeResponse)
+{
+	uint8_t completionCode = PLDM_SUCCESS;
+	uint32_t rack_entry = 0xFF000030;
+	uint32_t pri_cec_node = 0x00008030;
+	std::array<uint8_t, hdrSize + PLDM_GET_ALERT_STATUS_RESP_BYTES>
+	    responseMsg{};
+
+	uint8_t retCompletionCode = 0;
+	uint32_t retRack_entry = 0;
+	uint32_t retPri_cec_node = 0;
+
+	auto response = reinterpret_cast<pldm_msg *>(responseMsg.data());
+	struct pldm_get_alert_status_resp *resp =
+	    reinterpret_cast<struct pldm_get_alert_status_resp *>(
+		response->payload);
+	resp->completion_code = completionCode;
+	resp->rack_entry = htole32(rack_entry);
+	resp->pri_cec_node = htole32(pri_cec_node);
+
+	auto rc = decode_get_alert_status_resp(
+	    response, responseMsg.size() - hdrSize, &retCompletionCode,
+	    &retRack_entry, &retPri_cec_node);
+	EXPECT_EQ(rc, PLDM_SUCCESS);
+	EXPECT_EQ(retCompletionCode, completionCode);
+	EXPECT_EQ(retRack_entry, rack_entry);
+	EXPECT_EQ(retPri_cec_node, pri_cec_node);
+}
+
+TEST(GetAlertStatus, testBadDecodeResponse)
+{
+	auto rc = decode_get_alert_status_resp(NULL, 0, NULL, NULL, NULL);
+	EXPECT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+
+	uint8_t completionCode = PLDM_SUCCESS;
+	uint32_t rack_entry = 0xFF000030;
+	uint32_t pri_cec_node = 0x00008030;
+	std::array<uint8_t, hdrSize + PLDM_GET_ALERT_STATUS_RESP_BYTES>
+	    responseMsg{};
+
+	uint8_t retCompletionCode = 0;
+	uint32_t retRack_entry = 0;
+	uint32_t retPri_cec_node = 0;
+
+	auto response = reinterpret_cast<pldm_msg *>(responseMsg.data());
+	struct pldm_get_alert_status_resp *resp =
+	    reinterpret_cast<struct pldm_get_alert_status_resp *>(
+		response->payload);
+	resp->completion_code = completionCode;
+	resp->rack_entry = htole32(rack_entry);
+	resp->pri_cec_node = htole32(pri_cec_node);
+
+	rc = decode_get_alert_status_resp(
+	    response, responseMsg.size() - hdrSize + 1, &retCompletionCode,
+	    &retRack_entry, &retPri_cec_node);
+	EXPECT_EQ(rc, PLDM_ERROR_INVALID_LENGTH);
+}
+
+TEST(GetAlertStatus, testGoodEncodeResponse)
+{
+	uint8_t completionCode = 0;
+	uint32_t rack_entry = 0xFF000030;
+	uint32_t pri_cec_node = 0x00008030;
+
+	std::vector<uint8_t> responseMsg(hdrSize +
+					 PLDM_GET_ALERT_STATUS_RESP_BYTES);
+	auto response = reinterpret_cast<pldm_msg *>(responseMsg.data());
+
+	auto rc = encode_get_alert_status_resp(0, PLDM_SUCCESS, rack_entry,
+					       pri_cec_node, response,
+					       responseMsg.size() - hdrSize);
+
+	EXPECT_EQ(rc, PLDM_SUCCESS);
+	struct pldm_get_alert_status_resp *resp =
+	    reinterpret_cast<struct pldm_get_alert_status_resp *>(
+		response->payload);
+
+	EXPECT_EQ(completionCode, resp->completion_code);
+	EXPECT_EQ(rack_entry, le32toh(resp->rack_entry));
+	EXPECT_EQ(pri_cec_node, le32toh(resp->pri_cec_node));
+}
+
+TEST(GetAlertStatus, testBadEncodeResponse)
+{
+	uint32_t rack_entry = 0xFF000030;
+	uint32_t pri_cec_node = 0x00008030;
+
+	std::vector<uint8_t> responseMsg(hdrSize +
+					 PLDM_GET_ALERT_STATUS_RESP_BYTES);
+	auto response = reinterpret_cast<pldm_msg *>(responseMsg.data());
+
+	auto rc = encode_get_alert_status_resp(
+	    0, PLDM_SUCCESS, rack_entry, pri_cec_node, response,
+	    responseMsg.size() - hdrSize + 1);
+
+	EXPECT_EQ(rc, PLDM_ERROR_INVALID_DATA);
+}
+
+TEST(GetAlertStatus, testGoodDecodeRequest)
+{
+	std::array<uint8_t, hdrSize + PLDM_GET_ALERT_STATUS_REQ_BYTES>
+	    requestMsg{};
+
+	uint8_t versionId = 0x0;
+	uint8_t retVersionId;
+
+	auto req = reinterpret_cast<pldm_msg *>(requestMsg.data());
+
+	req->payload[0] = versionId;
+
+	auto rc = decode_get_alert_status_req(req, requestMsg.size() - hdrSize,
+					      &retVersionId);
+
+	EXPECT_EQ(rc, PLDM_SUCCESS);
+	EXPECT_EQ(retVersionId, versionId);
+}
+
+TEST(GetAlertStatus, testBadDecodeRequest)
+{
+	std::array<uint8_t, hdrSize + PLDM_GET_ALERT_STATUS_REQ_BYTES>
+	    requestMsg{};
+
+	uint8_t versionId = 0x0;
+	uint8_t retVersionId;
+
+	auto req = reinterpret_cast<pldm_msg *>(requestMsg.data());
+
+	req->payload[0] = versionId;
+
+	auto rc = decode_get_alert_status_req(
+	    req, requestMsg.size() - hdrSize + 1, &retVersionId);
+
+	EXPECT_EQ(rc, PLDM_ERROR_INVALID_LENGTH);
+}
diff --git a/libpldm/tests/meson.build b/libpldm/tests/meson.build
index b94959a..12dab0a 100644
--- a/libpldm/tests/meson.build
+++ b/libpldm/tests/meson.build
@@ -11,8 +11,8 @@
 
 if get_option('oem-ibm').enabled()
   tests += [
-    '../../oem/ibm/test/libpldm_fileio_test',
-    '../../oem/ibm/test/libpldm_host_test',
+    '../oem/ibm/libpldm/tests/libpldm_fileio_test',
+    '../oem/ibm/libpldm/tests/libpldm_host_test',
   ]
 endif
 
