1 #ifndef FRIIDUMP_NATIVE_REPORT_H_INCLUDED
2 #define FRIIDUMP_NATIVE_REPORT_H_INCLUDED
12 #define FRIIDUMP_REPORT_PATH_MAX 1024
13 #define FRIIDUMP_REPORT_TEXT_MAX 2000
14 #define FRIIDUMP_REPORT_NOTE_MAX 16
15 #define FRIIDUMP_REPORT_ARTIFACT_MAX 8
17 typedef struct friidump_native_artifact_s {
19 char path[FRIIDUMP_REPORT_PATH_MAX + 1];
25 } friidump_native_artifact;
27 typedef struct friidump_native_report_s {
30 bool directory_override;
31 char requested_path[FRIIDUMP_REPORT_PATH_MAX];
32 char report_dir[FRIIDUMP_REPORT_PATH_MAX];
33 char name_basis[FRIIDUMP_REPORT_PATH_MAX];
34 char final_path[FRIIDUMP_REPORT_PATH_MAX];
36 char generator_version[81];
37 char build_commit[41];
38 bool build_commit_known;
42 char completed_utc[32];
43 char generated_utc[32];
49 char firmware_revision[65];
50 char interface_name[41];
51 char device_path[256];
52 bool have_device_path;
53 bool firmware_modified;
54 char modification_note[1001];
55 bool have_modification_note;
68 double seed_duration_seconds;
69 bool have_seed_duration;
73 uint64_t sector_count;
74 bool have_sector_count;
77 double dump_duration_seconds;
78 bool have_dump_duration;
79 char failure_stage[161];
80 bool have_failure_stage;
81 uint64_t failure_sector;
82 bool have_failure_sector;
83 char output_path[FRIIDUMP_REPORT_PATH_MAX];
84 bool have_output_path;
91 char reference_provider[81];
92 bool have_reference_provider;
93 char reference_result[24];
94 char reference_id[161];
95 bool have_reference_id;
97 char support_tier[121];
98 bool have_support_tier;
100 bool have_cdb_offset;
101 char gate_address[32];
102 bool have_gate_address;
104 char notes[FRIIDUMP_REPORT_NOTE_MAX][FRIIDUMP_REPORT_TEXT_MAX + 1];
107 friidump_native_artifact artifacts[FRIIDUMP_REPORT_ARTIFACT_MAX];
108 size_t artifact_count;
109 } friidump_native_report;
111 void friidump_native_report_init(friidump_native_report *report, const char *generator_version);
112 bool friidump_native_report_enable_default(friidump_native_report *report);
113 bool friidump_native_report_enable_path(friidump_native_report *report, const char *path);
114 bool friidump_native_report_enable_dir(friidump_native_report *report, const char *directory);
115 bool friidump_native_report_set_name_basis(friidump_native_report *report, const char *path);
116 bool friidump_native_report_is_enabled(const friidump_native_report *report);
117 void friidump_native_report_set_build_commit(friidump_native_report *report, const char *commit);
118 void friidump_native_report_set_drive(friidump_native_report *report,
121 const char *firmware_revision,
122 const char *interface_name,
123 const char *device_path);
124 void friidump_native_report_set_firmware_modified(friidump_native_report *report,
127 void friidump_native_report_set_media(friidump_native_report *report,
128 const char *platform,
131 const char *disc_id);
132 void friidump_native_report_set_profile(friidump_native_report *report,
133 const char *support_tier,
135 uint32_t gate_address);
136 void friidump_native_report_set_seed(friidump_native_report *report,
140 double duration_seconds);
141 void friidump_native_report_set_dump(friidump_native_report *report,
144 bool have_sector_count,
145 uint64_t sector_count,
146 bool have_byte_count,
149 double duration_seconds,
150 const char *failure_stage,
151 bool have_failure_sector,
152 uint64_t failure_sector,
153 const char *output_path);
154 void friidump_native_report_set_hashes(friidump_native_report *report,
159 void friidump_native_report_set_reference(friidump_native_report *report,
160 const char *provider,
162 const char *reference_id);
163 void friidump_native_report_set_outcome(friidump_native_report *report,
164 const char *test_type,
165 const char *run_result);
166 bool friidump_native_report_add_note(friidump_native_report *report, const char *note);
167 bool friidump_native_report_add_artifact(friidump_native_report *report,
173 bool friidump_native_report_write(friidump_native_report *report,
175 size_t written_path_size,
177 size_t error_text_size);