Benjamin Fair | 30d09a3 | 2019-10-11 16:57:47 -0700 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include "interface.hpp" |
| 4 | #include "internal/sys.hpp" |
| 5 | #include "progress.hpp" |
| 6 | |
| 7 | #include <unistd.h> |
| 8 | |
Benjamin Fair | 30d09a3 | 2019-10-11 16:57:47 -0700 | [diff] [blame] | 9 | #include <ipmiblob/blob_interface.hpp> |
| 10 | #include <stdplus/handle/managed.hpp> |
Patrick Venture | 9b37b09 | 2020-05-28 20:58:57 -0700 | [diff] [blame] | 11 | |
| 12 | #include <cstdint> |
Benjamin Fair | 30d09a3 | 2019-10-11 16:57:47 -0700 | [diff] [blame] | 13 | #include <string> |
| 14 | |
| 15 | namespace host_tool |
| 16 | { |
| 17 | |
| 18 | class NetDataHandler : public DataInterface |
| 19 | { |
| 20 | public: |
| 21 | NetDataHandler(ipmiblob::BlobInterface* blob, ProgressInterface* progress, |
| 22 | const std::string& host, const std::string& port, |
| 23 | const internal::Sys* sys = &internal::sys_impl) : |
| 24 | blob(blob), |
| 25 | progress(progress), host(host), port(port), sys(sys){}; |
| 26 | |
| 27 | bool sendContents(const std::string& input, std::uint16_t session) override; |
| 28 | ipmi_flash::FirmwareFlags::UpdateFlags supportedType() const override |
| 29 | { |
| 30 | return ipmi_flash::FirmwareFlags::UpdateFlags::net; |
| 31 | } |
| 32 | |
| 33 | private: |
| 34 | ipmiblob::BlobInterface* blob; |
| 35 | ProgressInterface* progress; |
| 36 | std::string host; |
| 37 | std::string port; |
| 38 | const internal::Sys* sys; |
| 39 | }; |
| 40 | |
| 41 | } // namespace host_tool |