blob: ed2cd6e635196fab64364c0549c4763d4c1d006c [file] [log] [blame]
Jinu Joy Thomas7f57f442019-06-13 20:38:49 +05301#pragma once
2
Deepak Kodihallid130e1a2020-06-17 05:55:32 -05003#include "common/utils.hpp"
Jayashankar Padathdb124362021-01-28 21:12:34 -06004#include "oem/ibm/requester/dbus_to_file_handler.hpp"
Sampa Misraaea5dde2020-08-31 08:33:47 -05005#include "oem_ibm_handler.hpp"
Deepak Kodihalli1521f6d2020-06-16 08:51:02 -05006#include "pldmd/handler.hpp"
Sampa Misrac0c79482021-06-02 08:01:54 -05007#include "requester/handler.hpp"
Deepak Kodihallibc669f12019-11-28 08:52:07 -06008
Deepak Kodihalli15211b42019-12-14 02:24:49 -06009#include <fcntl.h>
George Liuc453e162022-12-21 17:16:23 +080010#include <libpldm/base.h>
Andrew Jeffery21f128d2024-01-15 15:34:26 +103011#include <libpldm/oem/ibm/file_io.h>
12#include <libpldm/oem/ibm/host.h>
Deepak Kodihalli15211b42019-12-14 02:24:49 -060013#include <sys/stat.h>
14#include <sys/types.h>
Jinu Joy Thomas7f57f442019-06-13 20:38:49 +053015#include <unistd.h>
16
Riya Dixit49cfb132023-03-02 04:26:53 -060017#include <phosphor-logging/lg2.hpp>
18
Pavithra Barithayab3b84b42024-08-23 11:43:57 +053019#include <cstdint>
Jinu Joy Thomas7f57f442019-06-13 20:38:49 +053020#include <filesystem>
Deepak Kodihalli15211b42019-12-14 02:24:49 -060021#include <iostream>
Priyanga8b976652019-06-27 11:30:33 -050022#include <vector>
Jinu Joy Thomas7f57f442019-06-13 20:38:49 +053023
Riya Dixit49cfb132023-03-02 04:26:53 -060024PHOSPHOR_LOG2_USING;
25
Jinu Joy Thomas7f57f442019-06-13 20:38:49 +053026namespace pldm
27{
Jinu Joy Thomas7f57f442019-06-13 20:38:49 +053028namespace responder
29{
Jinu Joy Thomas7f57f442019-06-13 20:38:49 +053030namespace dma
31{
Jinu Joy Thomas7f57f442019-06-13 20:38:49 +053032// The minimum data size of dma transfer in bytes
33constexpr uint32_t minSize = 16;
34
Deepak Kodihalli4c164b02020-03-07 03:23:31 -060035constexpr size_t maxSize = DMA_MAXSIZE;
Jinu Joy Thomas7f57f442019-06-13 20:38:49 +053036
37namespace fs = std::filesystem;
38
39/**
40 * @class DMA
41 *
42 * Expose API to initiate transfer of data by DMA
43 *
44 * This class only exposes the public API transferDataHost to transfer data
45 * between BMC and host using DMA. This allows for mocking the transferDataHost
46 * for unit testing purposes.
47 */
48class DMA
49{
50 public:
51 /** @brief API to transfer data between BMC and host using DMA
52 *
53 * @param[in] path - pathname of the file to transfer data from or to
54 * @param[in] offset - offset in the file
55 * @param[in] length - length of the data to transfer
56 * @param[in] address - DMA address on the host
57 * @param[in] upstream - indicates direction of the transfer; true indicates
58 * transfer to the host
59 *
60 * @return returns 0 on success, negative errno on failure
61 */
Deepak Kodihalli15211b42019-12-14 02:24:49 -060062 int transferDataHost(int fd, uint32_t offset, uint32_t length,
Jinu Joy Thomas7f57f442019-06-13 20:38:49 +053063 uint64_t address, bool upstream);
Ravi Tejace1c96f2020-10-05 23:13:01 -050064
65 /** @brief API to transfer data on to unix socket from host using DMA
66 *
67 * @param[in] path - pathname of the file to transfer data from or to
68 * @param[in] length - length of the data to transfer
69 * @param[in] address - DMA address on the host
70 *
71 * @return returns 0 on success, negative errno on failure
72 */
73 int transferHostDataToSocket(int fd, uint32_t length, uint64_t address);
Jinu Joy Thomas7f57f442019-06-13 20:38:49 +053074};
75
76/** @brief Transfer the data between BMC and host using DMA.
77 *
78 * There is a max size for each DMA operation, transferAll API abstracts this
79 * and the requested length is broken down into multiple DMA operations if the
80 * length exceed max size.
81 *
82 * @tparam[in] T - DMA interface type
83 * @param[in] intf - interface passed to invoke DMA transfer
84 * @param[in] command - PLDM command
85 * @param[in] path - pathname of the file to transfer data from or to
86 * @param[in] offset - offset in the file
87 * @param[in] length - length of the data to transfer
88 * @param[in] address - DMA address on the host
89 * @param[in] upstream - indicates direction of the transfer; true indicates
90 * transfer to the host
Jinu Joy Thomas33705fd2019-07-02 16:03:05 +053091 * @param[in] instanceId - Message's instance id
Jinu Joy Thomas7f57f442019-06-13 20:38:49 +053092 * @return PLDM response message
93 */
94
95template <class DMAInterface>
96Response transferAll(DMAInterface* intf, uint8_t command, fs::path& path,
97 uint32_t offset, uint32_t length, uint64_t address,
Jinu Joy Thomas33705fd2019-07-02 16:03:05 +053098 bool upstream, uint8_t instanceId)
Jinu Joy Thomas7f57f442019-06-13 20:38:49 +053099{
100 uint32_t origLength = length;
101 Response response(sizeof(pldm_msg_hdr) + PLDM_RW_FILE_MEM_RESP_BYTES, 0);
102 auto responsePtr = reinterpret_cast<pldm_msg*>(response.data());
103
Deepak Kodihalli15211b42019-12-14 02:24:49 -0600104 int flags{};
105 if (upstream)
106 {
107 flags = O_RDONLY;
108 }
109 else if (fs::exists(path))
110 {
111 flags = O_RDWR;
112 }
113 else
114 {
115 flags = O_WRONLY;
116 }
117 int file = open(path.string().c_str(), flags);
118 if (file == -1)
119 {
Riya Dixit1e5c81e2024-05-03 07:54:00 -0500120 error("File at path '{PATH}' does not exist", "PATH", path);
Deepak Kodihalli15211b42019-12-14 02:24:49 -0600121 encode_rw_file_memory_resp(instanceId, command, PLDM_ERROR, 0,
122 responsePtr);
123 return response;
124 }
George Liu83409572019-12-24 18:42:54 +0800125 pldm::utils::CustomFD fd(file);
Deepak Kodihalli15211b42019-12-14 02:24:49 -0600126
Jinu Joy Thomas7f57f442019-06-13 20:38:49 +0530127 while (length > dma::maxSize)
128 {
Deepak Kodihalli15211b42019-12-14 02:24:49 -0600129 auto rc = intf->transferDataHost(fd(), offset, dma::maxSize, address,
Jinu Joy Thomas7f57f442019-06-13 20:38:49 +0530130 upstream);
131 if (rc < 0)
132 {
Jinu Joy Thomas33705fd2019-07-02 16:03:05 +0530133 encode_rw_file_memory_resp(instanceId, command, PLDM_ERROR, 0,
134 responsePtr);
Jinu Joy Thomas7f57f442019-06-13 20:38:49 +0530135 return response;
136 }
137
138 offset += dma::maxSize;
139 length -= dma::maxSize;
140 address += dma::maxSize;
141 }
142
Deepak Kodihalli15211b42019-12-14 02:24:49 -0600143 auto rc = intf->transferDataHost(fd(), offset, length, address, upstream);
Jinu Joy Thomas7f57f442019-06-13 20:38:49 +0530144 if (rc < 0)
145 {
Jinu Joy Thomas33705fd2019-07-02 16:03:05 +0530146 encode_rw_file_memory_resp(instanceId, command, PLDM_ERROR, 0,
147 responsePtr);
Jinu Joy Thomas7f57f442019-06-13 20:38:49 +0530148 return response;
149 }
150
Jinu Joy Thomas33705fd2019-07-02 16:03:05 +0530151 encode_rw_file_memory_resp(instanceId, command, PLDM_SUCCESS, origLength,
Jinu Joy Thomas7f57f442019-06-13 20:38:49 +0530152 responsePtr);
153 return response;
154}
155
156} // namespace dma
157
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600158namespace oem_ibm
159{
Jayashankar Padathdb124362021-01-28 21:12:34 -0600160static constexpr auto dumpObjPath = "/xyz/openbmc_project/dump/resource/entry/";
161static constexpr auto resDumpEntry = "com.ibm.Dump.Entry.Resource";
Varsha Kaverappa219ace92021-04-01 02:50:11 -0500162
163static constexpr auto certObjPath = "/xyz/openbmc_project/certs/ca/";
164static constexpr auto certAuthority =
165 "xyz.openbmc_project.PLDM.Provider.Certs.Authority.CSR";
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600166class Handler : public CmdHandler
167{
168 public:
Jayashankar Padathdb124362021-01-28 21:12:34 -0600169 Handler(oem_platform::Handler* oemPlatformHandler, int hostSockFd,
Andrew Jefferya330b2f2023-05-04 14:55:37 +0930170 uint8_t hostEid, pldm::InstanceIdDb* instanceIdDb,
Sampa Misrac0c79482021-06-02 08:01:54 -0500171 pldm::requester::Handler<pldm::requester::Request>* handler) :
Andrew Jeffery7d852862024-07-25 20:43:36 +0930172 oemPlatformHandler(oemPlatformHandler)
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600173 {
Delphine CC Chiud2e48992023-12-05 16:29:51 +0800174 handlers.emplace(
175 PLDM_READ_FILE_INTO_MEMORY,
176 [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
Patrick Williams16c2a0a2024-08-16 15:20:59 -0400177 return this->readFileIntoMemory(request, payloadLength);
178 });
Delphine CC Chiud2e48992023-12-05 16:29:51 +0800179 handlers.emplace(
180 PLDM_WRITE_FILE_FROM_MEMORY,
181 [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
Patrick Williams16c2a0a2024-08-16 15:20:59 -0400182 return this->writeFileFromMemory(request, payloadLength);
183 });
Delphine CC Chiud2e48992023-12-05 16:29:51 +0800184 handlers.emplace(
185 PLDM_WRITE_FILE_BY_TYPE_FROM_MEMORY,
186 [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
Patrick Williams16c2a0a2024-08-16 15:20:59 -0400187 return this->writeFileByTypeFromMemory(request, payloadLength);
188 });
Delphine CC Chiud2e48992023-12-05 16:29:51 +0800189 handlers.emplace(
190 PLDM_READ_FILE_BY_TYPE_INTO_MEMORY,
191 [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
Patrick Williams16c2a0a2024-08-16 15:20:59 -0400192 return this->readFileByTypeIntoMemory(request, payloadLength);
193 });
Delphine CC Chiud2e48992023-12-05 16:29:51 +0800194 handlers.emplace(
195 PLDM_READ_FILE_BY_TYPE,
196 [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
Patrick Williams16c2a0a2024-08-16 15:20:59 -0400197 return this->readFileByType(request, payloadLength);
198 });
Delphine CC Chiud2e48992023-12-05 16:29:51 +0800199 handlers.emplace(
200 PLDM_WRITE_FILE_BY_TYPE,
201 [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
Patrick Williams16c2a0a2024-08-16 15:20:59 -0400202 return this->writeFileByType(request, payloadLength);
203 });
Delphine CC Chiud2e48992023-12-05 16:29:51 +0800204 handlers.emplace(
205 PLDM_GET_FILE_TABLE,
206 [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
Patrick Williams16c2a0a2024-08-16 15:20:59 -0400207 return this->getFileTable(request, payloadLength);
208 });
Delphine CC Chiud2e48992023-12-05 16:29:51 +0800209 handlers.emplace(
210 PLDM_READ_FILE,
211 [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
Patrick Williams16c2a0a2024-08-16 15:20:59 -0400212 return this->readFile(request, payloadLength);
213 });
Delphine CC Chiud2e48992023-12-05 16:29:51 +0800214 handlers.emplace(
215 PLDM_WRITE_FILE,
216 [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
Patrick Williams16c2a0a2024-08-16 15:20:59 -0400217 return this->writeFile(request, payloadLength);
218 });
Delphine CC Chiud2e48992023-12-05 16:29:51 +0800219 handlers.emplace(
220 PLDM_FILE_ACK,
221 [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
Patrick Williams16c2a0a2024-08-16 15:20:59 -0400222 return this->fileAck(request, payloadLength);
223 });
Delphine CC Chiud2e48992023-12-05 16:29:51 +0800224 handlers.emplace(
225 PLDM_HOST_GET_ALERT_STATUS,
226 [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
Patrick Williams16c2a0a2024-08-16 15:20:59 -0400227 return this->getAlertStatus(request, payloadLength);
228 });
Delphine CC Chiud2e48992023-12-05 16:29:51 +0800229 handlers.emplace(
230 PLDM_NEW_FILE_AVAILABLE,
231 [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
Patrick Williams16c2a0a2024-08-16 15:20:59 -0400232 return this->newFileAvailable(request, payloadLength);
233 });
Pavithra Barithaya30d679f2024-06-10 04:43:56 -0500234 handlers.emplace(
235 PLDM_FILE_ACK_WITH_META_DATA,
236 [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
237 return this->fileAckWithMetaData(request, payloadLength);
238 });
Pavithra Barithayadde01462024-06-11 01:34:08 -0500239 handlers.emplace(
240 PLDM_NEW_FILE_AVAILABLE_WITH_META_DATA,
241 [this](pldm_tid_t, const pldm_msg* request, size_t payloadLength) {
242 return this->newFileAvailableWithMetaData(request,
243 payloadLength);
244 });
245
Patrick Williams84b790c2022-07-22 19:26:56 -0500246 resDumpMatcher = std::make_unique<sdbusplus::bus::match_t>(
Jayashankar Padathdb124362021-01-28 21:12:34 -0600247 pldm::utils::DBusHandler::getBus(),
248 sdbusplus::bus::match::rules::interfacesAdded() +
249 sdbusplus::bus::match::rules::argNpath(0, dumpObjPath),
Andrew Jefferya330b2f2023-05-04 14:55:37 +0930250 [this, hostSockFd, hostEid, instanceIdDb,
Patrick Williams84b790c2022-07-22 19:26:56 -0500251 handler](sdbusplus::message_t& msg) {
Patrick Williams16c2a0a2024-08-16 15:20:59 -0400252 std::map<
253 std::string,
254 std::map<std::string, std::variant<std::string, uint32_t>>>
255 interfaces;
256 sdbusplus::message::object_path path;
257 msg.read(path, interfaces);
258 std::string vspstring;
259 std::string password;
Jayashankar Padathdb124362021-01-28 21:12:34 -0600260
Patrick Williams16c2a0a2024-08-16 15:20:59 -0400261 for (const auto& interface : interfaces)
Jayashankar Padathdb124362021-01-28 21:12:34 -0600262 {
Patrick Williams16c2a0a2024-08-16 15:20:59 -0400263 if (interface.first == resDumpEntry)
Jayashankar Padathdb124362021-01-28 21:12:34 -0600264 {
Patrick Williams16c2a0a2024-08-16 15:20:59 -0400265 for (const auto& property : interface.second)
Jayashankar Padathdb124362021-01-28 21:12:34 -0600266 {
Patrick Williams16c2a0a2024-08-16 15:20:59 -0400267 if (property.first == "VSPString")
268 {
269 vspstring =
270 std::get<std::string>(property.second);
271 }
272 else if (property.first == "Password")
273 {
274 password =
275 std::get<std::string>(property.second);
276 }
Jayashankar Padathdb124362021-01-28 21:12:34 -0600277 }
Patrick Williams16c2a0a2024-08-16 15:20:59 -0400278 dbusToFileHandlers
279 .emplace_back(
280 std::make_unique<pldm::requester::oem_ibm::
281 DbusToFileHandler>(
282 hostSockFd, hostEid, instanceIdDb, path,
283 handler))
284 ->processNewResourceDump(vspstring, password);
285 break;
Jayashankar Padathdb124362021-01-28 21:12:34 -0600286 }
287 }
Patrick Williams16c2a0a2024-08-16 15:20:59 -0400288 });
Patrick Williams84b790c2022-07-22 19:26:56 -0500289 vmiCertMatcher = std::make_unique<sdbusplus::bus::match_t>(
Varsha Kaverappa219ace92021-04-01 02:50:11 -0500290 pldm::utils::DBusHandler::getBus(),
291 sdbusplus::bus::match::rules::interfacesAdded() +
292 sdbusplus::bus::match::rules::argNpath(0, certObjPath),
Andrew Jefferya330b2f2023-05-04 14:55:37 +0930293 [this, hostSockFd, hostEid, instanceIdDb,
Patrick Williams84b790c2022-07-22 19:26:56 -0500294 handler](sdbusplus::message_t& msg) {
Patrick Williams16c2a0a2024-08-16 15:20:59 -0400295 std::map<
296 std::string,
297 std::map<std::string, std::variant<std::string, uint32_t>>>
298 interfaces;
299 sdbusplus::message::object_path path;
300 msg.read(path, interfaces);
301 std::string csr;
Varsha Kaverappa219ace92021-04-01 02:50:11 -0500302
Patrick Williams16c2a0a2024-08-16 15:20:59 -0400303 for (const auto& interface : interfaces)
Varsha Kaverappa219ace92021-04-01 02:50:11 -0500304 {
Patrick Williams16c2a0a2024-08-16 15:20:59 -0400305 if (interface.first == certAuthority)
Varsha Kaverappa219ace92021-04-01 02:50:11 -0500306 {
Patrick Williams16c2a0a2024-08-16 15:20:59 -0400307 for (const auto& property : interface.second)
Varsha Kaverappa219ace92021-04-01 02:50:11 -0500308 {
Patrick Williams16c2a0a2024-08-16 15:20:59 -0400309 if (property.first == "CSR")
310 {
311 csr = std::get<std::string>(property.second);
312 auto fileHandle =
313 sdbusplus::message::object_path(path)
314 .filename();
Varsha Kaverappa219ace92021-04-01 02:50:11 -0500315
Patrick Williams16c2a0a2024-08-16 15:20:59 -0400316 dbusToFileHandlers
317 .emplace_back(std::make_unique<
318 pldm::requester::oem_ibm::
319 DbusToFileHandler>(
Andrew Jefferya330b2f2023-05-04 14:55:37 +0930320 hostSockFd, hostEid, instanceIdDb, path,
321 handler))
Patrick Williams16c2a0a2024-08-16 15:20:59 -0400322 ->newCsrFileAvailable(csr, fileHandle);
323 break;
324 }
Varsha Kaverappa219ace92021-04-01 02:50:11 -0500325 }
Patrick Williams16c2a0a2024-08-16 15:20:59 -0400326 break;
Varsha Kaverappa219ace92021-04-01 02:50:11 -0500327 }
328 }
Patrick Williams16c2a0a2024-08-16 15:20:59 -0400329 });
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600330 }
Tom Joseph0c6d22c2019-06-26 09:58:41 +0530331
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600332 /** @brief Handler for readFileIntoMemory command
333 *
334 * @param[in] request - pointer to PLDM request payload
335 * @param[in] payloadLength - length of the message
336 *
337 * @return PLDM response message
338 */
339 Response readFileIntoMemory(const pldm_msg* request, size_t payloadLength);
Sampa Misra854e61f2019-08-22 04:36:47 -0500340
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600341 /** @brief Handler for writeFileIntoMemory command
342 *
343 * @param[in] request - pointer to PLDM request payload
344 * @param[in] payloadLength - length of the message
345 *
346 * @return PLDM response message
347 */
348 Response writeFileFromMemory(const pldm_msg* request, size_t payloadLength);
Sampa Misra854e61f2019-08-22 04:36:47 -0500349
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600350 /** @brief Handler for writeFileByTypeFromMemory command
351 *
352 * @param[in] request - pointer to PLDM request payload
353 * @param[in] payloadLength - length of the message
354 *
355 * @return PLDM response message
356 */
Deepak Kodihallif6d3a832019-11-19 07:00:29 -0600357
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600358 Response writeFileByTypeFromMemory(const pldm_msg* request,
359 size_t payloadLength);
Deepak Kodihalli75e02f82019-11-20 02:51:05 -0600360
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600361 /** @brief Handler for readFileByTypeIntoMemory command
362 *
363 * @param[in] request - pointer to PLDM request payload
364 * @param[in] payloadLength - length of the message
365 *
366 * @return PLDM response message
367 */
368 Response readFileByTypeIntoMemory(const pldm_msg* request,
369 size_t payloadLength);
vkaverap5b914c32019-06-30 22:23:54 -0500370
Sampa Misra18967162020-01-14 02:31:41 -0600371 /** @brief Handler for writeFileByType command
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600372 *
373 * @param[in] request - pointer to PLDM request payload
374 * @param[in] payloadLength - length of the message
375 *
376 * @return PLDM response message
377 */
378 Response readFileByType(const pldm_msg* request, size_t payloadLength);
vkaverap5b914c32019-06-30 22:23:54 -0500379
Sampa Misra18967162020-01-14 02:31:41 -0600380 Response writeFileByType(const pldm_msg* request, size_t payloadLength);
381
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600382 /** @brief Handler for GetFileTable command
383 *
384 * @param[in] request - pointer to PLDM request payload
385 * @param[in] payloadLength - length of the message payload
386 *
387 * @return PLDM response message
388 */
389 Response getFileTable(const pldm_msg* request, size_t payloadLength);
390
391 /** @brief Handler for readFile command
392 *
393 * @param[in] request - PLDM request msg
394 * @param[in] payloadLength - length of the message payload
395 *
396 * @return PLDM response message
397 */
398 Response readFile(const pldm_msg* request, size_t payloadLength);
399
400 /** @brief Handler for writeFile command
401 *
402 * @param[in] request - PLDM request msg
403 * @param[in] payloadLength - length of the message payload
404 *
405 * @return PLDM response message
406 */
407 Response writeFile(const pldm_msg* request, size_t payloadLength);
Deepak Kodihalli2da1bfe2019-12-14 08:28:09 -0600408
409 Response fileAck(const pldm_msg* request, size_t payloadLength);
George Liu89aad712020-03-12 13:34:51 +0800410
411 /** @brief Handler for getAlertStatus command
412 *
413 * @param[in] request - PLDM request msg
414 * @param[in] payloadLength - length of the message payload
415 *
416 * @return PLDM response message
417 */
418 Response getAlertStatus(const pldm_msg* request, size_t payloadLength);
Sampa Misra18967162020-01-14 02:31:41 -0600419
420 /** @brief Handler for newFileAvailable command
421 *
422 * @param[in] request - PLDM request msg
423 * @param[in] payloadLength - length of the message payload
424 *
425 * @return PLDM response message
426 */
427 Response newFileAvailable(const pldm_msg* request, size_t payloadLength);
Sampa Misraaea5dde2020-08-31 08:33:47 -0500428
Pavithra Barithaya30d679f2024-06-10 04:43:56 -0500429 /** @brief Handler for fileAckWithMetaData command
430 *
431 * @param[in] request - PLDM request msg
432 * @param[in] payloadLength - length of the message payload
433 *
434 * @return PLDM response message
435 */
436 Response fileAckWithMetaData(const pldm_msg* request, size_t payloadLength);
437
Pavithra Barithayadde01462024-06-11 01:34:08 -0500438 /** @brief Handler for newFileAvailableWithMetaData command
439 *
440 * @param[in] request - PLDM request msg
441 * @param[in] payloadLength - length of the message payload
442 *
443 * @return PLDM response messsage
444 */
445 Response newFileAvailableWithMetaData(const pldm_msg* request,
446 size_t payloadLength);
447
Sampa Misraaea5dde2020-08-31 08:33:47 -0500448 private:
449 oem_platform::Handler* oemPlatformHandler;
Jayashankar Padathdb124362021-01-28 21:12:34 -0600450 using DBusInterfaceAdded = std::vector<std::pair<
451 std::string,
452 std::vector<std::pair<std::string, std::variant<std::string>>>>>;
Sampa Misrac0c79482021-06-02 08:01:54 -0500453 std::unique_ptr<pldm::requester::oem_ibm::DbusToFileHandler>
454 dbusToFileHandler; //!< pointer to send request to Host
Patrick Williams84b790c2022-07-22 19:26:56 -0500455 std::unique_ptr<sdbusplus::bus::match_t>
Patrick Williams6da4f912023-05-10 07:50:53 -0500456 resDumpMatcher; //!< Pointer to capture the interface added signal
457 //!< for new resource dump
Patrick Williams84b790c2022-07-22 19:26:56 -0500458 std::unique_ptr<sdbusplus::bus::match_t>
Patrick Williams6da4f912023-05-10 07:50:53 -0500459 vmiCertMatcher; //!< Pointer to capture the interface added signal
460 //!< for new csr string
Sampa Misrac0c79482021-06-02 08:01:54 -0500461 /** @brief PLDM request handler */
Sampa Misrac0c79482021-06-02 08:01:54 -0500462 std::vector<std::unique_ptr<pldm::requester::oem_ibm::DbusToFileHandler>>
463 dbusToFileHandlers;
Deepak Kodihallibc669f12019-11-28 08:52:07 -0600464};
465
466} // namespace oem_ibm
Jinu Joy Thomas7f57f442019-06-13 20:38:49 +0530467} // namespace responder
468} // namespace pldm