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