blob: 9aedfddf0d39fb353706f82f42b01d171b1c1ca7 [file] [log] [blame]
Tom Joseph64b3dec2017-04-03 01:53:44 +05301#pragma once
2
Tom Joseph64b3dec2017-04-03 01:53:44 +05303#include "message_handler.hpp"
4
Vernon Mauery9e801a22018-10-12 13:20:49 -07005#include <vector>
6
Tom Joseph64b3dec2017-04-03 01:53:44 +05307namespace sol
8{
9
10namespace 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 Joseph18a45e92017-04-11 11:30:44 +053024std::vector<uint8_t> payloadHandler(const std::vector<uint8_t>& inPayload,
Vernon Mauery41ff9b52021-06-11 11:37:40 -070025 std::shared_ptr<message::Handler>& handler);
Tom Josephe14ac962017-04-03 01:56:04 +053026
27constexpr uint8_t netfnTransport = 0x0C;
28constexpr uint8_t solActivatingCmd = 0x20;
29
30/** @struct ActivatingRequest
31 *
32 * IPMI payload for SOL Activating command.
33 */
34struct ActivatingRequest
35{
36#if BYTE_ORDER == LITTLE_ENDIAN
Vernon Mauery9e801a22018-10-12 13:20:49 -070037 uint8_t sessionState : 4; //!< SOL session state.
38 uint8_t reserved : 4; //!< Reserved.
Tom Josephe14ac962017-04-03 01:56:04 +053039#endif
40
41#if BYTE_ORDER == BIG_ENDIAN
Vernon Mauery9e801a22018-10-12 13:20:49 -070042 uint8_t reserved : 4; //!< Reserved.
43 uint8_t sessionState : 4; //!< SOL session state.
Tom Josephe14ac962017-04-03 01:56:04 +053044#endif
45
Vernon Mauery9e801a22018-10-12 13:20:49 -070046 uint8_t payloadInstance; //!< Payload instance.
47 uint8_t majorVersion; //!< SOL format major version
48 uint8_t minorVersion; //!< SOL format minor version
Tom Josephe14ac962017-04-03 01:56:04 +053049} __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 */
63void activating(uint8_t payloadInstance, uint32_t sessionID);
64
Tom Joseph64b3dec2017-04-03 01:53:44 +053065} // namespace command
66
67} // namespace sol