tools: implement method to send ipmi packet to BMC
Implement method to send ipmi packets to BMC. Only currently supports
the system interface.
Tested: Verified on a host that has the BLOB handler installed on the
BMC, that it received a blob count of 0, as there were no handlers
installed at that test. Further functional tests will verify cases with
the firmware handler installed, however, it is verified that this code
correctly speaks IPMI to the BLOB handler registered.
Change-Id: I696f3915930cc9fa5e768fbdeed484ea6cb707a2
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/tools/ipmi_handler.hpp b/tools/ipmi_handler.hpp
index 48e6def..1c91bff 100644
--- a/tools/ipmi_handler.hpp
+++ b/tools/ipmi_handler.hpp
@@ -3,6 +3,8 @@
#include "internal/sys.hpp"
#include "ipmi_interface.hpp"
+#include <vector>
+
namespace host_tool
{
@@ -21,12 +23,15 @@
/**
* Attempt to open the device node.
*
- * @return true on success, failure otherwise.
+ * @throws IpmiException on failure.
*/
- bool open();
+ void open();
+ /**
+ * @throws IpmiException on failure.
+ */
std::vector<std::uint8_t>
- sendPacket(const std::vector<std::uint8_t>& data) override;
+ sendPacket(std::vector<std::uint8_t>& data) override;
private:
const internal::Sys* sys;
@@ -34,6 +39,8 @@
* allow moving this object.
*/
int fd = -1;
+ /* The last IPMI sequence number we used. */
+ int sequence = 0;
};
} // namespace host_tool