blob: 519bff2dd496a8c28d394ea4cd8851ea3066b660 [file] [log] [blame]
Deepak Kodihalli1b24f972019-02-01 04:09:13 -06001#pragma once
2
Deepak Kodihallibc669f12019-11-28 08:52:07 -06003#include "handler.hpp"
4
Deepak Kodihalli1b24f972019-02-01 04:09:13 -06005#include <stdint.h>
6
7#include <vector>
8
9#include "libpldm/base.h"
10
11namespace pldm
12{
Deepak Kodihalli1b24f972019-02-01 04:09:13 -060013namespace responder
14{
Jinu Joy Thomasf666db12019-05-29 05:22:31 -050015namespace base
16{
Deepak Kodihallibc669f12019-11-28 08:52:07 -060017
18class Handler : public CmdHandler
19{
20 public:
21 Handler()
22 {
23 handlers.emplace(PLDM_GET_PLDM_TYPES,
24 [this](const pldm_msg* request, size_t payloadLength) {
25 return this->getPLDMTypes(request, payloadLength);
26 });
27 handlers.emplace(PLDM_GET_PLDM_COMMANDS, [this](const pldm_msg* request,
28 size_t payloadLength) {
29 return this->getPLDMCommands(request, payloadLength);
30 });
31 handlers.emplace(PLDM_GET_PLDM_VERSION, [this](const pldm_msg* request,
32 size_t payloadLength) {
33 return this->getPLDMVersion(request, payloadLength);
34 });
35 handlers.emplace(PLDM_GET_TID,
36 [this](const pldm_msg* request, size_t payloadLength) {
37 return this->getTID(request, payloadLength);
38 });
39 }
40
41 /** @brief Handler for getPLDMTypes
42 *
43 * @param[in] request - Request message payload
44 * @param[in] payload_length - Request message payload length
45 * @param[return] Response - PLDM Response message
46 */
47 Response getPLDMTypes(const pldm_msg* request, size_t payloadLength);
48
49 /** @brief Handler for getPLDMCommands
50 *
51 * @param[in] request - Request message payload
52 * @param[in] payload_length - Request message payload length
53 * @param[return] Response - PLDM Response message
54 */
55 Response getPLDMCommands(const pldm_msg* request, size_t payloadLength);
56
57 /** @brief Handler for getPLDMCommands
58 *
59 * @param[in] request - Request message payload
60 * @param[in] payload_length - Request message payload length
61 * @param[return] Response - PLDM Response message
62 */
63 Response getPLDMVersion(const pldm_msg* request, size_t payloadLength);
64
65 /** @brief Handler for getTID
66 *
67 * @param[in] request - Request message payload
68 * @param[in] payload_length - Request message payload length
69 * @param[return] Response - PLDM Response message
70 */
71 Response getTID(const pldm_msg* request, size_t payloadLength);
72};
73
Jinu Joy Thomasf666db12019-05-29 05:22:31 -050074} // namespace base
Deepak Kodihalli1b24f972019-02-01 04:09:13 -060075} // namespace responder
76} // namespace pldm