Tom Joseph | 64b3dec | 2017-04-03 01:53:44 +0530 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Tom Joseph | 64b3dec | 2017-04-03 01:53:44 +0530 | [diff] [blame] | 3 | #include "message_handler.hpp" |
| 4 | |
Vernon Mauery | 9e801a2 | 2018-10-12 13:20:49 -0700 | [diff] [blame] | 5 | #include <vector> |
| 6 | |
Tom Joseph | 64b3dec | 2017-04-03 01:53:44 +0530 | [diff] [blame] | 7 | namespace sol |
| 8 | { |
| 9 | |
| 10 | namespace command |
| 11 | { |
| 12 | |
| 13 | /** @brief SOL Payload Handler |
| 14 | * |
| 15 | * This command is used for activating and deactivating a payload type under a |
| 16 | * given IPMI session. The UDP Port number for SOL is the same as the port that |
| 17 | * was used to establish the IPMI session. |
| 18 | * |
| 19 | * @param[in] inPayload - Request data for the command. |
| 20 | * @param[in] handler - Reference to the message handler. |
| 21 | * |
| 22 | * @return Response data for the command. |
| 23 | */ |
Tom Joseph | 18a45e9 | 2017-04-11 11:30:44 +0530 | [diff] [blame] | 24 | std::vector<uint8_t> payloadHandler(const std::vector<uint8_t>& inPayload, |
Vernon Mauery | 41ff9b5 | 2021-06-11 11:37:40 -0700 | [diff] [blame] | 25 | std::shared_ptr<message::Handler>& handler); |
Tom Joseph | e14ac96 | 2017-04-03 01:56:04 +0530 | [diff] [blame] | 26 | |
| 27 | constexpr uint8_t netfnTransport = 0x0C; |
| 28 | constexpr uint8_t solActivatingCmd = 0x20; |
| 29 | |
| 30 | /** @struct ActivatingRequest |
| 31 | * |
| 32 | * IPMI payload for SOL Activating command. |
| 33 | */ |
| 34 | struct ActivatingRequest |
| 35 | { |
| 36 | #if BYTE_ORDER == LITTLE_ENDIAN |
Vernon Mauery | 9e801a2 | 2018-10-12 13:20:49 -0700 | [diff] [blame] | 37 | uint8_t sessionState : 4; //!< SOL session state. |
| 38 | uint8_t reserved : 4; //!< Reserved. |
Tom Joseph | e14ac96 | 2017-04-03 01:56:04 +0530 | [diff] [blame] | 39 | #endif |
| 40 | |
| 41 | #if BYTE_ORDER == BIG_ENDIAN |
Vernon Mauery | 9e801a2 | 2018-10-12 13:20:49 -0700 | [diff] [blame] | 42 | uint8_t reserved : 4; //!< Reserved. |
| 43 | uint8_t sessionState : 4; //!< SOL session state. |
Tom Joseph | e14ac96 | 2017-04-03 01:56:04 +0530 | [diff] [blame] | 44 | #endif |
| 45 | |
Vernon Mauery | 9e801a2 | 2018-10-12 13:20:49 -0700 | [diff] [blame] | 46 | uint8_t payloadInstance; //!< Payload instance. |
| 47 | uint8_t majorVersion; //!< SOL format major version |
| 48 | uint8_t minorVersion; //!< SOL format minor version |
Tom Joseph | e14ac96 | 2017-04-03 01:56:04 +0530 | [diff] [blame] | 49 | } __attribute__((packed)); |
| 50 | |
| 51 | /** @brief SOL Activating Command. |
| 52 | * |
| 53 | * This command provides a mechanism for the BMC to notify a remote application |
| 54 | * that a SOL payload is activating on another channel.The request message is a |
| 55 | * message that is asynchronously generated by the BMC. The BMC will not wait |
| 56 | * for a response from the remote console before dropping the serial connection |
| 57 | * to proceed with SOL, therefore the remote console does not need to respond |
| 58 | * to this command. |
| 59 | * |
| 60 | * @param[in] payloadInstance - SOL payload instance. |
| 61 | * @param[in] sessionID - IPMI session ID. |
| 62 | */ |
| 63 | void activating(uint8_t payloadInstance, uint32_t sessionID); |
| 64 | |
Tom Joseph | 64b3dec | 2017-04-03 01:53:44 +0530 | [diff] [blame] | 65 | } // namespace command |
| 66 | |
| 67 | } // namespace sol |