PEL: Add repo function to get a PEL FD
Add Repository::getPELFD() to return a file descriptor to a PEL data
file based on its ID.
This will be used by a future D-Bus method to return the descriptor to
the PLDM daemon.
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I1110a514e30a9387d9672e42862139b988717c53
diff --git a/extensions/openpower-pels/repository.hpp b/extensions/openpower-pels/repository.hpp
index b6ac545..e55808f 100644
--- a/extensions/openpower-pels/repository.hpp
+++ b/extensions/openpower-pels/repository.hpp
@@ -169,6 +169,16 @@
*/
std::optional<std::vector<uint8_t>> getPELData(const LogID& id);
+ /**
+ * @brief Get a file descriptor to the PEL data
+ *
+ * @param[in] id - The ID to get the FD for
+ *
+ * @return std::optional<sdbusplus::message::unix_fd> -
+ * The FD, or an empty optional object.
+ */
+ std::optional<sdbusplus::message::unix_fd> getPELFD(const LogID& id);
+
using ForEachFunc = std::function<bool(const PEL&)>;
/**