blob: 3a41ff58c45e2af8cc683f3329ba10f7361fe7f7 [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) :
Patrick Williams42a44c22024-08-16 15:21:32 -040024 blob(blob), progress(progress), host(host), port(port), sys(sys) {};
Benjamin Fair30d09a32019-10-11 16:57:47 -070025
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