1 #include "command/payload_cmds.hpp"
2 #include "command/sol_cmds.hpp"
3 #include "command_table.hpp"
4 #include "session.hpp"
5 
6 namespace sol
7 {
8 
9 namespace command
10 {
11 
registerCommands()12 void registerCommands()
13 {
14     static const ::command::CmdDetails commands[] = {
15         // SOL Payload Handler
16         {{(static_cast<uint32_t>(message::PayloadType::SOL) << 16)},
17          &payloadHandler,
18          session::Privilege::HIGHEST_MATCHING,
19          false},
20         // Activate Payload Command
21         {{(static_cast<uint32_t>(message::PayloadType::IPMI) << 16) |
22           static_cast<uint16_t>(::command::NetFns::APP) | 0x48},
23          &activatePayload,
24          session::Privilege::USER,
25          false},
26         // Deactivate Payload Command
27         {{(static_cast<uint32_t>(message::PayloadType::IPMI) << 16) |
28           static_cast<uint16_t>(::command::NetFns::APP) | 0x49},
29          &deactivatePayload,
30          session::Privilege::USER,
31          false},
32         // Get Payload Activation Status
33         {{(static_cast<uint32_t>(message::PayloadType::IPMI) << 16) |
34           static_cast<uint16_t>(::command::NetFns::APP) | 0x4A},
35          &getPayloadStatus,
36          session::Privilege::USER,
37          false},
38         // Get Payload Instance Info Command
39         {{(static_cast<uint32_t>(message::PayloadType::IPMI) << 16) |
40           static_cast<uint16_t>(::command::NetFns::APP) | 0x4B},
41          &getPayloadInfo,
42          session::Privilege::USER,
43          false},
44     };
45 
46     for (const auto& iter : commands)
47     {
48         ::command::Table::get().registerCommand(
49             iter.command,
50             std::make_unique<::command::NetIpmidEntry>(
51                 iter.command, iter.functor, iter.privilege, iter.sessionless));
52     }
53 }
54 
55 } // namespace command
56 
57 } // namespace sol
58