Tom Joseph | e088bf0 | 2017-04-03 02:07:06 +0530 | [diff] [blame] | 1 | #include "command/payload_cmds.hpp" |
Vernon Mauery | 9e801a2 | 2018-10-12 13:20:49 -0700 | [diff] [blame] | 2 | #include "command/sol_cmds.hpp" |
Tom Joseph | e088bf0 | 2017-04-03 02:07:06 +0530 | [diff] [blame] | 3 | #include "command_table.hpp" |
Tom Joseph | e088bf0 | 2017-04-03 02:07:06 +0530 | [diff] [blame] | 4 | #include "session.hpp" |
| 5 | |
| 6 | namespace sol |
| 7 | { |
| 8 | |
| 9 | namespace command |
| 10 | { |
| 11 | |
| 12 | void registerCommands() |
| 13 | { |
Vernon Mauery | 9e801a2 | 2018-10-12 13:20:49 -0700 | [diff] [blame] | 14 | static const ::command::CmdDetails commands[] = { |
Tom Joseph | e088bf0 | 2017-04-03 02:07:06 +0530 | [diff] [blame] | 15 | // SOL Payload Handler |
Vernon Mauery | 9e801a2 | 2018-10-12 13:20:49 -0700 | [diff] [blame] | 16 | {{(static_cast<uint32_t>(message::PayloadType::SOL) << 16)}, |
| 17 | &payloadHandler, |
| 18 | session::Privilege::HIGHEST_MATCHING, |
| 19 | false}, |
Tom Joseph | e088bf0 | 2017-04-03 02:07:06 +0530 | [diff] [blame] | 20 | // Activate Payload Command |
Vernon Mauery | 9e801a2 | 2018-10-12 13:20:49 -0700 | [diff] [blame] | 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}, |
Tom Joseph | e088bf0 | 2017-04-03 02:07:06 +0530 | [diff] [blame] | 26 | // Deactivate Payload Command |
Vernon Mauery | 9e801a2 | 2018-10-12 13:20:49 -0700 | [diff] [blame] | 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}, |
Tom Joseph | e088bf0 | 2017-04-03 02:07:06 +0530 | [diff] [blame] | 32 | // Get Payload Activation Status |
Vernon Mauery | 9e801a2 | 2018-10-12 13:20:49 -0700 | [diff] [blame] | 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}, |
Tom Joseph | 8093849 | 2018-03-22 10:05:20 +0530 | [diff] [blame] | 38 | // Get Payload Instance Info Command |
Vernon Mauery | 9e801a2 | 2018-10-12 13:20:49 -0700 | [diff] [blame] | 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}, |
Tom Joseph | 15771d1 | 2017-04-28 01:34:53 +0530 | [diff] [blame] | 44 | // Get SOL Configuration Parameters |
Vernon Mauery | 9e801a2 | 2018-10-12 13:20:49 -0700 | [diff] [blame] | 45 | {{(static_cast<uint32_t>(message::PayloadType::IPMI) << 16) | |
| 46 | static_cast<uint16_t>(::command::NetFns::TRANSPORT) | 0x22}, |
| 47 | &getConfParams, |
| 48 | session::Privilege::USER, |
| 49 | false}, |
Tom Joseph | e088bf0 | 2017-04-03 02:07:06 +0530 | [diff] [blame] | 50 | }; |
| 51 | |
| 52 | for (const auto& iter : commands) |
| 53 | { |
Vernon Mauery | 2085ae0 | 2021-06-10 11:51:00 -0700 | [diff] [blame] | 54 | ::command::Table::get().registerCommand( |
| 55 | iter.command, |
| 56 | std::make_unique<::command::NetIpmidEntry>( |
| 57 | iter.command, iter.functor, iter.privilege, iter.sessionless)); |
Tom Joseph | e088bf0 | 2017-04-03 02:07:06 +0530 | [diff] [blame] | 58 | } |
| 59 | } |
| 60 | |
| 61 | } // namespace command |
| 62 | |
| 63 | } // namespace sol |