PEL: Look for callouts in an FFDC JSON file

The PEL constructor takes a list of files that should be added as
UserData sections for FFDC.  If one of those files has its format set to
JSON, and its subtype set to 0xCA, this will mean it contains a JSON
array of callouts to add to the PEL.

This commit will look for that type and subtype, and then pass the
callout JSON through to the SRC class.  A future commit will add the
callouts from the JSON to the PEL.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: Iec0ca0ad0ae11cc957b8fda880d97116f342d72d
diff --git a/extensions/openpower-pels/src.hpp b/extensions/openpower-pels/src.hpp
index 44540b0..063701c 100644
--- a/extensions/openpower-pels/src.hpp
+++ b/extensions/openpower-pels/src.hpp
@@ -86,7 +86,26 @@
      * @param[in] dataIface - The DataInterface object
      */
     SRC(const message::Entry& regEntry, const AdditionalData& additionalData,
-        const DataInterfaceBase& dataIface);
+        const DataInterfaceBase& dataIface) :
+        SRC(regEntry, additionalData, nlohmann::json{}, dataIface)
+    {
+    }
+
+    /**
+     * @brief Constructor
+     *
+     * Creates the section with data from the PEL message registry entry for
+     * this error, along with the AdditionalData property contents from the
+     * corresponding event log, and a JSON array of callouts to add.
+     *
+     * @param[in] regEntry - The message registry entry for this event log
+     * @param[in] additionalData - The AdditionalData properties in this event
+     *                             log
+     * @param[in] jsonCallouts - The array of JSON callouts, or an empty object.
+     * @param[in] dataIface - The DataInterface object
+     */
+    SRC(const message::Entry& regEntry, const AdditionalData& additionalData,
+        const nlohmann::json& jsonCallouts, const DataInterfaceBase& dataIface);
 
     /**
      * @brief Flatten the section into the stream
@@ -350,10 +369,12 @@
      *
      * @param[in] regEntry - The message registry entry for the error
      * @param[in] additionalData - The AdditionalData values
+     * @param[in] jsonCallouts - The array of JSON callouts, or an empty object
      * @param[in] dataIface - The DataInterface object
      */
     void addCallouts(const message::Entry& regEntry,
                      const AdditionalData& additionalData,
+                     const nlohmann::json& jsonCallouts,
                      const DataInterfaceBase& dataIface);
 
     /**
@@ -413,6 +434,23 @@
                                const DataInterfaceBase& dataIface);
 
     /**
+     * @brief Adds any FRU callouts specified in the incoming JSON.
+     *
+     * @param[in] jsonCallouts - The JSON array of callouts
+     * @param[in] dataIface - The DataInterface object
+     */
+    void addJSONCallouts(const nlohmann::json& jsonCallouts,
+                         const DataInterfaceBase& dataIface);
+
+    /**
+     * @brief Adds a single callout based on the JSON
+     *
+     * @param[in] jsonCallouts - A single callout entry
+     * @param[in] dataIface - The DataInterface object
+     */
+    void addJSONCallout(const nlohmann::json& jsonCallout,
+                        const DataInterfaceBase& dataIface);
+    /**
      * @brief The SRC version field
      */
     uint8_t _version;