summaryrefslogtreecommitdiffstats
path: root/extensions/openpower-pels/private_header.hpp
diff options
context:
space:
mode:
authorMatt Spinler <spinler@us.ibm.com>2019-09-20 12:33:29 -0500
committerMatt Spinler <spinler@us.ibm.com>2019-10-09 13:11:51 +0000
commit289aa477e09eb8d2fcbe852ea87f132b22c09439 (patch)
tree358e7cc6061942f554edf830269e80d588e661fd /extensions/openpower-pels/private_header.hpp
parent93e2932f0667d54926e933eedab7ee2adc8b2731 (diff)
downloadphosphor-logging-289aa477e09eb8d2fcbe852ea87f132b22c09439.tar.gz
phosphor-logging-289aa477e09eb8d2fcbe852ea87f132b22c09439.zip
PEL: Create PrivateHeader from parameters
Add a constructor to the PrivateHeader class so it can be built from the creator's component ID, the OpenBMC log ID, and the creation timestamp. This will be used when creating PELs from OpenBMC event logs. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I2d1217b9ff0317195366bee50fa72953fd5341dc
Diffstat (limited to 'extensions/openpower-pels/private_header.hpp')
-rw-r--r--extensions/openpower-pels/private_header.hpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/extensions/openpower-pels/private_header.hpp b/extensions/openpower-pels/private_header.hpp
index 66126a0..9c522a2 100644
--- a/extensions/openpower-pels/private_header.hpp
+++ b/extensions/openpower-pels/private_header.hpp
@@ -12,6 +12,11 @@ namespace pels
struct CreatorVersion
{
uint8_t version[8];
+
+ CreatorVersion()
+ {
+ memset(version, '\0', sizeof(version));
+ }
};
static constexpr uint8_t privateHeaderVersion = 0x01;
@@ -42,6 +47,17 @@ class PrivateHeader : public Section
/**
* @brief Constructor
*
+ * Creates a valid PrivateHeader with the passed in data
+ *
+ * @param[in] componentID - the creator's component ID
+ * @param[in] obmcLogID - the corresponding OpenBMC event log ID
+ * @param[in] timestamp - the creation timestamp, in epoch milliseconds
+ */
+ PrivateHeader(uint16_t componentID, uint32_t obmcLogID, uint64_t timestamp);
+
+ /**
+ * @brief Constructor
+ *
* Fills in this class's data fields from the stream.
*
* @param[in] pel - the PEL data stream
OpenPOWER on IntegriCloud