1 #ifndef CPER_PARSE_H
2 #define CPER_PARSE_H
3 
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7 
8 #include <json.h>
9 #include <stdio.h>
10 
11 #define CPER_HEADER_VALID_BITFIELD_NAMES                                       \
12 	(const char *[])                                                       \
13 	{                                                                      \
14 		"platformIDValid", "timestampValid", "partitionIDValid"        \
15 	}
16 #define CPER_SECTION_DESCRIPTOR_VALID_BITFIELD_NAMES                           \
17 	(const char *[])                                                       \
18 	{                                                                      \
19 		"fruIDValid", "fruStringValid"                                 \
20 	}
21 #define CPER_SECTION_DESCRIPTOR_FLAGS_BITFIELD_NAMES                           \
22 	(const char *[])                                                       \
23 	{                                                                      \
24 		"primary", "containmentWarning", "reset",                      \
25 			"errorThresholdExceeded", "resourceNotAccessible",     \
26 			"latentError", "propagated", "overflow"                \
27 	}
28 #define CPER_HEADER_FLAG_TYPES_KEYS                                            \
29 	(int[])                                                                \
30 	{                                                                      \
31 		1, 2, 4                                                        \
32 	}
33 #define CPER_HEADER_FLAG_TYPES_VALUES                                          \
34 	(const char *[])                                                       \
35 	{                                                                      \
36 		"HW_ERROR_FLAGS_RECOVERED", "HW_ERROR_FLAGS_PREVERR",          \
37 			"HW_ERROR_FLAGS_SIMULATED"                             \
38 	}
39 
40 json_object *cper_to_ir(FILE *cper_file);
41 json_object *cper_single_section_to_ir(FILE *cper_section_file);
42 void ir_to_cper(json_object *ir, FILE *out);
43 void ir_single_section_to_cper(json_object *ir, FILE *out);
44 
45 #ifdef __cplusplus
46 }
47 #endif
48 
49 #endif
50