Patrick Venture | af69625 | 2018-12-11 10:22:14 -0800 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Patrick Venture | 84778b8 | 2019-06-26 20:11:09 -0700 | [diff] [blame] | 3 | #include "flags.hpp" |
Patrick Venture | cf9b219 | 2019-06-27 12:09:52 -0700 | [diff] [blame] | 4 | #include "progress.hpp" |
Patrick Venture | 8a55dcb | 2018-12-12 21:12:58 -0800 | [diff] [blame] | 5 | |
Patrick Venture | af69625 | 2018-12-11 10:22:14 -0800 | [diff] [blame] | 6 | #include <cstdint> |
| 7 | #include <string> |
| 8 | |
Patrick Venture | 9b534f0 | 2018-12-13 16:10:02 -0800 | [diff] [blame] | 9 | namespace host_tool |
| 10 | { |
| 11 | |
Patrick Venture | af69625 | 2018-12-11 10:22:14 -0800 | [diff] [blame] | 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; |
Patrick Venture | 8a55dcb | 2018-12-12 21:12:58 -0800 | [diff] [blame] | 28 | |
| 29 | /** |
| 30 | * Return the supported data interface for this. |
| 31 | * |
| 32 | * @return the enum value corresponding to the supported type. |
| 33 | */ |
Patrick Venture | 84778b8 | 2019-06-26 20:11:09 -0700 | [diff] [blame] | 34 | virtual ipmi_flash::FirmwareFlags::UpdateFlags supportedType() const = 0; |
Patrick Venture | af69625 | 2018-12-11 10:22:14 -0800 | [diff] [blame] | 35 | }; |
Patrick Venture | 9b534f0 | 2018-12-13 16:10:02 -0800 | [diff] [blame] | 36 | |
| 37 | } // namespace host_tool |