blob: 4870c4a0f975245670e09dabdc615a190ac7e322 [file] [log] [blame]
Deepak Kodihallic6e8fb52019-05-02 08:35:31 -05001#pragma once
2
Deepak Kodihallid130e1a2020-06-17 05:55:32 -05003#include "common/utils.hpp"
George Liue53193f2020-02-24 09:23:26 +08004#include "libpldmresponder/pdr_utils.hpp"
Deepak Kodihallic6e8fb52019-05-02 08:35:31 -05005
6#include <stdint.h>
7
Deepak Kodihallic6e8fb52019-05-02 08:35:31 -05008namespace pldm
9{
10
11namespace responder
12{
13
14namespace pdr
15{
George Liue53193f2020-02-24 09:23:26 +080016
Sampa Misra12afe112020-05-25 11:40:44 -050017constexpr uint8_t BmcMctpEid = 8;
18constexpr uint8_t BmcPldmTerminusHandle = 1;
19constexpr uint8_t BmcTerminusId = 1;
20
George Liue53193f2020-02-24 09:23:26 +080021/** @brief Build (if not built already) and retrieve PDR by the PDR types
22 *
23 * @param[in] dir - directory housing platform specific PDR JSON files
24 * @param[in] pdrType - the type of PDRs
25 *
26 * @return Repo - Instance of pdr::Repo
27 */
Brad Bishop5079ac42021-08-19 18:35:06 -040028void getRepoByType(const pldm::responder::pdr_utils::Repo& inRepo,
29 pldm::responder::pdr_utils::Repo& outRepo,
30 pldm::responder::pdr_utils::Type pdrType);
George Liue53193f2020-02-24 09:23:26 +080031
32/** @brief Get the record of PDR by the record handle
33 *
34 * @param[in] pdrRepo - pdr::RepoInterface
35 * @param[in] recordHandle - The recordHandle value for the PDR to be
36 * retrieved.
37 * @param[out] pdrEntry - PDR entry structure reference
38 *
39 * @return pldm_pdr_record - Instance of pdr::RepoInterface
40 */
Brad Bishop5079ac42021-08-19 18:35:06 -040041const pldm_pdr_record*
42 getRecordByHandle(const pldm::responder::pdr_utils::RepoInterface& pdrRepo,
43 pldm::responder::pdr_utils::RecordHandle recordHandle,
44 pldm::responder::pdr_utils::PdrEntry& pdrEntry);
Deepak Kodihallic6e8fb52019-05-02 08:35:31 -050045
46} // namespace pdr
47} // namespace responder
48} // namespace pldm