PEL: Add UserHeader class

The second section in a PEL is always the 'User Header' section.  This
commit adds a class to represent that.  Right now, the only constructor
available is filling in its data fields from a PEL stream.

Several of the fields in this section have predefined values that are
defined by the PEL specification.  Defining any constants or enums for
those will be left to future commits where they will actually be used.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I8b5f856a4284d44c31b04e98a664f20cd8fa0cb6
diff --git a/test/openpower-pels/pel_utils.cpp b/test/openpower-pels/pel_utils.cpp
index 4e4c32a..b6714eb 100644
--- a/test/openpower-pels/pel_utils.cpp
+++ b/test/openpower-pels/pel_utils.cpp
@@ -1,6 +1,7 @@
 #include "pel_utils.hpp"
 
 #include "extensions/openpower-pels/private_header.hpp"
+#include "extensions/openpower-pels/user_header.hpp"
 
 #include <fstream>
 
@@ -26,8 +27,23 @@
     0x90, 0x91, 0x92, 0x93,                         // OpenBMC log ID
     0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0,    // creator version
     0x50, 0x51, 0x52, 0x53,                         // plid
-    0x80, 0x81, 0x82, 0x83                          // id
+    0x80, 0x81, 0x82, 0x83,                         // id
 
+    // user header section header
+    0x55, 0x48, // ID 'UH'
+    0x00, 0x18, // Size
+    0x01, 0x0A, // version, subtype
+    0x0B, 0x0C, // comp ID
+
+    // user header
+    0x10, 0x04,             // subsystem, scope
+    0x20, 0x00,             // severity, type
+    0x00, 0x00, 0x00, 0x00, // reserved
+    0x03, 0x04,             // problem domain, vector
+    0x80, 0xC0,             // action flags
+    0x00, 0x00, 0x00, 0x00  // reserved
+
+    // Add more as the code supports more
 };
 
 std::unique_ptr<std::vector<uint8_t>> pelDataFactory(TestPelType type)
@@ -43,6 +59,12 @@
             data = std::make_unique<std::vector<uint8_t>>(
                 simplePEL, simplePEL + PrivateHeader::flattenedSize());
             break;
+        case TestPelType::userHeaderSimple:
+            data = std::make_unique<std::vector<uint8_t>>(
+                simplePEL + PrivateHeader::flattenedSize(),
+                simplePEL + PrivateHeader::flattenedSize() +
+                    UserHeader::flattenedSize());
+            break;
     }
     return data;
 }