Patrick Venture | 123b5c0 | 2019-03-05 14:01:00 -0800 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <cstdint> |
| 4 | #include <vector> |
| 5 | |
Patrick Venture | 1470bec | 2019-03-06 07:33:12 -0800 | [diff] [blame] | 6 | namespace ipmiblob |
Patrick Venture | 123b5c0 | 2019-03-05 14:01:00 -0800 | [diff] [blame] | 7 | { |
| 8 | |
| 9 | class IpmiInterface |
| 10 | { |
| 11 | public: |
| 12 | virtual ~IpmiInterface() = default; |
| 13 | |
| 14 | /** |
| 15 | * Send an IPMI packet to the BMC. |
| 16 | * |
Patrick Venture | 958f1ce | 2019-05-31 17:07:25 -0700 | [diff] [blame] | 17 | * @param[in] netfn - the netfn for the IPMI packet. |
| 18 | * @param[in] cmd - the command. |
Patrick Venture | 123b5c0 | 2019-03-05 14:01:00 -0800 | [diff] [blame] | 19 | * @param[in] data - a vector of the IPMI packet contents. |
| 20 | * @return the bytes returned. |
| 21 | * @throws IpmiException on failure. |
| 22 | */ |
| 23 | virtual std::vector<std::uint8_t> |
Patrick Venture | 958f1ce | 2019-05-31 17:07:25 -0700 | [diff] [blame] | 24 | sendPacket(std::uint8_t netfn, std::uint8_t cmd, |
| 25 | std::vector<std::uint8_t>& data) = 0; |
Patrick Venture | 123b5c0 | 2019-03-05 14:01:00 -0800 | [diff] [blame] | 26 | }; |
| 27 | |
Patrick Venture | 1470bec | 2019-03-06 07:33:12 -0800 | [diff] [blame] | 28 | } // namespace ipmiblob |