164b3dec8STom Joseph #pragma once 264b3dec8STom Joseph 364b3dec8STom Joseph #include "message_handler.hpp" 464b3dec8STom Joseph 59e801a2bSVernon Mauery #include <vector> 69e801a2bSVernon Mauery 764b3dec8STom Joseph namespace sol 864b3dec8STom Joseph { 964b3dec8STom Joseph 1064b3dec8STom Joseph namespace command 1164b3dec8STom Joseph { 1264b3dec8STom Joseph 1364b3dec8STom Joseph /** @brief SOL Payload Handler 1464b3dec8STom Joseph * 1564b3dec8STom Joseph * This command is used for activating and deactivating a payload type under a 1664b3dec8STom Joseph * given IPMI session. The UDP Port number for SOL is the same as the port that 1764b3dec8STom Joseph * was used to establish the IPMI session. 1864b3dec8STom Joseph * 1964b3dec8STom Joseph * @param[in] inPayload - Request data for the command. 2064b3dec8STom Joseph * @param[in] handler - Reference to the message handler. 2164b3dec8STom Joseph * 2264b3dec8STom Joseph * @return Response data for the command. 2364b3dec8STom Joseph */ 2418a45e9dSTom Joseph std::vector<uint8_t> payloadHandler(const std::vector<uint8_t>& inPayload, 25*41ff9b51SVernon Mauery std::shared_ptr<message::Handler>& handler); 26e14ac96fSTom Joseph 27e14ac96fSTom Joseph constexpr uint8_t netfnTransport = 0x0C; 28e14ac96fSTom Joseph constexpr uint8_t solActivatingCmd = 0x20; 29e14ac96fSTom Joseph 30e14ac96fSTom Joseph /** @struct ActivatingRequest 31e14ac96fSTom Joseph * 32e14ac96fSTom Joseph * IPMI payload for SOL Activating command. 33e14ac96fSTom Joseph */ 34e14ac96fSTom Joseph struct ActivatingRequest 35e14ac96fSTom Joseph { 36e14ac96fSTom Joseph #if BYTE_ORDER == LITTLE_ENDIAN 37e14ac96fSTom Joseph uint8_t sessionState:4; //!< SOL session state. 38e14ac96fSTom Joseph uint8_t reserved:4; //!< Reserved. 39e14ac96fSTom Joseph #endif 40e14ac96fSTom Joseph 41e14ac96fSTom Joseph #if BYTE_ORDER == BIG_ENDIAN 42e14ac96fSTom Joseph uint8_t reserved:4; //!< Reserved. 43e14ac96fSTom Joseph uint8_t sessionState:4; //!< SOL session state. 44e14ac96fSTom Joseph #endif 45e14ac96fSTom Joseph 46e14ac96fSTom Joseph uint8_t payloadInstance; //!< Payload instance. 47e14ac96fSTom Joseph uint8_t majorVersion; //!< SOL format major version 48e14ac96fSTom Joseph uint8_t minorVersion; //!< SOL format minor version 49e14ac96fSTom Joseph } __attribute__((packed)); 50e14ac96fSTom Joseph 51e14ac96fSTom Joseph /** @brief SOL Activating Command. 52e14ac96fSTom Joseph * 53e14ac96fSTom Joseph * This command provides a mechanism for the BMC to notify a remote application 54e14ac96fSTom Joseph * that a SOL payload is activating on another channel.The request message is a 55e14ac96fSTom Joseph * message that is asynchronously generated by the BMC. The BMC will not wait 56e14ac96fSTom Joseph * for a response from the remote console before dropping the serial connection 57e14ac96fSTom Joseph * to proceed with SOL, therefore the remote console does not need to respond 58e14ac96fSTom Joseph * to this command. 59e14ac96fSTom Joseph * 60e14ac96fSTom Joseph * @param[in] payloadInstance - SOL payload instance. 61e14ac96fSTom Joseph * @param[in] sessionID - IPMI session ID. 62e14ac96fSTom Joseph */ 63e14ac96fSTom Joseph void activating(uint8_t payloadInstance, uint32_t sessionID); 64e14ac96fSTom Joseph 6564b3dec8STom Joseph } // namespace command 6664b3dec8STom Joseph 6764b3dec8STom Joseph } // namespace sol 68