blob: 6e5b6532d9497d54096f0bdbd5fea3d449767024 [file] [log] [blame]
Deepak Kodihalli1b24f972019-02-01 04:09:13 -06001#pragma once
2
George Liu6492f522020-06-16 10:34:05 +08003#include "libpldm/base.h"
4
Deepak Kodihalli1521f6d2020-06-16 08:51:02 -05005#include "pldmd/handler.hpp"
Deepak Kodihallibc669f12019-11-28 08:52:07 -06006
Deepak Kodihalli1b24f972019-02-01 04:09:13 -06007#include <stdint.h>
8
9#include <vector>
10
Deepak Kodihalli1b24f972019-02-01 04:09:13 -060011namespace 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