summaryrefslogtreecommitdiffstats
path: root/extensions/openpower-pels/user_header.hpp
diff options
context:
space:
mode:
authorMatt Spinler <spinler@us.ibm.com>2019-11-01 11:31:31 -0500
committerMatt Spinler <spinler@us.ibm.com>2019-11-08 15:22:50 +0000
commitf1e85e20a1a6e97e27737b5883a8aa6a63c79b22 (patch)
treee05b1fe902dbd98e7232b093db226263221ec618 /extensions/openpower-pels/user_header.hpp
parent97f7abcf70cead9fbed2719545faa13f870d0f02 (diff)
downloadphosphor-logging-f1e85e20a1a6e97e27737b5883a8aa6a63c79b22.tar.gz
phosphor-logging-f1e85e20a1a6e97e27737b5883a8aa6a63c79b22.zip
PEL: Validate the Action Flags field
According to the PEL spec, the Action Flags and Event Type fields in the User Header section must be in agreement with the Severity field. So, when a PEL is being created from an OpenBMC event log, check those values for correctness and fix them up if required. In addition, as those fields are optional in the message registry, this code will also just set these two fields to valid values if they were left out. The rules being followed are documented in the PEL readme. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: Iad88de5080ba79a9ff31f962ef99bfc11994b9ed
Diffstat (limited to 'extensions/openpower-pels/user_header.hpp')
-rw-r--r--extensions/openpower-pels/user_header.hpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/extensions/openpower-pels/user_header.hpp b/extensions/openpower-pels/user_header.hpp
index 459952b..b382a84 100644
--- a/extensions/openpower-pels/user_header.hpp
+++ b/extensions/openpower-pels/user_header.hpp
@@ -102,6 +102,16 @@ class UserHeader : public Section
}
/**
+ * @brief Set the event type field
+ *
+ * @param[in] type - the new event type
+ */
+ void setEventType(uint8_t type)
+ {
+ _eventType = type;
+ }
+
+ /**
* @brief Returns the problem domain field.
*
* @return uint8_t - the problem domain
@@ -132,6 +142,16 @@ class UserHeader : public Section
}
/**
+ * @brief Sets the action flags field
+ *
+ * @param[in] flags - the new action flags
+ */
+ void setActionFlags(uint16_t flags)
+ {
+ _actionFlags = flags;
+ }
+
+ /**
* @brief Returns the size of this section when flattened into a PEL
*
* @return size_t - the size of the section
OpenPOWER on IntegriCloud