1 #pragma once
2 
3 #include "message_handler.hpp"
4 
5 #include <vector>
6 
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  */
24 std::vector<uint8_t> payloadHandler(const std::vector<uint8_t>& inPayload,
25                                     std::shared_ptr<message::Handler>& handler);
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
37     uint8_t sessionState:4; //!< SOL session state.
38     uint8_t reserved:4;     //!< Reserved.
39 #endif
40 
41 #if BYTE_ORDER == BIG_ENDIAN
42     uint8_t reserved:4;     //!< Reserved.
43     uint8_t sessionState:4; //!< SOL session state.
44 #endif
45 
46     uint8_t payloadInstance; //!< Payload instance.
47     uint8_t majorVersion;    //!< SOL format major version
48     uint8_t minorVersion;    //!< SOL format minor version
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 
65 } // namespace command
66 
67 } // namespace sol
68