blob: 78925f7d9c4b3906695feb6d8f211b4db635981f [file] [log] [blame]
Deepak Kodihallic6e8fb52019-05-02 08:35:31 -05001#pragma once
2
George Liue53193f2020-02-24 09:23:26 +08003#include "libpldmresponder/pdr_utils.hpp"
Deepak Kodihallic6e8fb52019-05-02 08:35:31 -05004
5#include <stdint.h>
6
Deepak Kodihallic6e8fb52019-05-02 08:35:31 -05007#include <string>
Deepak Kodihallic6e8fb52019-05-02 08:35:31 -05008
George Liue53193f2020-02-24 09:23:26 +08009#include "libpldm/pdr.h"
Deepak Kodihallic6e8fb52019-05-02 08:35:31 -050010
George Liue53193f2020-02-24 09:23:26 +080011using namespace pldm::responder::pdr_utils;
12
Deepak Kodihallic6e8fb52019-05-02 08:35:31 -050013namespace pldm
14{
15
16namespace responder
17{
18
19namespace pdr
20{
George Liue53193f2020-02-24 09:23:26 +080021
22/** @brief Build (if not built already) and retrieve PDR by the PDR types
23 *
24 * @param[in] dir - directory housing platform specific PDR JSON files
25 * @param[in] pdrType - the type of PDRs
26 *
27 * @return Repo - Instance of pdr::Repo
28 */
Deepak Kodihallic682fe22020-03-04 00:42:54 -060029void getRepoByType(const Repo& inRepo, Repo& outRepo, Type pdrType);
George Liue53193f2020-02-24 09:23:26 +080030
31/** @brief Get the record of PDR by the record handle
32 *
33 * @param[in] pdrRepo - pdr::RepoInterface
34 * @param[in] recordHandle - The recordHandle value for the PDR to be
35 * retrieved.
36 * @param[out] pdrEntry - PDR entry structure reference
37 *
38 * @return pldm_pdr_record - Instance of pdr::RepoInterface
39 */
Deepak Kodihallic682fe22020-03-04 00:42:54 -060040const pldm_pdr_record* getRecordByHandle(const RepoInterface& pdrRepo,
George Liue53193f2020-02-24 09:23:26 +080041 RecordHandle recordHandle,
42 PdrEntry& pdrEntry);
Deepak Kodihallic6e8fb52019-05-02 08:35:31 -050043
44} // namespace pdr
45} // namespace responder
46} // namespace pldm