PEL: SRC FRU callout structure

This class represents a single FRU callout in the SRC section of a PEL.
When there are multiple callouts, there will be multiple instances of
this class created.  Technically, the callout isn't always a FRU, such
as it could be a maintenance procedure name, but the spec still refers
to this section as the FRU callout section.

The callout priority and location code are in this structure.

There can also be up to one each of three types of substructures
in a single callout:
* FRU Identity  (must be first if present)
* Power Controlling Enclosure (PCE)
* Manufacturing Replaceable Unit (MRU)

This commit just provides support for creating this object from a
flattened PEL, such as one that comes down from the host.  A future
commit will add support for creating a callout for BMC created event
logs.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I49535285e3cbaa15dfe031648cfaf262380a1cf7
diff --git a/test/openpower-pels/pel_utils.cpp b/test/openpower-pels/pel_utils.cpp
index 3e0ac01..3610dd7 100644
--- a/test/openpower-pels/pel_utils.cpp
+++ b/test/openpower-pels/pel_utils.cpp
@@ -51,6 +51,33 @@
     // Add more as the code supports more
 };
 
+std::vector<uint8_t> srcFRUIdentityCallout{
+    'I', 'D', 0x1C, 0x1D,                     // type, size, flags
+    '1', '2', '3',  '4',                      // PN
+    '5', '6', '7',  0x00, 'A', 'A', 'A', 'A', // CCIN
+    '1', '2', '3',  '4',  '5', '6', '7', '8', // SN
+    '9', 'A', 'B',  'C'};
+
+std::vector<uint8_t> srcPCEIdentityCallout{
+    'P', 'E', 0x24, 0x00,                      // type, size, flags
+    'T', 'T', 'T',  'T',  '-', 'M', 'M',  'M', // MTM
+    '1', '2', '3',  '4',  '5', '6', '7',       // SN
+    '8', '9', 'A',  'B',  'C', 'P', 'C',  'E', // Name + null padded
+    'N', 'A', 'M',  'E',  '1', '2', 0x00, 0x00, 0x00};
+
+std::vector<uint8_t> srcMRUCallout{
+    'M',  'R',  0x28, 0x04, // ID, size, flags
+    0x00, 0x00, 0x00, 0x00, // Reserved
+    0x00, 0x00, 0x00, 'H',  // priority 0
+    0x01, 0x01, 0x01, 0x01, // MRU ID 0
+    0x00, 0x00, 0x00, 'M',  // priority 1
+    0x02, 0x02, 0x02, 0x02, // MRU ID 1
+    0x00, 0x00, 0x00, 'L',  // priority 2
+    0x03, 0x03, 0x03, 0x03, // MRU ID 2
+    0x00, 0x00, 0x00, 'H',  // priority 3
+    0x04, 0x04, 0x04, 0x04, // MRU ID 3
+};
+
 std::unique_ptr<std::vector<uint8_t>> pelDataFactory(TestPelType type)
 {
     std::unique_ptr<std::vector<uint8_t>> data;
@@ -74,6 +101,22 @@
     return data;
 }
 
+std::vector<uint8_t> srcDataFactory(TestSRCType type)
+{
+    switch (type)
+    {
+        case TestSRCType::fruIdentityStructure:
+            return srcFRUIdentityCallout;
+
+        case TestSRCType::pceIdentityStructure:
+            return srcPCEIdentityCallout;
+
+        case TestSRCType::mruStructure:
+            return srcMRUCallout;
+    }
+    return {};
+}
+
 std::unique_ptr<std::vector<uint8_t>> readPELFile(const fs::path& path)
 {
     std::ifstream file{path};