blob: c613f0e6a21a58e6df6e5e084f235299b9d6431f [file] [log] [blame]
Patrick Ventureaf696252018-12-11 10:22:14 -08001#pragma once
2
Patrick Venture84778b82019-06-26 20:11:09 -07003#include "flags.hpp"
Patrick Venturecf9b2192019-06-27 12:09:52 -07004#include "progress.hpp"
Patrick Venture8a55dcb2018-12-12 21:12:58 -08005
Patrick Ventureaf696252018-12-11 10:22:14 -08006#include <cstdint>
7#include <string>
8
Patrick Venture9b534f02018-12-13 16:10:02 -08009namespace host_tool
10{
11
Patrick Ventureaf696252018-12-11 10:22:14 -080012class 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;
Patrick Venture8a55dcb2018-12-12 21:12:58 -080028
29 /**
30 * Return the supported data interface for this.
31 *
32 * @return the enum value corresponding to the supported type.
33 */
Patrick Venture84778b82019-06-26 20:11:09 -070034 virtual ipmi_flash::FirmwareFlags::UpdateFlags supportedType() const = 0;
Patrick Ventureaf696252018-12-11 10:22:14 -080035};
Patrick Venture9b534f02018-12-13 16:10:02 -080036
37} // namespace host_tool