Kamalkumar Patel | 7d427f1 | 2024-05-16 03:44:00 -0500 | [diff] [blame] | 1 | #include "common/utils.hpp" |
Kamalkumar Patel | 4e69d25 | 2024-05-10 08:48:03 -0500 | [diff] [blame] | 2 | #include "libpldmresponder/oem_handler.hpp" |
| 3 | |
Andrew Jeffery | 41ca40d | 2024-06-19 16:52:21 +0930 | [diff] [blame] | 4 | #include <libpldm/pdr.h> |
| 5 | |
Kamalkumar Patel | 4e69d25 | 2024-05-10 08:48:03 -0500 | [diff] [blame] | 6 | #include <nlohmann/json.hpp> |
| 7 | #include <phosphor-logging/lg2.hpp> |
| 8 | |
| 9 | #include <filesystem> |
| 10 | #include <fstream> |
| 11 | #include <map> |
| 12 | #include <string> |
| 13 | #include <vector> |
| 14 | |
| 15 | PHOSPHOR_LOG2_USING; |
Kamalkumar Patel | 7d427f1 | 2024-05-16 03:44:00 -0500 | [diff] [blame] | 16 | |
Kamalkumar Patel | 4e69d25 | 2024-05-10 08:48:03 -0500 | [diff] [blame] | 17 | namespace pldm |
| 18 | { |
Kamalkumar Patel | 4e69d25 | 2024-05-10 08:48:03 -0500 | [diff] [blame] | 19 | namespace hostbmc |
| 20 | { |
| 21 | namespace utils |
| 22 | { |
| 23 | |
Kamalkumar Patel | 4e69d25 | 2024-05-10 08:48:03 -0500 | [diff] [blame] | 24 | /** @brief Vector a entity name to pldm_entity from entity association tree |
| 25 | * @param[in] entityAssoc - Vector of associated pldm entities |
| 26 | * @param[in] entityTree - entity association tree |
| 27 | * @param[out] objPathMap - maps an object path to pldm_entity from the |
| 28 | * BMC's entity association tree |
| 29 | * @return |
| 30 | */ |
Kamalkumar Patel | 15ce5a1 | 2024-05-07 11:45:11 -0500 | [diff] [blame] | 31 | void updateEntityAssociation( |
Kamalkumar Patel | 7d427f1 | 2024-05-16 03:44:00 -0500 | [diff] [blame] | 32 | const pldm::utils::EntityAssociations& entityAssoc, |
| 33 | pldm_entity_association_tree* entityTree, |
| 34 | pldm::utils::ObjectPathMaps& objPathMap, pldm::utils::EntityMaps entityMaps, |
Kamalkumar Patel | 15ce5a1 | 2024-05-07 11:45:11 -0500 | [diff] [blame] | 35 | pldm::responder::oem_platform::Handler* oemPlatformHandler); |
Kamalkumar Patel | 516122e | 2024-05-07 04:39:32 -0500 | [diff] [blame] | 36 | |
| 37 | /** @brief Parsing entity to DBus string mapping from json file |
| 38 | * |
| 39 | * @param[in] filePath - JSON file path for parsing |
| 40 | * |
| 41 | * @return returns the entity to DBus string mapping object |
| 42 | */ |
Kamalkumar Patel | 7d427f1 | 2024-05-16 03:44:00 -0500 | [diff] [blame] | 43 | pldm::utils::EntityMaps parseEntityMap(const fs::path& filePath); |
Kamalkumar Patel | 4e69d25 | 2024-05-10 08:48:03 -0500 | [diff] [blame] | 44 | |
| 45 | } // namespace utils |
| 46 | } // namespace hostbmc |
| 47 | } // namespace pldm |