blob: 7e2f5c88730d32e49ed4980878b4a86bbf237d2e [file] [log] [blame]
Kamalkumar Patel7d427f12024-05-16 03:44:00 -05001#include "common/utils.hpp"
Kamalkumar Patel4e69d252024-05-10 08:48:03 -05002#include "libpldmresponder/oem_handler.hpp"
3
Andrew Jeffery41ca40d2024-06-19 16:52:21 +09304#include <libpldm/pdr.h>
5
Kamalkumar Patel4e69d252024-05-10 08:48:03 -05006#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
15PHOSPHOR_LOG2_USING;
Kamalkumar Patel7d427f12024-05-16 03:44:00 -050016
Kamalkumar Patel4e69d252024-05-10 08:48:03 -050017namespace pldm
18{
Kamalkumar Patel4e69d252024-05-10 08:48:03 -050019namespace hostbmc
20{
21namespace utils
22{
23
Kamalkumar Patel4e69d252024-05-10 08:48:03 -050024/** @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 Patel15ce5a12024-05-07 11:45:11 -050031void updateEntityAssociation(
Kamalkumar Patel7d427f12024-05-16 03:44:00 -050032 const pldm::utils::EntityAssociations& entityAssoc,
33 pldm_entity_association_tree* entityTree,
34 pldm::utils::ObjectPathMaps& objPathMap, pldm::utils::EntityMaps entityMaps,
Kamalkumar Patel15ce5a12024-05-07 11:45:11 -050035 pldm::responder::oem_platform::Handler* oemPlatformHandler);
Kamalkumar Patel516122e2024-05-07 04:39:32 -050036
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 Patel7d427f12024-05-16 03:44:00 -050043pldm::utils::EntityMaps parseEntityMap(const fs::path& filePath);
Kamalkumar Patel4e69d252024-05-10 08:48:03 -050044
45} // namespace utils
46} // namespace hostbmc
47} // namespace pldm