1 #pragma once
2 
3 #include "flags.hpp"
4 #include "progress.hpp"
5 
6 #include <cstdint>
7 #include <string>
8 
9 namespace host_tool
10 {
11 
12 class DataInterface
13 {
14   public:
15     virtual ~DataInterface() = default;
16 
17     /**
18      * Given an open session to either /flash/image, /flash/tarball, or
19      * /flash/hash, this method will configure, and send the data, but not close
20      * the session.
21      *
22      * @param[in] input - path to file to send.
23      * @param[in] session - the session ID to use.
24      * @return bool on success.
25      */
26     virtual bool sendContents(const std::string& input,
27                               std::uint16_t session) = 0;
28 
29     /**
30      * Return the supported data interface for this.
31      *
32      * @return the enum value corresponding to the supported type.
33      */
34     virtual ipmi_flash::FirmwareFlags::UpdateFlags supportedType() const = 0;
35 };
36 
37 } // namespace host_tool
38