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 | 8a55dcb | 2018-12-12 21:12:58 -0800 | [diff] [blame] | 4 | |
Patrick Venture | af69625 | 2018-12-11 10:22:14 -0800 | [diff] [blame] | 5 | #include <cstdint> |
| 6 | #include <string> |
| 7 | |
Patrick Venture | 9b534f0 | 2018-12-13 16:10:02 -0800 | [diff] [blame] | 8 | namespace host_tool |
| 9 | { |
| 10 | |
Patrick Venture | af69625 | 2018-12-11 10:22:14 -0800 | [diff] [blame] | 11 | class DataInterface |
| 12 | { |
| 13 | public: |
| 14 | virtual ~DataInterface() = default; |
| 15 | |
| 16 | /** |
| 17 | * Given an open session to either /flash/image, /flash/tarball, or |
| 18 | * /flash/hash, this method will configure, and send the data, but not close |
| 19 | * the session. |
| 20 | * |
| 21 | * @param[in] input - path to file to send. |
| 22 | * @param[in] session - the session ID to use. |
| 23 | * @return bool on success. |
| 24 | */ |
| 25 | virtual bool sendContents(const std::string& input, |
| 26 | std::uint16_t session) = 0; |
Patrick Venture | 8a55dcb | 2018-12-12 21:12:58 -0800 | [diff] [blame] | 27 | |
| 28 | /** |
| 29 | * Return the supported data interface for this. |
| 30 | * |
| 31 | * @return the enum value corresponding to the supported type. |
| 32 | */ |
Patrick Venture | 84778b8 | 2019-06-26 20:11:09 -0700 | [diff] [blame^] | 33 | virtual ipmi_flash::FirmwareFlags::UpdateFlags supportedType() const = 0; |
Patrick Venture | af69625 | 2018-12-11 10:22:14 -0800 | [diff] [blame] | 34 | }; |
Patrick Venture | 9b534f0 | 2018-12-13 16:10:02 -0800 | [diff] [blame] | 35 | |
| 36 | } // namespace host_tool |