blob: 6092f626a53344005d173576947a25b893e0894f [file] [log] [blame]
Matt Spinler835a8692019-08-27 13:56:05 -05001#pragma once
2
3#include <string>
4#include <tuple>
5#include <vector>
6
7namespace openpower
8{
9namespace pels
10{
11namespace pel_values
12{
13
14// The actual value as it shows up in the PEL
15const int fieldValuePos = 0;
16
17// The name of the value as specified in the message registry
18const int registryNamePos = 1;
19
20// The description of the field, used by PEL parsers
21const int descriptionPos = 2;
22
23using PELFieldValue = std::tuple<uint32_t, const char*, const char*>;
24using PELValues = std::vector<PELFieldValue>;
25
26/**
27 * @brief Find the desired entry in a PELValues table based on the
28 * field value.
29 *
30 * @param[in] value - the PEL value to find
31 * @param[in] fields - the PEL values table to use
32 *
33 * @return PELValues::const_iterator - an iterator to the table entry
34 */
35PELValues::const_iterator findByValue(uint32_t value, const PELValues& fields);
36
37/**
38 * @brief Find the desired entry in a PELValues table based on the
39 * field message registry name.
40 *
41 * @param[in] name - the PEL message registry enum name
42 * @param[in] fields - the PEL values table to use
43 *
44 * @return PELValues::const_iterator - an iterator to the table entry
45 */
46PELValues::const_iterator findByName(const std::string& name,
47 const PELValues& fields);
48
49/**
50 * @brief The values for the 'subsystem' field in the User Header
51 */
52extern const PELValues subsystemValues;
53
54/**
55 * @brief The values for the 'severity' field in the User Header
56 */
57extern const PELValues severityValues;
58
59/**
60 * @brief The values for the 'Event Type' field in the User Header
61 */
62extern const PELValues eventTypeValues;
63
64/**
65 * @brief The values for the 'Event Scope' field in the User Header
66 */
67extern const PELValues eventScopeValues;
68
69/**
70 * @brief The values for the 'Action Flags' field in the User Header
71 */
72extern const PELValues actionFlagsValues;
73
74/**
75 * @brief The values for callout priorities in the SRC section
76 */
77extern const PELValues calloutPriorityValues;
78
79} // namespace pel_values
80} // namespace pels
81} // namespace openpower