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