PEL: Msg registry sev now based on sys type

The PEL severity field in the UserHeader section can now be defined in
the message registry to be based on system type.

When the UserHeader object is being created from the message registry,
it will now query the system type and use that to find the correct
severity value.

The Registry class was updated to handle the new JSON format, which
is an array of system type/severity value objects.

The original severity format of a simple string is still valid.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I0fe0ada7193c57adc42e82afdc30e687eea63eb9
diff --git a/extensions/openpower-pels/user_header.hpp b/extensions/openpower-pels/user_header.hpp
index f1fc66d..a033ac0 100644
--- a/extensions/openpower-pels/user_header.hpp
+++ b/extensions/openpower-pels/user_header.hpp
@@ -1,5 +1,6 @@
 #pragma once
 
+#include "data_interface.hpp"
 #include "elog_entry.hpp"
 #include "pel_values.hpp"
 #include "registry.hpp"
@@ -42,9 +43,11 @@
      *
      * @param[in] entry - The message registry entry for this error
      * @param[in] severity - The OpenBMC event log severity for this error
+     * @param[in] dataIface - The DataInterface object
      */
     UserHeader(const message::Entry& entry,
-               phosphor::logging::Entry::Level severity);
+               phosphor::logging::Entry::Level severity,
+               const DataInterfaceBase& dataIface);
 
     /**
      * @brief Constructor
@@ -233,6 +236,20 @@
     void validate() override;
 
     /**
+     * @brief Returns the severity value to use from the list
+     *        of them passed in based on the system type.
+     *
+     * If there isn't an entry found for the current system
+     * type then std::nullopt will be returned.
+     *
+     * @param[in] severities - The array of {systype, severity}
+     *                         structures to find an entry in.
+     * @param[in] systemType - The system type from DataInterface.
+     */
+    std::optional<uint8_t>
+        getSeverity(const std::vector<message::RegistrySeverity>& severities,
+                    const std::string& systemType) const;
+    /**
      * @brief The subsystem associated with the event.
      */
     uint8_t _eventSubsystem;