Patrick Venture | 391b8b0 | 2018-03-08 08:31:13 -0800 | [diff] [blame] | 1 | #pragma once |
Patrick Venture | 36ab6f6 | 2020-08-03 10:50:26 -0700 | [diff] [blame] | 2 | |
Patrick Venture | 09334bb | 2020-08-16 12:22:54 -0700 | [diff] [blame] | 3 | #include "control.hpp" |
| 4 | |
Patrick Venture | 9bf5cef | 2020-08-16 08:59:54 -0700 | [diff] [blame] | 5 | #include <ipmid/api.h> |
| 6 | |
Ed Tanous | f8b6e55 | 2025-06-27 13:27:50 -0700 | [diff] [blame^] | 7 | #include <cstddef> |
Patrick Venture | 36ab6f6 | 2020-08-03 10:50:26 -0700 | [diff] [blame] | 8 | #include <cstdint> |
Patrick Venture | 09334bb | 2020-08-16 12:22:54 -0700 | [diff] [blame] | 9 | #include <memory> |
Ed Tanous | f8b6e55 | 2025-06-27 13:27:50 -0700 | [diff] [blame^] | 10 | #include <utility> |
Patrick Venture | 36ab6f6 | 2020-08-03 10:50:26 -0700 | [diff] [blame] | 11 | |
| 12 | namespace pid_control |
| 13 | { |
| 14 | namespace ipmi |
| 15 | { |
| 16 | |
Patrick Venture | 09334bb | 2020-08-16 12:22:54 -0700 | [diff] [blame] | 17 | // Implements validation of IPMI commands and handles sending back the |
| 18 | // responses. |
| 19 | class ZoneControlIpmiHandler |
| 20 | { |
| 21 | public: |
Harvey Wu | 22579ca | 2022-11-07 14:53:37 +0800 | [diff] [blame] | 22 | explicit ZoneControlIpmiHandler( |
| 23 | std::unique_ptr<ZoneControlInterface> control) : |
Patrick Venture | 09334bb | 2020-08-16 12:22:54 -0700 | [diff] [blame] | 24 | _control(std::move(control)) |
| 25 | {} |
| 26 | |
| 27 | ipmi_ret_t getFailsafeModeState(const uint8_t* reqBuf, uint8_t* replyBuf, |
| 28 | size_t* dataLen); |
| 29 | |
| 30 | ipmi_ret_t getManualModeState(const uint8_t* reqBuf, uint8_t* replyBuf, |
| 31 | size_t* dataLen); |
| 32 | |
| 33 | ipmi_ret_t setManualModeState(const uint8_t* reqBuf, uint8_t* replyBuf, |
Harvey Wu | 22579ca | 2022-11-07 14:53:37 +0800 | [diff] [blame] | 34 | const size_t* dataLen); |
Patrick Venture | 09334bb | 2020-08-16 12:22:54 -0700 | [diff] [blame] | 35 | |
| 36 | private: |
| 37 | std::unique_ptr<ZoneControlInterface> _control; |
| 38 | }; |
| 39 | |
| 40 | ipmi_ret_t manualModeControl(ZoneControlIpmiHandler* handler, ipmi_cmd_t cmd, |
| 41 | const uint8_t* reqBuf, uint8_t* replyCmdBuf, |
| 42 | size_t* dataLen); |
Patrick Venture | 36ab6f6 | 2020-08-03 10:50:26 -0700 | [diff] [blame] | 43 | |
| 44 | } // namespace ipmi |
| 45 | } // namespace pid_control |