PEL: Create SRC section from message registry

This adds the ability to create an SRC PEL section based on the message
registry entry for an OpenBMC event log.

The event log's AdditionalData property is used as a source for the user
defined data words of the SRC, while the other fields in the SRC's data
words are filled in either from the message registry fields or from
current system state or configuration.

The ASCII string field of the SRC is filled in based on the message
registry entry.

This commit doesn't fill in every system status field, as many aren't
even available anywhere yet.  Also, this commit doesn't support adding
callouts to an SRC, that will also be handled in the future.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I67fe44e07e4eda6bdeedb4af2eacfc197deb6eb3
diff --git a/extensions/openpower-pels/pel.hpp b/extensions/openpower-pels/pel.hpp
index 0c35e3e..9f34b62 100644
--- a/extensions/openpower-pels/pel.hpp
+++ b/extensions/openpower-pels/pel.hpp
@@ -3,6 +3,7 @@
 #include "additional_data.hpp"
 #include "private_header.hpp"
 #include "registry.hpp"
+#include "src.hpp"
 #include "user_header.hpp"
 
 #include <memory>
@@ -31,15 +32,10 @@
  *
  * This class represents all sections with objects.
  *
- * The available constructors are:
- * - PEL(std::vector<uint8_t>& data) - build this object out of a fully
- *   formed flattened PEL.
- *
- * - PEL(const openpower::pels::message::Entry& entry,
- *       uint32_t obmcLogID,
- *       uint64_t timestamp,
- *       phosphor::logging::Entry::Level severity)
- *      - build this object from an OpenBMC event log.
+ * The class can be constructed:
+ * - From a full formed flattened PEL.
+ * - From scratch based on an OpenBMC event and its corresponding PEL message
+ *   registry entry.
  *
  * The data() method allows one to retrieve the PEL as a vector<uint8_t>.  This
  * is the format in which it is stored and transmitted.
@@ -88,9 +84,11 @@
      * @param[in] obmcLogID - ID of corresponding OpenBMC event log
      * @param[in] timestamp - Timestamp from the event log
      * @param[in] severity - Severity from the event log
+     * @param[in] additionalData - The AdditionalData contents
      */
     PEL(const openpower::pels::message::Entry& entry, uint32_t obmcLogID,
-        uint64_t timestamp, phosphor::logging::Entry::Level severity);
+        uint64_t timestamp, phosphor::logging::Entry::Level severity,
+        const AdditionalData& additionalData);
 
     /**
      * @brief Convenience function to return the log ID field from the
@@ -168,6 +166,16 @@
     }
 
     /**
+     * @brief Gives access to the primary SRC's section class
+     *
+     * This is technically an optional section, so the return
+     * value is an std::optional<SRC*>.
+     *
+     * @return std::optional<SRC*> - the SRC section object
+     */
+    std::optional<SRC*> primarySRC() const;
+
+    /**
      * @brief Returns the optional sections, which is everything but
      *        the Private and User Headers.
      *