blob: 7578c825851c105ffb8a1d3d837a4c95452e88c5 [file] [log] [blame]
Benjamin Fair30d09a32019-10-11 16:57:47 -07001#pragma once
2
3#include "interface.hpp"
4#include "internal/sys.hpp"
5#include "progress.hpp"
6
7#include <unistd.h>
8
Benjamin Fair30d09a32019-10-11 16:57:47 -07009#include <ipmiblob/blob_interface.hpp>
10#include <stdplus/handle/managed.hpp>
Patrick Venture9b37b092020-05-28 20:58:57 -070011
12#include <cstdint>
Benjamin Fair30d09a32019-10-11 16:57:47 -070013#include <string>
14
15namespace host_tool
16{
17
18class 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