Lines Matching full:pel

4 #include "pel.hpp"
25 * @brief Structure of commonly used PEL attributes.
57 * @brief A structure that holds both the PEL and corresponding
60 * lookup. To find a PEL based on just one of the IDs, just use
65 struct Pel struct
68 explicit Pel(uint32_t i) : id(i) {} in Pel() argument
76 Pel pelID;
80 LogID(Pel pel, Obmc obmc) : pelID(pel), obmcID(obmc) {} in LogID()
82 explicit LogID(Pel id) : pelID(id), obmcID(0) {} in LogID()
91 * one can look up a PEL with just one of the IDs.
163 * @brief Adds a PEL to the repository
167 * @param[in] pel - the PEL to add
169 void add(std::unique_ptr<PEL>& pel);
172 * @brief Removes a PEL from the repository
175 * it has both the PEL and OpenBMC IDs, unlike the passed in LogID
178 * @param[in] id - the ID (either the pel ID, OBMC ID, or both) to remove
180 * @return std::optional<LogID> - The LogID of the removed PEL
185 * @brief Generates the filename to use for the PEL ID and BCDTime.
187 * @param[in] pelID - the PEL ID
195 * @brief Returns true if the PEL with the specified ID is in the repo.
197 * @param[in] id - the ID (either the pel ID, OBMC ID, or both)
198 * @return bool - true if that PEL is present
206 * @brief Returns the PEL data based on its ID.
211 * @param[in] id - the LogID to get the PEL for, which can be either a
212 * PEL ID or OpenBMC log ID.
213 * @return std::optional<std::vector<uint8_t>> - the PEL data
218 * @brief Get a file descriptor to the PEL data
227 using ForEachFunc = std::function<bool(const PEL&)>;
230 * @brief Run a user defined function on every PEL in the repository.
232 * ForEachFunc takes a const PEL reference, and should return
238 * ForEachFunc f = [&ids](const PEL& pel) {
239 * ids.push_back(pel.id());
247 using AddCallback = std::function<void(const PEL&)>;
252 * Every time a PEL is added to the repository, the provided
253 * function will be called with the new PEL as the argument.
255 * The function must be of type void(const PEL&).
280 * Every time a PEL is deleted from the repository, the provided
281 * function will be called with the PEL ID as the argument.
304 * @brief Get the PEL attributes for a PEL
324 * @brief Sets the host transmission state on a PEL file
327 * section in the PEL data specified by the ID.
329 * @param[in] pelID - The PEL ID
335 * @brief Sets the HMC transmission state on a PEL file
338 * section in the PEL data specified by the ID.
340 * @param[in] pelID - The PEL ID
356 * @brief Says if the PEL is considered serviceable (not just
359 * @param[in] pel - The PELAttributes entry for the PEL
362 static bool isServiceableSev(const PELAttributes& pel);
409 * @brief Returns the path to the directory where the PEL
420 * @brief Returns the ID of the most recently added PEL.
422 * @return uint32_t - The PEL ID
437 * it has both the PEL and OpenBMC Log IDs, unlike the passed in LogID
450 * @brief Save the PEL to archive folder
452 * @param[in] pel - The PEL data
454 void archivePEL(const PEL& pel);
456 using PELUpdateFunc = std::function<bool(PEL&)>;
459 * @brief Lets a function modify a PEL and saves the results
461 * Runs updateFunc (a bool(PEL&) function) on the PEL data
466 * @param[in] updateFunc - The function to run to update the PEL.
468 * @return bool - If the PEL was updated or not.
476 * @param[in] id - the ID (either the pel ID, OBMC ID, or both)
490 * @param[in] pel - The new PEL
492 void processAddCallbacks(const PEL& pel) const;
497 * @param[in] id - The ID of the deleted PEL
503 * PEL data files.
508 * @brief Stores a PEL object in the filesystem.
510 * @param[in] pel - The PEL to write
515 void write(const PEL& pel, const std::filesystem::path& path);
518 * @brief Updates the repository statistics after a PEL is
521 * @param[in] pel - The PELAttributes entry for the PEL
522 * @param[in] pelAdded - true if the PEL was added, false if removed
524 void updateRepoStats(const PELAttributes& pel, bool pelAdded);
573 * @brief The filesystem path to the PEL logs.
578 * @brief A map of the PEL/OBMC IDs to PEL attributes.
610 * @brief The ID of the most recently added PEL.
615 * @brief The filesystem path to the archive PEL logs.