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 | |
| 9 | #include <cstdint> |
| 10 | #include <ipmiblob/blob_interface.hpp> |
| 11 | #include <stdplus/handle/managed.hpp> |
| 12 | #include <string> |
| 13 | |
| 14 | namespace host_tool |
| 15 | { |
| 16 | |
| 17 | class NetDataHandler : public DataInterface |
| 18 | { |
| 19 | public: |
| 20 | NetDataHandler(ipmiblob::BlobInterface* blob, ProgressInterface* progress, |
| 21 | const std::string& host, const std::string& port, |
| 22 | const internal::Sys* sys = &internal::sys_impl) : |
| 23 | blob(blob), |
| 24 | progress(progress), host(host), port(port), sys(sys){}; |
| 25 | |
| 26 | bool sendContents(const std::string& input, std::uint16_t session) override; |
| 27 | ipmi_flash::FirmwareFlags::UpdateFlags supportedType() const override |
| 28 | { |
| 29 | return ipmi_flash::FirmwareFlags::UpdateFlags::net; |
| 30 | } |
| 31 | |
| 32 | private: |
| 33 | ipmiblob::BlobInterface* blob; |
| 34 | ProgressInterface* progress; |
| 35 | std::string host; |
| 36 | std::string port; |
| 37 | const internal::Sys* sys; |
| 38 | }; |
| 39 | |
| 40 | } // namespace host_tool |