blob: 21196d8a2cbfd43e9043c682de9ae783636bfc9b [file] [log] [blame]
Tom Josephe088bf02017-04-03 02:07:06 +05301#include "command/payload_cmds.hpp"
Vernon Mauery9e801a22018-10-12 13:20:49 -07002#include "command/sol_cmds.hpp"
Tom Josephe088bf02017-04-03 02:07:06 +05303#include "command_table.hpp"
Tom Josephe088bf02017-04-03 02:07:06 +05304#include "session.hpp"
5
6namespace sol
7{
8
9namespace command
10{
11
12void registerCommands()
13{
Vernon Mauery9e801a22018-10-12 13:20:49 -070014 static const ::command::CmdDetails commands[] = {
Tom Josephe088bf02017-04-03 02:07:06 +053015 // SOL Payload Handler
Vernon Mauery9e801a22018-10-12 13:20:49 -070016 {{(static_cast<uint32_t>(message::PayloadType::SOL) << 16)},
17 &payloadHandler,
18 session::Privilege::HIGHEST_MATCHING,
19 false},
Tom Josephe088bf02017-04-03 02:07:06 +053020 // Activate Payload Command
Vernon Mauery9e801a22018-10-12 13:20:49 -070021 {{(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},
Tom Josephe088bf02017-04-03 02:07:06 +053026 // Deactivate Payload Command
Vernon Mauery9e801a22018-10-12 13:20:49 -070027 {{(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},
Tom Josephe088bf02017-04-03 02:07:06 +053032 // Get Payload Activation Status
Vernon Mauery9e801a22018-10-12 13:20:49 -070033 {{(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},
Tom Joseph80938492018-03-22 10:05:20 +053038 // Get Payload Instance Info Command
Vernon Mauery9e801a22018-10-12 13:20:49 -070039 {{(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},
Tom Josephe088bf02017-04-03 02:07:06 +053044 };
45
46 for (const auto& iter : commands)
47 {
Vernon Mauery2085ae02021-06-10 11:51:00 -070048 ::command::Table::get().registerCommand(
49 iter.command,
50 std::make_unique<::command::NetIpmidEntry>(
51 iter.command, iter.functor, iter.privilege, iter.sessionless));
Tom Josephe088bf02017-04-03 02:07:06 +053052 }
53}
54
55} // namespace command
56
57} // namespace sol