Add default event ID and error description
Add the ID and description to use when an entry isn't
found in the policy table.
The final values for these are still being considered
by the IBM service team.
Change-Id: I2ce3f16ed168994599fb48aaba999a1d92856193
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/configure.ac b/configure.ac
index 320b330..4d36427 100644
--- a/configure.ac
+++ b/configure.ac
@@ -72,6 +72,11 @@
AC_DEFINE(IBM_LOGGING_BUSNAME, "com.ibm.Logging",
[The IBM log manager DBus busname to own])
+AC_DEFINE(DEFAULT_POLICY_EID, "None",
+ [The default event ID to use])
+AC_DEFINE(DEFAULT_POLICY_MSG, "An internal BMC error occurred",
+ [The default policy message to use])
+
AC_ARG_VAR(POLICY_JSON_PATH, [The path to the policy json file])
AS_IF([test "x$POLICY_JSON_PATH" == "x"], [POLICY_JSON_PATH="/usr/share/ibm-logging/policy.json"])
AC_DEFINE_UNQUOTED([POLICY_JSON_PATH], ["$POLICY_JSON_PATH"], [The path to the policy json file on the BMC])
diff --git a/policy_table.hpp b/policy_table.hpp
index a44bf0b..07226e6 100644
--- a/policy_table.hpp
+++ b/policy_table.hpp
@@ -83,7 +83,38 @@
const std::string& error,
const std::string& modifier) const;
+ /**
+ * The default event ID to use when a match in the table
+ * wasn't found.
+ *
+ * @return std::string
+ */
+ inline std::string defaultEID() const
+ {
+ return defaultPolicyEID;
+ }
+
+ /**
+ * The default error message to use when a match in the table
+ * wasn't found.
+ *
+ * @return std::string
+ */
+ inline std::string defaultMsg() const
+ {
+ return defaultPolicyMessage;
+ }
+
private:
+ /**
+ * The default event ID
+ */
+ const std::string defaultPolicyEID{DEFAULT_POLICY_EID};
+
+ /**
+ * The default event message
+ */
+ const std::string defaultPolicyMessage{DEFAULT_POLICY_MSG};
/**
* Loads the JSON data into the PolicyMap map