blob: d576fd412f4afe9b9c49cab5755c63cbc4749830 [file] [log] [blame]
Kamalkumar Patel4e69d252024-05-10 08:48:03 -05001#include "libpldm/pdr.h"
2
Kamalkumar Patel7d427f12024-05-16 03:44:00 -05003#include "common/utils.hpp"
Kamalkumar Patel4e69d252024-05-10 08:48:03 -05004#include "libpldmresponder/oem_handler.hpp"
5
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
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