PEL: Pass FFDC files into PEL

In the case where an OpenBMC event log was created with the
'createWithFFDCFiles' D-Bus method, there needs to be UserData PEL
sections created with the contents of these files.

This commit passes these files into the PEL constructor, which then does
the creating.  If any of this would cause the PEL size to go over 16KB,
then that section will be trimmed so it fits in the 16KB, and no more
additional sections will be added.

The function that actually reads the FFDC file and creates the UserData
section is stubbed out and will be implemented in a future commit.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Id27802c91326381a4b80fbe78ab62471cefe0286
diff --git a/extensions/openpower-pels/manager.hpp b/extensions/openpower-pels/manager.hpp
index 86030d4..d25afbd 100644
--- a/extensions/openpower-pels/manager.hpp
+++ b/extensions/openpower-pels/manager.hpp
@@ -7,6 +7,7 @@
 #include "host_notifier.hpp"
 #include "log_manager.hpp"
 #include "paths.hpp"
+#include "pel.hpp"
 #include "registry.hpp"
 #include "repository.hpp"
 
@@ -86,11 +87,14 @@
      * @param[in] severity - the event log severity
      * @param[in] additionalData - the AdditionalData property
      * @param[in] associations - the Associations property
+     * @param[in] ffdc - A vector of FFDC file information
      */
     void create(const std::string& message, uint32_t obmcLogID,
                 uint64_t timestamp, phosphor::logging::Entry::Level severity,
                 const std::vector<std::string>& additionalData,
-                const std::vector<std::string>& associations);
+                const std::vector<std::string>& associations,
+                const phosphor::logging::FFDCEntries& ffdc =
+                    phosphor::logging::FFDCEntries{});
 
     /**
      * @brief Erase a PEL based on its OpenBMC event log ID
@@ -194,11 +198,13 @@
      * @param[in] severity - The event log severity
      * @param[in] additionalData - The AdditionalData property
      * @param[in] associations - The associations property
+     * @param[in] ffdc - A vector of FFDC file information
      */
     void createPEL(const std::string& message, uint32_t obmcLogID,
                    uint64_t timestamp, phosphor::logging::Entry::Level severity,
                    const std::vector<std::string>& additionalData,
-                   const std::vector<std::string>& associations);
+                   const std::vector<std::string>& associations,
+                   const phosphor::logging::FFDCEntries& ffdc);
 
     /**
      * @brief Schedules a close of the file descriptor to occur from
@@ -239,6 +245,16 @@
     void addESELPEL(const std::string& esel, uint32_t obmcLogID);
 
     /**
+     * @brief Converts the D-Bus FFDC method argument into a data
+     *        structure understood by the PEL code.
+     *
+     * @param[in] ffdc - A vector of FFDC file information
+     *
+     * @return PelFFDC - The PEL FFDC data structure
+     */
+    PelFFDC convertToPelFFDC(const phosphor::logging::FFDCEntries& ffdc);
+
+    /**
      * @brief Reference to phosphor-logging's Manager class
      */
     phosphor::logging::internal::Manager& _logManager;