blob: ba329dfa1c12bfdae5feb9ca9b431ef930861ac6 [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
9#include <cstdint>
10#include <ipmiblob/blob_interface.hpp>
11#include <stdplus/handle/managed.hpp>
12#include <string>
13
14namespace host_tool
15{
16
17class 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