Jinu Joy Thomas | 7f57f44 | 2019-06-13 20:38:49 +0530 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Deepak Kodihalli | 4c164b0 | 2020-03-07 03:23:31 -0600 | [diff] [blame] | 3 | #include "config.h" |
| 4 | |
George Liu | 6492f52 | 2020-06-16 10:34:05 +0800 | [diff] [blame] | 5 | #include "libpldm/base.h" |
| 6 | #include "oem/ibm/libpldm/file_io.h" |
| 7 | #include "oem/ibm/libpldm/host.h" |
| 8 | |
Deepak Kodihalli | d130e1a | 2020-06-17 05:55:32 -0500 | [diff] [blame] | 9 | #include "common/utils.hpp" |
Jayashankar Padath | db12436 | 2021-01-28 21:12:34 -0600 | [diff] [blame] | 10 | #include "oem/ibm/requester/dbus_to_file_handler.hpp" |
Sampa Misra | aea5dde | 2020-08-31 08:33:47 -0500 | [diff] [blame] | 11 | #include "oem_ibm_handler.hpp" |
Deepak Kodihalli | 1521f6d | 2020-06-16 08:51:02 -0500 | [diff] [blame] | 12 | #include "pldmd/handler.hpp" |
Deepak Kodihalli | bc669f1 | 2019-11-28 08:52:07 -0600 | [diff] [blame] | 13 | |
Deepak Kodihalli | 15211b4 | 2019-12-14 02:24:49 -0600 | [diff] [blame] | 14 | #include <fcntl.h> |
Jinu Joy Thomas | 7f57f44 | 2019-06-13 20:38:49 +0530 | [diff] [blame] | 15 | #include <stdint.h> |
Deepak Kodihalli | 15211b4 | 2019-12-14 02:24:49 -0600 | [diff] [blame] | 16 | #include <sys/stat.h> |
| 17 | #include <sys/types.h> |
Jinu Joy Thomas | 7f57f44 | 2019-06-13 20:38:49 +0530 | [diff] [blame] | 18 | #include <unistd.h> |
| 19 | |
| 20 | #include <filesystem> |
Deepak Kodihalli | 15211b4 | 2019-12-14 02:24:49 -0600 | [diff] [blame] | 21 | #include <iostream> |
Priyanga | 8b97665 | 2019-06-27 11:30:33 -0500 | [diff] [blame] | 22 | #include <vector> |
Jinu Joy Thomas | 7f57f44 | 2019-06-13 20:38:49 +0530 | [diff] [blame] | 23 | |
Jinu Joy Thomas | 7f57f44 | 2019-06-13 20:38:49 +0530 | [diff] [blame] | 24 | namespace pldm |
| 25 | { |
Jinu Joy Thomas | 7f57f44 | 2019-06-13 20:38:49 +0530 | [diff] [blame] | 26 | namespace responder |
| 27 | { |
Jinu Joy Thomas | 7f57f44 | 2019-06-13 20:38:49 +0530 | [diff] [blame] | 28 | namespace dma |
| 29 | { |
| 30 | |
| 31 | // The minimum data size of dma transfer in bytes |
| 32 | constexpr uint32_t minSize = 16; |
| 33 | |
Deepak Kodihalli | 4c164b0 | 2020-03-07 03:23:31 -0600 | [diff] [blame] | 34 | constexpr size_t maxSize = DMA_MAXSIZE; |
Jinu Joy Thomas | 7f57f44 | 2019-06-13 20:38:49 +0530 | [diff] [blame] | 35 | |
| 36 | namespace fs = std::filesystem; |
| 37 | |
| 38 | /** |
| 39 | * @class DMA |
| 40 | * |
| 41 | * Expose API to initiate transfer of data by DMA |
| 42 | * |
| 43 | * This class only exposes the public API transferDataHost to transfer data |
| 44 | * between BMC and host using DMA. This allows for mocking the transferDataHost |
| 45 | * for unit testing purposes. |
| 46 | */ |
| 47 | class DMA |
| 48 | { |
| 49 | public: |
| 50 | /** @brief API to transfer data between BMC and host using DMA |
| 51 | * |
| 52 | * @param[in] path - pathname of the file to transfer data from or to |
| 53 | * @param[in] offset - offset in the file |
| 54 | * @param[in] length - length of the data to transfer |
| 55 | * @param[in] address - DMA address on the host |
| 56 | * @param[in] upstream - indicates direction of the transfer; true indicates |
| 57 | * transfer to the host |
| 58 | * |
| 59 | * @return returns 0 on success, negative errno on failure |
| 60 | */ |
Deepak Kodihalli | 15211b4 | 2019-12-14 02:24:49 -0600 | [diff] [blame] | 61 | int transferDataHost(int fd, uint32_t offset, uint32_t length, |
Jinu Joy Thomas | 7f57f44 | 2019-06-13 20:38:49 +0530 | [diff] [blame] | 62 | uint64_t address, bool upstream); |
Ravi Teja | ce1c96f | 2020-10-05 23:13:01 -0500 | [diff] [blame] | 63 | |
| 64 | /** @brief API to transfer data on to unix socket from host using DMA |
| 65 | * |
| 66 | * @param[in] path - pathname of the file to transfer data from or to |
| 67 | * @param[in] length - length of the data to transfer |
| 68 | * @param[in] address - DMA address on the host |
| 69 | * |
| 70 | * @return returns 0 on success, negative errno on failure |
| 71 | */ |
| 72 | int transferHostDataToSocket(int fd, uint32_t length, uint64_t address); |
Jinu Joy Thomas | 7f57f44 | 2019-06-13 20:38:49 +0530 | [diff] [blame] | 73 | }; |
| 74 | |
| 75 | /** @brief Transfer the data between BMC and host using DMA. |
| 76 | * |
| 77 | * There is a max size for each DMA operation, transferAll API abstracts this |
| 78 | * and the requested length is broken down into multiple DMA operations if the |
| 79 | * length exceed max size. |
| 80 | * |
| 81 | * @tparam[in] T - DMA interface type |
| 82 | * @param[in] intf - interface passed to invoke DMA transfer |
| 83 | * @param[in] command - PLDM command |
| 84 | * @param[in] path - pathname of the file to transfer data from or to |
| 85 | * @param[in] offset - offset in the file |
| 86 | * @param[in] length - length of the data to transfer |
| 87 | * @param[in] address - DMA address on the host |
| 88 | * @param[in] upstream - indicates direction of the transfer; true indicates |
| 89 | * transfer to the host |
Jinu Joy Thomas | 33705fd | 2019-07-02 16:03:05 +0530 | [diff] [blame] | 90 | * @param[in] instanceId - Message's instance id |
Jinu Joy Thomas | 7f57f44 | 2019-06-13 20:38:49 +0530 | [diff] [blame] | 91 | * @return PLDM response message |
| 92 | */ |
| 93 | |
| 94 | template <class DMAInterface> |
| 95 | Response transferAll(DMAInterface* intf, uint8_t command, fs::path& path, |
| 96 | uint32_t offset, uint32_t length, uint64_t address, |
Jinu Joy Thomas | 33705fd | 2019-07-02 16:03:05 +0530 | [diff] [blame] | 97 | bool upstream, uint8_t instanceId) |
Jinu Joy Thomas | 7f57f44 | 2019-06-13 20:38:49 +0530 | [diff] [blame] | 98 | { |
| 99 | uint32_t origLength = length; |
| 100 | Response response(sizeof(pldm_msg_hdr) + PLDM_RW_FILE_MEM_RESP_BYTES, 0); |
| 101 | auto responsePtr = reinterpret_cast<pldm_msg*>(response.data()); |
| 102 | |
Deepak Kodihalli | 15211b4 | 2019-12-14 02:24:49 -0600 | [diff] [blame] | 103 | int flags{}; |
| 104 | if (upstream) |
| 105 | { |
| 106 | flags = O_RDONLY; |
| 107 | } |
| 108 | else if (fs::exists(path)) |
| 109 | { |
| 110 | flags = O_RDWR; |
| 111 | } |
| 112 | else |
| 113 | { |
| 114 | flags = O_WRONLY; |
| 115 | } |
| 116 | int file = open(path.string().c_str(), flags); |
| 117 | if (file == -1) |
| 118 | { |
| 119 | std::cerr << "File does not exist, path = " << path.string() << "\n"; |
| 120 | encode_rw_file_memory_resp(instanceId, command, PLDM_ERROR, 0, |
| 121 | responsePtr); |
| 122 | return response; |
| 123 | } |
George Liu | 8340957 | 2019-12-24 18:42:54 +0800 | [diff] [blame] | 124 | pldm::utils::CustomFD fd(file); |
Deepak Kodihalli | 15211b4 | 2019-12-14 02:24:49 -0600 | [diff] [blame] | 125 | |
Jinu Joy Thomas | 7f57f44 | 2019-06-13 20:38:49 +0530 | [diff] [blame] | 126 | while (length > dma::maxSize) |
| 127 | { |
Deepak Kodihalli | 15211b4 | 2019-12-14 02:24:49 -0600 | [diff] [blame] | 128 | auto rc = intf->transferDataHost(fd(), offset, dma::maxSize, address, |
Jinu Joy Thomas | 7f57f44 | 2019-06-13 20:38:49 +0530 | [diff] [blame] | 129 | upstream); |
| 130 | if (rc < 0) |
| 131 | { |
Jinu Joy Thomas | 33705fd | 2019-07-02 16:03:05 +0530 | [diff] [blame] | 132 | encode_rw_file_memory_resp(instanceId, command, PLDM_ERROR, 0, |
| 133 | responsePtr); |
Jinu Joy Thomas | 7f57f44 | 2019-06-13 20:38:49 +0530 | [diff] [blame] | 134 | return response; |
| 135 | } |
| 136 | |
| 137 | offset += dma::maxSize; |
| 138 | length -= dma::maxSize; |
| 139 | address += dma::maxSize; |
| 140 | } |
| 141 | |
Deepak Kodihalli | 15211b4 | 2019-12-14 02:24:49 -0600 | [diff] [blame] | 142 | auto rc = intf->transferDataHost(fd(), offset, length, address, upstream); |
Jinu Joy Thomas | 7f57f44 | 2019-06-13 20:38:49 +0530 | [diff] [blame] | 143 | if (rc < 0) |
| 144 | { |
Jinu Joy Thomas | 33705fd | 2019-07-02 16:03:05 +0530 | [diff] [blame] | 145 | encode_rw_file_memory_resp(instanceId, command, PLDM_ERROR, 0, |
| 146 | responsePtr); |
Jinu Joy Thomas | 7f57f44 | 2019-06-13 20:38:49 +0530 | [diff] [blame] | 147 | return response; |
| 148 | } |
| 149 | |
Jinu Joy Thomas | 33705fd | 2019-07-02 16:03:05 +0530 | [diff] [blame] | 150 | encode_rw_file_memory_resp(instanceId, command, PLDM_SUCCESS, origLength, |
Jinu Joy Thomas | 7f57f44 | 2019-06-13 20:38:49 +0530 | [diff] [blame] | 151 | responsePtr); |
| 152 | return response; |
| 153 | } |
| 154 | |
| 155 | } // namespace dma |
| 156 | |
Deepak Kodihalli | bc669f1 | 2019-11-28 08:52:07 -0600 | [diff] [blame] | 157 | namespace oem_ibm |
| 158 | { |
Jayashankar Padath | db12436 | 2021-01-28 21:12:34 -0600 | [diff] [blame] | 159 | static constexpr auto dumpObjPath = "/xyz/openbmc_project/dump/resource/entry/"; |
| 160 | static constexpr auto resDumpEntry = "com.ibm.Dump.Entry.Resource"; |
Varsha Kaverappa | 219ace9 | 2021-04-01 02:50:11 -0500 | [diff] [blame] | 161 | |
| 162 | static constexpr auto certObjPath = "/xyz/openbmc_project/certs/ca/"; |
| 163 | static constexpr auto certAuthority = |
| 164 | "xyz.openbmc_project.PLDM.Provider.Certs.Authority.CSR"; |
Deepak Kodihalli | bc669f1 | 2019-11-28 08:52:07 -0600 | [diff] [blame] | 165 | class Handler : public CmdHandler |
| 166 | { |
| 167 | public: |
Jayashankar Padath | db12436 | 2021-01-28 21:12:34 -0600 | [diff] [blame] | 168 | Handler(oem_platform::Handler* oemPlatformHandler, int hostSockFd, |
| 169 | uint8_t hostEid, dbus_api::Requester* dbusImplReqester) : |
| 170 | oemPlatformHandler(oemPlatformHandler), |
| 171 | hostSockFd(hostSockFd), hostEid(hostEid), |
| 172 | dbusImplReqester(dbusImplReqester) |
Deepak Kodihalli | bc669f1 | 2019-11-28 08:52:07 -0600 | [diff] [blame] | 173 | { |
| 174 | handlers.emplace(PLDM_READ_FILE_INTO_MEMORY, |
| 175 | [this](const pldm_msg* request, size_t payloadLength) { |
| 176 | return this->readFileIntoMemory(request, |
| 177 | payloadLength); |
| 178 | }); |
| 179 | handlers.emplace(PLDM_WRITE_FILE_FROM_MEMORY, |
| 180 | [this](const pldm_msg* request, size_t payloadLength) { |
| 181 | return this->writeFileFromMemory(request, |
| 182 | payloadLength); |
| 183 | }); |
| 184 | handlers.emplace(PLDM_WRITE_FILE_BY_TYPE_FROM_MEMORY, |
| 185 | [this](const pldm_msg* request, size_t payloadLength) { |
| 186 | return this->writeFileByTypeFromMemory( |
| 187 | request, payloadLength); |
| 188 | }); |
| 189 | handlers.emplace(PLDM_READ_FILE_BY_TYPE_INTO_MEMORY, |
| 190 | [this](const pldm_msg* request, size_t payloadLength) { |
| 191 | return this->readFileByTypeIntoMemory( |
| 192 | request, payloadLength); |
| 193 | }); |
| 194 | handlers.emplace(PLDM_READ_FILE_BY_TYPE, [this](const pldm_msg* request, |
| 195 | size_t payloadLength) { |
| 196 | return this->readFileByType(request, payloadLength); |
| 197 | }); |
Sampa Misra | 1896716 | 2020-01-14 02:31:41 -0600 | [diff] [blame] | 198 | handlers.emplace(PLDM_WRITE_FILE_BY_TYPE, |
| 199 | [this](const pldm_msg* request, size_t payloadLength) { |
| 200 | return this->writeFileByType(request, |
| 201 | payloadLength); |
| 202 | }); |
Deepak Kodihalli | bc669f1 | 2019-11-28 08:52:07 -0600 | [diff] [blame] | 203 | handlers.emplace(PLDM_GET_FILE_TABLE, |
| 204 | [this](const pldm_msg* request, size_t payloadLength) { |
| 205 | return this->getFileTable(request, payloadLength); |
| 206 | }); |
| 207 | handlers.emplace(PLDM_READ_FILE, |
| 208 | [this](const pldm_msg* request, size_t payloadLength) { |
| 209 | return this->readFile(request, payloadLength); |
| 210 | }); |
| 211 | handlers.emplace(PLDM_WRITE_FILE, |
| 212 | [this](const pldm_msg* request, size_t payloadLength) { |
| 213 | return this->writeFile(request, payloadLength); |
| 214 | }); |
Deepak Kodihalli | 2da1bfe | 2019-12-14 08:28:09 -0600 | [diff] [blame] | 215 | handlers.emplace(PLDM_FILE_ACK, |
| 216 | [this](const pldm_msg* request, size_t payloadLength) { |
| 217 | return this->fileAck(request, payloadLength); |
| 218 | }); |
George Liu | 89aad71 | 2020-03-12 13:34:51 +0800 | [diff] [blame] | 219 | handlers.emplace(PLDM_HOST_GET_ALERT_STATUS, |
| 220 | [this](const pldm_msg* request, size_t payloadLength) { |
| 221 | return this->getAlertStatus(request, |
| 222 | payloadLength); |
| 223 | }); |
Sampa Misra | 1896716 | 2020-01-14 02:31:41 -0600 | [diff] [blame] | 224 | handlers.emplace(PLDM_NEW_FILE_AVAILABLE, |
| 225 | [this](const pldm_msg* request, size_t payloadLength) { |
| 226 | return this->newFileAvailable(request, |
| 227 | payloadLength); |
| 228 | }); |
Jayashankar Padath | db12436 | 2021-01-28 21:12:34 -0600 | [diff] [blame] | 229 | |
| 230 | resDumpMatcher = std::make_unique<sdbusplus::bus::match::match>( |
| 231 | pldm::utils::DBusHandler::getBus(), |
| 232 | sdbusplus::bus::match::rules::interfacesAdded() + |
| 233 | sdbusplus::bus::match::rules::argNpath(0, dumpObjPath), |
| 234 | [hostSockFd, hostEid, |
| 235 | dbusImplReqester](sdbusplus::message::message& msg) { |
| 236 | std::map< |
| 237 | std::string, |
| 238 | std::map<std::string, std::variant<std::string, uint32_t>>> |
| 239 | interfaces; |
| 240 | sdbusplus::message::object_path path; |
| 241 | msg.read(path, interfaces); |
| 242 | std::string vspstring; |
| 243 | std::string password; |
| 244 | |
| 245 | for (auto& interface : interfaces) |
| 246 | { |
| 247 | if (interface.first == resDumpEntry) |
| 248 | { |
| 249 | for (const auto& property : interface.second) |
| 250 | { |
| 251 | if (property.first == "VSPString") |
| 252 | { |
| 253 | vspstring = |
| 254 | std::get<std::string>(property.second); |
| 255 | } |
| 256 | else if (property.first == "Password") |
| 257 | { |
| 258 | password = |
| 259 | std::get<std::string>(property.second); |
| 260 | } |
| 261 | } |
| 262 | auto dbusToFileHandler = std::make_unique< |
| 263 | pldm::requester::oem_ibm::DbusToFileHandler>( |
| 264 | hostSockFd, hostEid, dbusImplReqester, path); |
| 265 | dbusToFileHandler->processNewResourceDump(vspstring, |
| 266 | password); |
| 267 | break; |
| 268 | } |
| 269 | } |
| 270 | }); |
Varsha Kaverappa | 219ace9 | 2021-04-01 02:50:11 -0500 | [diff] [blame] | 271 | vmiCertMatcher = std::make_unique<sdbusplus::bus::match::match>( |
| 272 | pldm::utils::DBusHandler::getBus(), |
| 273 | sdbusplus::bus::match::rules::interfacesAdded() + |
| 274 | sdbusplus::bus::match::rules::argNpath(0, certObjPath), |
| 275 | [hostSockFd, hostEid, |
| 276 | dbusImplReqester](sdbusplus::message::message& msg) { |
| 277 | std::map< |
| 278 | std::string, |
| 279 | std::map<std::string, std::variant<std::string, uint32_t>>> |
| 280 | interfaces; |
| 281 | sdbusplus::message::object_path path; |
| 282 | msg.read(path, interfaces); |
| 283 | std::string csr; |
| 284 | |
| 285 | for (auto& interface : interfaces) |
| 286 | { |
| 287 | if (interface.first == certAuthority) |
| 288 | { |
| 289 | for (const auto& property : interface.second) |
| 290 | { |
| 291 | if (property.first == "CSR") |
| 292 | { |
| 293 | csr = std::get<std::string>(property.second); |
| 294 | auto fileHandle = |
| 295 | sdbusplus::message::object_path(path) |
| 296 | .filename(); |
| 297 | |
| 298 | auto dbusToFileHandler = |
| 299 | std::make_unique<pldm::requester::oem_ibm:: |
| 300 | DbusToFileHandler>( |
| 301 | hostSockFd, hostEid, dbusImplReqester, |
| 302 | path); |
| 303 | dbusToFileHandler->newCsrFileAvailable( |
| 304 | csr, fileHandle); |
| 305 | break; |
| 306 | } |
| 307 | } |
| 308 | break; |
| 309 | } |
| 310 | } |
| 311 | }); |
Deepak Kodihalli | bc669f1 | 2019-11-28 08:52:07 -0600 | [diff] [blame] | 312 | } |
Tom Joseph | 0c6d22c | 2019-06-26 09:58:41 +0530 | [diff] [blame] | 313 | |
Deepak Kodihalli | bc669f1 | 2019-11-28 08:52:07 -0600 | [diff] [blame] | 314 | /** @brief Handler for readFileIntoMemory command |
| 315 | * |
| 316 | * @param[in] request - pointer to PLDM request payload |
| 317 | * @param[in] payloadLength - length of the message |
| 318 | * |
| 319 | * @return PLDM response message |
| 320 | */ |
| 321 | Response readFileIntoMemory(const pldm_msg* request, size_t payloadLength); |
Sampa Misra | 854e61f | 2019-08-22 04:36:47 -0500 | [diff] [blame] | 322 | |
Deepak Kodihalli | bc669f1 | 2019-11-28 08:52:07 -0600 | [diff] [blame] | 323 | /** @brief Handler for writeFileIntoMemory command |
| 324 | * |
| 325 | * @param[in] request - pointer to PLDM request payload |
| 326 | * @param[in] payloadLength - length of the message |
| 327 | * |
| 328 | * @return PLDM response message |
| 329 | */ |
| 330 | Response writeFileFromMemory(const pldm_msg* request, size_t payloadLength); |
Sampa Misra | 854e61f | 2019-08-22 04:36:47 -0500 | [diff] [blame] | 331 | |
Deepak Kodihalli | bc669f1 | 2019-11-28 08:52:07 -0600 | [diff] [blame] | 332 | /** @brief Handler for writeFileByTypeFromMemory 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 | */ |
Deepak Kodihalli | f6d3a83 | 2019-11-19 07:00:29 -0600 | [diff] [blame] | 339 | |
Deepak Kodihalli | bc669f1 | 2019-11-28 08:52:07 -0600 | [diff] [blame] | 340 | Response writeFileByTypeFromMemory(const pldm_msg* request, |
| 341 | size_t payloadLength); |
Deepak Kodihalli | 75e02f8 | 2019-11-20 02:51:05 -0600 | [diff] [blame] | 342 | |
Deepak Kodihalli | bc669f1 | 2019-11-28 08:52:07 -0600 | [diff] [blame] | 343 | /** @brief Handler for readFileByTypeIntoMemory command |
| 344 | * |
| 345 | * @param[in] request - pointer to PLDM request payload |
| 346 | * @param[in] payloadLength - length of the message |
| 347 | * |
| 348 | * @return PLDM response message |
| 349 | */ |
| 350 | Response readFileByTypeIntoMemory(const pldm_msg* request, |
| 351 | size_t payloadLength); |
vkaverap | 5b914c3 | 2019-06-30 22:23:54 -0500 | [diff] [blame] | 352 | |
Sampa Misra | 1896716 | 2020-01-14 02:31:41 -0600 | [diff] [blame] | 353 | /** @brief Handler for writeFileByType command |
Deepak Kodihalli | bc669f1 | 2019-11-28 08:52:07 -0600 | [diff] [blame] | 354 | * |
| 355 | * @param[in] request - pointer to PLDM request payload |
| 356 | * @param[in] payloadLength - length of the message |
| 357 | * |
| 358 | * @return PLDM response message |
| 359 | */ |
| 360 | Response readFileByType(const pldm_msg* request, size_t payloadLength); |
vkaverap | 5b914c3 | 2019-06-30 22:23:54 -0500 | [diff] [blame] | 361 | |
Sampa Misra | 1896716 | 2020-01-14 02:31:41 -0600 | [diff] [blame] | 362 | Response writeFileByType(const pldm_msg* request, size_t payloadLength); |
| 363 | |
Deepak Kodihalli | bc669f1 | 2019-11-28 08:52:07 -0600 | [diff] [blame] | 364 | /** @brief Handler for GetFileTable command |
| 365 | * |
| 366 | * @param[in] request - pointer to PLDM request payload |
| 367 | * @param[in] payloadLength - length of the message payload |
| 368 | * |
| 369 | * @return PLDM response message |
| 370 | */ |
| 371 | Response getFileTable(const pldm_msg* request, size_t payloadLength); |
| 372 | |
| 373 | /** @brief Handler for readFile command |
| 374 | * |
| 375 | * @param[in] request - PLDM request msg |
| 376 | * @param[in] payloadLength - length of the message payload |
| 377 | * |
| 378 | * @return PLDM response message |
| 379 | */ |
| 380 | Response readFile(const pldm_msg* request, size_t payloadLength); |
| 381 | |
| 382 | /** @brief Handler for writeFile command |
| 383 | * |
| 384 | * @param[in] request - PLDM request msg |
| 385 | * @param[in] payloadLength - length of the message payload |
| 386 | * |
| 387 | * @return PLDM response message |
| 388 | */ |
| 389 | Response writeFile(const pldm_msg* request, size_t payloadLength); |
Deepak Kodihalli | 2da1bfe | 2019-12-14 08:28:09 -0600 | [diff] [blame] | 390 | |
| 391 | Response fileAck(const pldm_msg* request, size_t payloadLength); |
George Liu | 89aad71 | 2020-03-12 13:34:51 +0800 | [diff] [blame] | 392 | |
| 393 | /** @brief Handler for getAlertStatus command |
| 394 | * |
| 395 | * @param[in] request - PLDM request msg |
| 396 | * @param[in] payloadLength - length of the message payload |
| 397 | * |
| 398 | * @return PLDM response message |
| 399 | */ |
| 400 | Response getAlertStatus(const pldm_msg* request, size_t payloadLength); |
Sampa Misra | 1896716 | 2020-01-14 02:31:41 -0600 | [diff] [blame] | 401 | |
| 402 | /** @brief Handler for newFileAvailable command |
| 403 | * |
| 404 | * @param[in] request - PLDM request msg |
| 405 | * @param[in] payloadLength - length of the message payload |
| 406 | * |
| 407 | * @return PLDM response message |
| 408 | */ |
| 409 | Response newFileAvailable(const pldm_msg* request, size_t payloadLength); |
Sampa Misra | aea5dde | 2020-08-31 08:33:47 -0500 | [diff] [blame] | 410 | |
| 411 | private: |
| 412 | oem_platform::Handler* oemPlatformHandler; |
Jayashankar Padath | db12436 | 2021-01-28 21:12:34 -0600 | [diff] [blame] | 413 | int hostSockFd; |
| 414 | uint8_t hostEid; |
| 415 | dbus_api::Requester* dbusImplReqester; |
| 416 | using DBusInterfaceAdded = std::vector<std::pair< |
| 417 | std::string, |
| 418 | std::vector<std::pair<std::string, std::variant<std::string>>>>>; |
| 419 | std::unique_ptr<sdbusplus::bus::match::match> |
| 420 | resDumpMatcher; //!< Pointer to capture the interface added signal |
| 421 | //!< for new resource dump |
Varsha Kaverappa | 219ace9 | 2021-04-01 02:50:11 -0500 | [diff] [blame] | 422 | std::unique_ptr<sdbusplus::bus::match::match> |
| 423 | vmiCertMatcher; //!< Pointer to capture the interface added signal |
| 424 | //!< for new csr string |
Deepak Kodihalli | bc669f1 | 2019-11-28 08:52:07 -0600 | [diff] [blame] | 425 | }; |
| 426 | |
| 427 | } // namespace oem_ibm |
Jinu Joy Thomas | 7f57f44 | 2019-06-13 20:38:49 +0530 | [diff] [blame] | 428 | } // namespace responder |
| 429 | } // namespace pldm |