implement commands for dump xfer

This commit implements the writeFile command
for dumpHandler in PLDM oem. This is for offloading
the dump from host memory to an external location
via bmc. Also it implements the newfileAvailable
notification handler in libpldmresponder.This caters
to the new dump notification coming from the Host

Change-Id: Ibf7c1facea282ec4f772dfee646cca9f7877bb7d
Signed-off-by: Sampa Misra <sampmisr@in.ibm.com>
diff --git a/oem/ibm/libpldmresponder/file_io_type_dump.hpp b/oem/ibm/libpldmresponder/file_io_type_dump.hpp
new file mode 100644
index 0000000..e20d0d7
--- /dev/null
+++ b/oem/ibm/libpldmresponder/file_io_type_dump.hpp
@@ -0,0 +1,58 @@
+#pragma once
+
+#include "file_io_by_type.hpp"
+
+namespace pldm
+{
+namespace responder
+{
+
+/** @class DumpHandler
+ *
+ *  @brief Inherits and implements FileHandler. This class is used
+ *  handle the dump offload/streaming from host to the destination via bmc
+ */
+class DumpHandler : public FileHandler
+{
+  public:
+    /** @brief DumpHandler constructor
+     */
+    DumpHandler(uint32_t fileHandle) : FileHandler(fileHandle)
+    {
+    }
+
+    virtual int writeFromMemory(uint32_t offset, uint32_t length,
+                                uint64_t address);
+
+    virtual int readIntoMemory(uint32_t /*offset*/, uint32_t& /*length*/,
+                               uint64_t /*address*/)
+    {
+        return PLDM_ERROR_UNSUPPORTED_PLDM_CMD;
+    }
+    virtual int read(uint32_t /*offset*/, uint32_t& /*length*/,
+                     Response& /*response*/)
+    {
+        return PLDM_ERROR_UNSUPPORTED_PLDM_CMD;
+    }
+
+    virtual int write(const char* buffer, uint32_t offset, uint32_t& length);
+
+    virtual int newFileAvailable(uint64_t length);
+
+    virtual int fileAck(uint8_t /*fileStatus*/)
+    {
+        return PLDM_ERROR_UNSUPPORTED_PLDM_CMD;
+    }
+
+    /** @brief DumpHandler destructor
+     */
+    ~DumpHandler()
+    {
+    }
+
+  private:
+    static int fd; //!< fd to manage the dump offload to bmc
+};
+
+} // namespace responder
+} // namespace pldm