xref: /openbmc/libcper/cper-parse.h (revision f8fc7052)
1 #ifndef CPER_PARSE_H
2 #define CPER_PARSE_H
3 #include <json.h>
4 
5 #define CPER_HEADER_VALID_BITFIELD_NAMES                                       \
6 	(const char *[])                                                       \
7 	{                                                                      \
8 		"platformIDValid", "timestampValid", "partitionIDValid"        \
9 	}
10 #define CPER_SECTION_DESCRIPTOR_VALID_BITFIELD_NAMES                           \
11 	(const char *[])                                                       \
12 	{                                                                      \
13 		"fruIDValid", "fruStringValid"                                 \
14 	}
15 #define CPER_SECTION_DESCRIPTOR_FLAGS_BITFIELD_NAMES                           \
16 	(const char *[])                                                       \
17 	{                                                                      \
18 		"primary", "containmentWarning", "reset",                      \
19 			"errorThresholdExceeded", "resourceNotAccessible",     \
20 			"latentError", "propagated", "overflow"                \
21 	}
22 #define CPER_HEADER_FLAG_TYPES_KEYS                                            \
23 	(int[])                                                                \
24 	{                                                                      \
25 		1, 2, 4                                                        \
26 	}
27 #define CPER_HEADER_FLAG_TYPES_VALUES                                          \
28 	(const char *[])                                                       \
29 	{                                                                      \
30 		"HW_ERROR_FLAGS_RECOVERED", "HW_ERROR_FLAGS_PREVERR",          \
31 			"HW_ERROR_FLAGS_SIMULATED"                             \
32 	}
33 
34 json_object *cper_to_ir(FILE *cper_file);
35 json_object *cper_single_section_to_ir(FILE *cper_section_file);
36 void ir_to_cper(json_object *ir, FILE *out);
37 void ir_single_section_to_cper(json_object *ir, FILE *out);
38 
39 #endif
40