Deepak Kodihalli | 1b24f97 | 2019-02-01 04:09:13 -0600 | [diff] [blame] | 1 | #pragma once |
| 2 | |
George Liu | 6492f52 | 2020-06-16 10:34:05 +0800 | [diff] [blame] | 3 | #include "libpldm/base.h" |
| 4 | |
Deepak Kodihalli | 1521f6d | 2020-06-16 08:51:02 -0500 | [diff] [blame] | 5 | #include "pldmd/handler.hpp" |
Deepak Kodihalli | bc669f1 | 2019-11-28 08:52:07 -0600 | [diff] [blame] | 6 | |
Deepak Kodihalli | 1b24f97 | 2019-02-01 04:09:13 -0600 | [diff] [blame] | 7 | #include <stdint.h> |
| 8 | |
| 9 | #include <vector> |
| 10 | |
Deepak Kodihalli | 1b24f97 | 2019-02-01 04:09:13 -0600 | [diff] [blame] | 11 | namespace pldm |
| 12 | { |
Deepak Kodihalli | 1b24f97 | 2019-02-01 04:09:13 -0600 | [diff] [blame] | 13 | namespace responder |
| 14 | { |
Jinu Joy Thomas | f666db1 | 2019-05-29 05:22:31 -0500 | [diff] [blame] | 15 | namespace base |
| 16 | { |
Deepak Kodihalli | bc669f1 | 2019-11-28 08:52:07 -0600 | [diff] [blame] | 17 | |
| 18 | class 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 Thomas | f666db1 | 2019-05-29 05:22:31 -0500 | [diff] [blame] | 74 | } // namespace base |
Deepak Kodihalli | 1b24f97 | 2019-02-01 04:09:13 -0600 | [diff] [blame] | 75 | } // namespace responder |
| 76 | } // namespace pldm |