oem-ibm: implement WriteFileByTypeFromMemory handler
This commit implements a framework for handling oem file types
received to/from host. Along with that it also implements the responder
for oem command WriteFileByTypeFromMemory and processes PELs received
from the host firmware.
Change-Id: Ice866aed0343b90769013c4be31a0c730f6e6bcd
Signed-off-by: Sampa Misra <sampmisr@in.ibm.com>
diff --git a/oem/ibm/libpldmresponder/file_io_type_pel.hpp b/oem/ibm/libpldmresponder/file_io_type_pel.hpp
new file mode 100644
index 0000000..92bcbf6
--- /dev/null
+++ b/oem/ibm/libpldmresponder/file_io_type_pel.hpp
@@ -0,0 +1,44 @@
+#pragma once
+
+#include "file_io_by_type.hpp"
+
+namespace pldm
+{
+namespace responder
+{
+
+using namespace pldm::responder::dma;
+
+/** @class PelHandler
+ *
+ * @brief Inherits and implements FileHandler. This class is used
+ * to read/write pels.
+ */
+class PelHandler : public FileHandler
+{
+ public:
+ /** @brief PelHandler constructor
+ */
+ PelHandler(uint32_t fileHandle) : FileHandler(fileHandle)
+ {
+ }
+
+ virtual int writeFromMemory(uint32_t offset, uint32_t length,
+ uint64_t address);
+
+ /** @brief method to store a pel file in tempfs and send
+ * d-bus notification to pel daemon that it is ready for consumption
+ *
+ * @param[in] pelFileName - the pel file path
+ */
+ virtual int storePel(std::string&& pelFileName);
+
+ /** @brief PelHandler destructor
+ */
+ ~PelHandler()
+ {
+ }
+};
+
+} // namespace responder
+} // namespace pldm