blob: 79360d0f2177beda0c1625c1da89605ccc64bab6 [file] [log] [blame]
Sampa Misra18967162020-01-14 02:31:41 -06001#pragma once
2
3#include "file_io_by_type.hpp"
4
5namespace pldm
6{
7namespace responder
8{
9
10/** @class DumpHandler
11 *
12 * @brief Inherits and implements FileHandler. This class is used
13 * handle the dump offload/streaming from host to the destination via bmc
14 */
15class DumpHandler : public FileHandler
16{
17 public:
18 /** @brief DumpHandler constructor
19 */
20 DumpHandler(uint32_t fileHandle) : FileHandler(fileHandle)
21 {
22 }
23
24 virtual int writeFromMemory(uint32_t offset, uint32_t length,
25 uint64_t address);
26
27 virtual int readIntoMemory(uint32_t /*offset*/, uint32_t& /*length*/,
28 uint64_t /*address*/)
29 {
30 return PLDM_ERROR_UNSUPPORTED_PLDM_CMD;
31 }
32 virtual int read(uint32_t /*offset*/, uint32_t& /*length*/,
33 Response& /*response*/)
34 {
35 return PLDM_ERROR_UNSUPPORTED_PLDM_CMD;
36 }
37
38 virtual int write(const char* buffer, uint32_t offset, uint32_t& length);
39
40 virtual int newFileAvailable(uint64_t length);
41
Deepak Kodihallifd279e12020-02-02 05:20:43 -060042 virtual int fileAck(uint8_t /*fileStatus*/);
Sampa Misra18967162020-01-14 02:31:41 -060043
44 /** @brief DumpHandler destructor
45 */
46 ~DumpHandler()
47 {
48 }
49
50 private:
51 static int fd; //!< fd to manage the dump offload to bmc
52};
53
54} // namespace responder
55} // namespace pldm