libaaruformat 1.0 Aaru Data Preservation Suite - Format Library

Loading...
Searching...
No Matches
context.h
Go to the documentation of this file.
1/*
2 * This file is part of the Aaru Data Preservation Suite.
3 * Copyright (c) 2019-2025 Natalia Portillo.
4 *
5 * This library is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as
7 * published by the Free Software Foundation; either version 2.1 of the
8 * License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
17 */
18
19#ifndef LIBAARUFORMAT_CONTEXT_H
20#define LIBAARUFORMAT_CONTEXT_H
21
22#include "blake3.h"
23#include "crc64.h"
24#include "hash_map.h"
25#include "lru.h"
26#include "md5.h"
27#include "sha1.h"
28#include "sha256.h"
29#include "spamsum.h"
30#include "structs.h"
31#include "utarray.h"
32
67
68#ifndef MD5_DIGEST_LENGTH
69#define MD5_DIGEST_LENGTH 16
70#endif
71
72#ifndef SHA1_DIGEST_LENGTH
73#define SHA1_DIGEST_LENGTH 20
74#endif
75
76#ifndef SHA256_DIGEST_LENGTH
77#define SHA256_DIGEST_LENGTH 32
78#endif
79
85 typedef struct CdEccContext
86{
87 bool inited_edc;
88 uint8_t *ecc_b_table;
89 uint8_t *ecc_f_table;
90 uint32_t *edc_table;
91} CdEccContext;
92
99 typedef struct Checksums
100{
101 bool hasMd5;
102 bool hasSha1;
103 bool hasSha256;
104 bool hasBlake3;
105 bool hasSpamSum;
106 uint8_t md5[MD5_DIGEST_LENGTH];
107 uint8_t sha1[SHA1_DIGEST_LENGTH];
108 uint8_t sha256[SHA256_DIGEST_LENGTH];
109 uint8_t blake3[BLAKE3_OUT_LEN];
110 uint8_t *spamsum;
111} Checksums;
112
118 typedef struct mediaTagEntry
119{
120 uint8_t *data;
121 int32_t type;
122 uint32_t length;
123 UT_hash_handle hh;
124} mediaTagEntry;
125
126 typedef struct TapeFileHashEntry
127{
128 uint64_t key;
129 TapeFileEntry fileEntry;
130 UT_hash_handle hh;
131} tapeFileHashEntry;
132
133 typedef struct TapePartitionHashEntry
134{
135 uint8_t key;
136 TapePartitionEntry partitionEntry;
137 UT_hash_handle hh;
138} TapePartitionHashEntry;
139
140 typedef struct TapeDdtHashEntry
141{
142 uint64_t key;
143 uint64_t value;
144 UT_hash_handle hh;
145} TapeDdtHashEntry;
146
171 typedef struct aaruformat_context
172{
173 /* Core & header */
174 uint64_t magic;
175 AaruHeaderV2 header;
176 FILE *imageStream;
177 uint8_t library_major_version;
178 uint8_t library_minor_version;
179
180 /* Deduplication tables (DDT) */
181 uint64_t *user_data_ddt;
182 TapeDdtHashEntry *tape_ddt;
183 uint32_t *sector_prefix_ddt;
184 uint32_t *sector_suffix_ddt;
185 uint64_t *sector_prefix_ddt2;
186 uint64_t *sector_suffix_ddt2;
187 uint64_t *user_data_ddt2;
188 uint64_t *cached_secondary_ddt2;
189 DdtHeader2 user_data_ddt_header;
190 uint64_t cached_ddt_offset;
191 uint64_t cached_ddt_position;
192 uint64_t primary_ddt_offset;
193 size_t mapped_memory_ddt_size;
194 int ddt_version;
195 uint8_t shift;
196 bool in_memory_ddt;
197
198 /* Optical auxiliary buffers (NULL if not present) */
199 uint8_t *sector_prefix;
200 uint8_t *sector_prefix_corrected;
201 uint8_t *sector_suffix;
202 uint8_t *sector_suffix_corrected;
203 uint8_t *sector_subchannel;
204 uint8_t *mode2_subheaders;
205 uint8_t *sector_id;
206 uint8_t *sector_ied;
207 uint8_t *sector_cpr_mai;
208 uint8_t *sector_edc;
209 uint8_t *sector_decrypted_title_key;
210
211 /* Metadata & geometry */
212 struct DumpHardwareEntriesWithData *dump_hardware_entries_with_data;
213 uint8_t *metadata_block;
214 uint8_t *cicm_block;
215 uint8_t *json_block;
216 uint8_t *creator;
217 uint8_t *media_title;
218 uint8_t *comments;
219 uint8_t *media_manufacturer;
220 uint8_t *media_model;
221 uint8_t *media_serial_number;
222 uint8_t *media_barcode;
223 uint8_t *media_part_number;
224 uint8_t *drive_manufacturer;
225 uint8_t *drive_model;
226 uint8_t *drive_serial_number;
227 uint8_t
228 *drive_firmware_revision;
229 GeometryBlockHeader geometry_block;
230 MetadataBlockHeader metadata_block_header;
231 CicmMetadataBlock cicm_block_header;
232 DumpHardwareHeader dump_hardware_header;
233 AaruMetadataJsonBlockHeader json_block_header;
234 uint32_t cylinders;
235 uint32_t heads;
236 uint32_t sectors_per_track;
238 int32_t media_sequence;
239 int32_t last_media_sequence;
240
241 /* Optical information */
242 TrackEntry *track_entries;
243 TrackEntry *data_tracks;
244 TracksHeader tracks_header;
245 uint8_t number_of_data_tracks;
246
247 /* Integrity & ECC */
248 CdEccContext *ecc_cd_context;
249 crc64_ctx *crc64_context;
250
251 /* Index & deduplication lookup */
252 UT_array *index_entries;
253 hash_map_t *sector_hash_map;
254
255 /* Caches */
256 struct CacheHeader block_header_cache;
257 struct CacheHeader block_cache;
258
259 /* High-level summary */
260 ImageInfo image_info;
261
262 /* Tags */
263 bool *readableSectorTags;
264 mediaTagEntry *mediaTags;
265
266 /* Checksums */
267 spamsum_ctx *spamsum_context;
268 blake3_hasher *blake3_context;
269 Checksums checksums;
270 md5_ctx md5_context;
271 sha1_ctx sha1_context;
272 sha256_ctx sha256_context;
273 bool calculating_md5;
274 bool calculating_sha1;
275 bool calculating_sha256;
276 bool calculating_spamsum;
277 bool calculating_blake3;
278
279 /* Write path */
280 uint8_t *writing_buffer;
281 BlockHeader current_block_header;
282 uint64_t next_block_position;
283 uint64_t last_written_block;
284 size_t sector_prefix_length;
285 size_t sector_suffix_length;
286 size_t sector_prefix_offset;
287 size_t sector_suffix_offset;
288 int current_block_offset;
289 int writing_buffer_position;
290 uint8_t current_track_type;
292 bool is_writing;
293 bool rewinded;
294 bool writing_long;
295
296 /* Options */
297 uint32_t lzma_dict_size;
298 bool deduplicate;
299 bool compression_enabled;
300
301 /* Tape-specific structures */
302 tapeFileHashEntry *tape_files;
303 TapePartitionHashEntry *tape_partitions;
304 bool is_tape;
305} aaruformat_context;
306
313 typedef struct DumpHardwareEntriesWithData
314{
315 DumpHardwareEntry entry;
316 struct DumpExtent *extents;
317 uint8_t *manufacturer;
318 uint8_t *model;
319 uint8_t *revision;
320 uint8_t *firmware;
321 uint8_t *serial;
322 uint8_t *softwareName;
323 uint8_t *softwareVersion;
324 uint8_t *softwareOperatingSystem;
325} DumpHardwareEntriesWithData;
326
327#pragma pack(push, 1)
328
332 typedef struct DumpExtent
333{
334 uint64_t start;
335 uint64_t end;
336} DumpExtent;
337
338#pragma pack(pop)
339
340#endif // LIBAARUFORMAT_CONTEXT_H
MD5_DIGEST_LENGTH
#define MD5_DIGEST_LENGTH
Definition context.h:69
tapeFileHashEntry
struct TapeFileHashEntry tapeFileHashEntry
crc64.h
CRC64 (ECMA-182) core context and precomputed slicing-by-4 tables.
hash_map.h
lru.h
md5.h
sha1.h
SHA1_DIGEST_LENGTH
#define SHA1_DIGEST_LENGTH
Definition sha1.h:39
sha256.h
SHA256_DIGEST_LENGTH
#define SHA256_DIGEST_LENGTH
Definition sha256.h:38
spamsum.h
AaruHeaderV2
Version 2 container header with GUID, alignment shifts, and feature negotiation bitmaps.
Definition header.h:107
AaruMetadataJsonBlockHeader
Header for an Aaru metadata JSON block (identifier == BlockType::AaruMetadataJsonBlock).
Definition metadata.h:120
BlockHeader
Header preceding the compressed data payload of a data block (BlockType::DataBlock).
Definition data.h:71
CacheHeader
Cache top-level descriptor encapsulating the hash table root and capacity limit.
Definition lru.h:46
CdEccContext
Lookup tables and state for Compact Disc EDC/ECC (P/Q) regeneration / verification.
Definition context.h:86
CdEccContext::ecc_f_table
uint8_t * ecc_f_table
Forward (F) ECC table.
Definition context.h:89
CdEccContext::inited_edc
bool inited_edc
True once EDC/ECC tables have been initialized.
Definition context.h:87
CdEccContext::edc_table
uint32_t * edc_table
EDC (CRC) lookup table.
Definition context.h:90
CdEccContext::ecc_b_table
uint8_t * ecc_b_table
Backward (B) ECC table (allocated, size implementation-defined).
Definition context.h:88
Checksums
Collected whole‑image checksums / hashes present in a checksum block.
Definition context.h:100
Checksums::spamsum
uint8_t * spamsum
SpamSum fuzzy hash (ASCII), allocated length+1 with trailing 0.
Definition context.h:110
Checksums::hasSha256
bool hasSha256
True if sha256[] buffer populated.
Definition context.h:103
Checksums::sha1
uint8_t sha1[20]
SHA-1 digest (20 bytes).
Definition context.h:107
Checksums::sha256
uint8_t sha256[32]
SHA-256 digest (32 bytes).
Definition context.h:108
Checksums::md5
uint8_t md5[16]
MD5 digest (16 bytes).
Definition context.h:106
Checksums::hasSpamSum
bool hasSpamSum
True if spamsum pointer allocated and signature read.
Definition context.h:105
Checksums::hasSha1
bool hasSha1
True if sha1[] buffer populated.
Definition context.h:102
Checksums::blake3
uint8_t blake3[BLAKE3_OUT_LEN]
BLAKE3 digest (32 bytes).
Definition context.h:109
Checksums::hasMd5
bool hasMd5
True if md5[] buffer populated.
Definition context.h:101
Checksums::hasBlake3
bool hasBlake3
True if blake3[] buffer populated.
Definition context.h:104
CicmMetadataBlock
Header for a CICM XML metadata block (identifier == BlockType::CicmBlock).
Definition metadata.h:108
DdtHeader2
Header preceding a version 2 hierarchical deduplication table.
Definition ddt.h:142
DumpExtent
Inclusive [start,end] logical sector range contributed by a single hardware environment.
Definition context.h:333
DumpExtent::end
uint64_t end
Ending LBA (inclusive); >= start.
Definition context.h:335
DumpExtent::start
uint64_t start
Starting LBA (inclusive).
Definition context.h:334
DumpHardwareEntriesWithData
In-memory representation of a dump hardware entry plus decoded variable-length fields & extents.
Definition context.h:314
DumpHardwareEntriesWithData::firmware
uint8_t * firmware
Firmware version string or NULL.
Definition context.h:320
DumpHardwareEntriesWithData::revision
uint8_t * revision
Hardware revision string or NULL.
Definition context.h:319
DumpHardwareEntriesWithData::model
uint8_t * model
Model string or NULL.
Definition context.h:318
DumpHardwareEntriesWithData::softwareName
uint8_t * softwareName
Dump software name or NULL.
Definition context.h:322
DumpHardwareEntriesWithData::extents
struct DumpExtent * extents
Array of extents (entry.extents elements) or NULL.
Definition context.h:316
DumpHardwareEntriesWithData::manufacturer
uint8_t * manufacturer
Manufacturer string (UTF-8) or NULL.
Definition context.h:317
DumpHardwareEntriesWithData::softwareVersion
uint8_t * softwareVersion
Dump software version or NULL.
Definition context.h:323
DumpHardwareEntriesWithData::serial
uint8_t * serial
Serial number string or NULL.
Definition context.h:321
DumpHardwareEntriesWithData::entry
DumpHardwareEntry entry
Fixed-size header with lengths & counts.
Definition context.h:315
DumpHardwareEntriesWithData::softwareOperatingSystem
uint8_t * softwareOperatingSystem
Host operating system string or NULL.
Definition context.h:324
DumpHardwareEntry
Per-environment length table describing subsequent UTF-8 strings and optional extent array.
Definition dump.h:113
DumpHardwareHeader
Header that precedes a sequence of dump hardware entries and their variable-length payload.
Definition dump.h:91
GeometryBlockHeader
Legacy CHS style logical geometry metadata (BlockType::GeometryBlock).
Definition data.h:91
ImageInfo
High-level summary of an opened Aaru image containing metadata and media characteristics.
Definition aaru.h:870
MetadataBlockHeader
Header for a metadata block containing offsets and lengths to UTF-16LE descriptive strings.
Definition metadata.h:69
TapeDdtHashEntry
Definition context.h:141
TapeDdtHashEntry::hh
UT_hash_handle hh
UTHASH handle.
Definition context.h:144
TapeDdtHashEntry::key
uint64_t key
Key: sector address.
Definition context.h:142
TapeDdtHashEntry::value
uint64_t value
Value: DDT entry.
Definition context.h:143
TapeFileEntry
Describes a single logical file on a tape medium.
Definition tape.h:134
TapeFileHashEntry
Definition context.h:127
TapeFileHashEntry::hh
UT_hash_handle hh
UTHASH handle.
Definition context.h:130
TapeFileHashEntry::key
uint64_t key
Composite key: partition << 32 | file.
Definition context.h:128
TapeFileHashEntry::fileEntry
TapeFileEntry fileEntry
The actual tape file data.
Definition context.h:129
TapePartitionEntry
Describes a single physical partition on a tape medium.
Definition tape.h:320
TapePartitionHashEntry
Definition context.h:134
TapePartitionHashEntry::hh
UT_hash_handle hh
UTHASH handle.
Definition context.h:137
TapePartitionHashEntry::key
uint8_t key
Key: partition.
Definition context.h:135
TapePartitionHashEntry::partitionEntry
TapePartitionEntry partitionEntry
The actual tape partition data.
Definition context.h:136
TrackEntry
Single optical disc track descriptor (sequence, type, LBAs, session, ISRC, flags).
Definition optical.h:72
TracksHeader
Header for an optical tracks block listing track entries.
Definition optical.h:62
aaruformat_context
Master context representing an open or in‑creation Aaru image.
Definition context.h:172
aaruformat_context::media_barcode
uint8_t * media_barcode
Barcode of the media represented by the image.
Definition context.h:222
aaruformat_context::user_data_ddt_header
DdtHeader2 user_data_ddt_header
Active user data DDT v2 header (primary table meta).
Definition context.h:189
aaruformat_context::checksums
Checksums checksums
Whole-image checksums discovered.
Definition context.h:269
aaruformat_context::library_major_version
uint8_t library_major_version
Linked library major version.
Definition context.h:177
aaruformat_context::creator
uint8_t * creator
Who (person) created the image?
Definition context.h:216
aaruformat_context::deduplicate
bool deduplicate
Storage deduplication active (duplicates coalesce).
Definition context.h:298
aaruformat_context::sector_suffix_length
size_t sector_suffix_length
Length of sector_suffix.
Definition context.h:285
aaruformat_context::compression_enabled
bool compression_enabled
True if block compression enabled (writing path).
Definition context.h:299
aaruformat_context::last_written_block
uint64_t last_written_block
Last written block number (write path).
Definition context.h:283
aaruformat_context::cicm_block
uint8_t * cicm_block
CICM XML payload.
Definition context.h:214
aaruformat_context::sector_cpr_mai
uint8_t * sector_cpr_mai
DVD sector CPR_MAI (6 bytes) if present.
Definition context.h:207
aaruformat_context::sector_hash_map
hash_map_t * sector_hash_map
Deduplication hash map (fingerprint->entry mapping).
Definition context.h:253
aaruformat_context::sector_prefix_corrected
uint8_t * sector_prefix_corrected
Corrected variant (post error correction) if stored.
Definition context.h:200
aaruformat_context::user_data_ddt
uint64_t * user_data_ddt
Legacy flat DDT pointer (NULL when using v2 mini/big arrays).
Definition context.h:181
aaruformat_context::sha256_context
sha256_ctx sha256_context
Opaque SHA-256 context for streaming updates.
Definition context.h:272
aaruformat_context::data_tracks
TrackEntry * data_tracks
Filtered list of data tracks (subset of trackEntries).
Definition context.h:243
aaruformat_context::cylinders
uint32_t cylinders
Cylinders of the media represented by the image.
Definition context.h:234
aaruformat_context::calculating_sha256
bool calculating_sha256
True if whole-image SHA-256 being calculated on-the-fly.
Definition context.h:275
aaruformat_context::drive_firmware_revision
uint8_t * drive_firmware_revision
Firmware revision of the drive used to read the media represented by the image.
Definition context.h:228
aaruformat_context::media_serial_number
uint8_t * media_serial_number
Serial number of the media represented by the image.
Definition context.h:221
aaruformat_context::block_header_cache
struct CacheHeader block_header_cache
LRU/Cache header for block headers.
Definition context.h:256
aaruformat_context::sector_ied
uint8_t * sector_ied
DVD sector IED (2 bytes) if present.
Definition context.h:206
aaruformat_context::md5_context
md5_ctx md5_context
Opaque MD5 context for streaming updates.
Definition context.h:270
aaruformat_context::user_data_ddt2
uint64_t * user_data_ddt2
DDT entries (big variant) primary/secondary current.
Definition context.h:187
aaruformat_context::metadata_block_header
MetadataBlockHeader metadata_block_header
Metadata block header.
Definition context.h:230
aaruformat_context::media_sequence
int32_t media_sequence
Number in sequence for the media represented by the image.
Definition context.h:238
aaruformat_context::shift
uint8_t shift
Legacy overall shift (deprecated by data_shift/table_shift).
Definition context.h:195
aaruformat_context::sector_prefix
uint8_t * sector_prefix
Raw per-sector prefix (e.g., sync+header) uncorrected.
Definition context.h:199
aaruformat_context::sector_suffix_ddt2
uint64_t * sector_suffix_ddt2
CD sector suffix DDT V2.
Definition context.h:186
aaruformat_context::tape_files
tapeFileHashEntry * tape_files
Hash table root for tape files.
Definition context.h:302
aaruformat_context::cached_ddt_offset
uint64_t cached_ddt_offset
File offset of currently cached secondary DDT (0=none).
Definition context.h:190
aaruformat_context::is_tape
bool is_tape
True if the image is a tape image.
Definition context.h:304
aaruformat_context::sector_edc
uint8_t * sector_edc
DVD sector EDC (4 bytes) if present.
Definition context.h:208
aaruformat_context::calculating_sha1
bool calculating_sha1
True if whole-image SHA-1 being calculated on-the-fly.
Definition context.h:274
aaruformat_context::media_model
uint8_t * media_model
Model of the media represented by the image.
Definition context.h:220
aaruformat_context::drive_serial_number
uint8_t * drive_serial_number
Serial number of the drive used to read the media represented by the image.
Definition context.h:226
aaruformat_context::ecc_cd_context
CdEccContext * ecc_cd_context
CD ECC/EDC helper tables (allocated on demand).
Definition context.h:248
aaruformat_context::rewinded
bool rewinded
True if stream has been rewound after open (write path).
Definition context.h:293
aaruformat_context::block_cache
struct CacheHeader block_cache
LRU/Cache header for block payloads.
Definition context.h:257
aaruformat_context::sector_suffix_ddt
uint32_t * sector_suffix_ddt
Legacy CD sector suffix DDT.
Definition context.h:184
aaruformat_context::drive_manufacturer
uint8_t * drive_manufacturer
Manufacturer of the drive used to read the media represented by the image.
Definition context.h:224
aaruformat_context::in_memory_ddt
bool in_memory_ddt
True if primary (and possibly secondary) DDT loaded.
Definition context.h:196
aaruformat_context::sector_suffix
uint8_t * sector_suffix
Raw per-sector suffix (EDC/ECC) uncorrected.
Definition context.h:201
aaruformat_context::header
AaruHeaderV2 header
Parsed container header (v2).
Definition context.h:175
aaruformat_context::current_block_offset
int current_block_offset
Logical offset inside block (units: bytes or sectors depending on path).
Definition context.h:288
aaruformat_context::is_writing
bool is_writing
True if context opened/created for writing.
Definition context.h:292
aaruformat_context::tape_ddt
TapeDdtHashEntry * tape_ddt
Hash table root for tape DDT entries.
Definition context.h:182
aaruformat_context::spamsum_context
spamsum_ctx * spamsum_context
Opaque SpamSum context for streaming updates.
Definition context.h:267
aaruformat_context::cicm_block_header
CicmMetadataBlock cicm_block_header
CICM metadata header (if present).
Definition context.h:231
aaruformat_context::sector_prefix_offset
size_t sector_prefix_offset
Current position in sector_prefix.
Definition context.h:286
aaruformat_context::drive_model
uint8_t * drive_model
Model of the drive used to read the media represented by the image.
Definition context.h:225
aaruformat_context::current_block_header
BlockHeader current_block_header
Header for block currently being assembled (write path).
Definition context.h:281
aaruformat_context::ddt_version
int ddt_version
DDT version in use (1=legacy, 2=v2 hierarchical).
Definition context.h:194
aaruformat_context::magic
uint64_t magic
File magic (AARU_MAGIC) post-open.
Definition context.h:174
aaruformat_context::writing_buffer
uint8_t * writing_buffer
Accumulation buffer for current block data.
Definition context.h:280
aaruformat_context::sector_prefix_ddt2
uint64_t * sector_prefix_ddt2
CD sector prefix DDT V2.
Definition context.h:185
aaruformat_context::calculating_spamsum
bool calculating_spamsum
True if whole-image SpamSum being calculated on-the-fly.
Definition context.h:276
aaruformat_context::primary_ddt_offset
uint64_t primary_ddt_offset
File offset of the primary DDT v2 table.
Definition context.h:192
aaruformat_context::sector_prefix_length
size_t sector_prefix_length
Length of sector_prefix.
Definition context.h:284
aaruformat_context::mediaTags
mediaTagEntry * mediaTags
Hash table of extra media tags (uthash root).
Definition context.h:264
aaruformat_context::blake3_context
blake3_hasher * blake3_context
Opaque BLAKE3 context for streaming updates.
Definition context.h:268
aaruformat_context::calculating_blake3
bool calculating_blake3
True if whole-image BLAKE3 being calculated on-the-fly.
Definition context.h:277
aaruformat_context::library_minor_version
uint8_t library_minor_version
Linked library minor version;.
Definition context.h:178
aaruformat_context::dump_hardware_entries_with_data
struct DumpHardwareEntriesWithData * dump_hardware_entries_with_data
Array of dump hardware entries + strings.
Definition context.h:212
aaruformat_context::next_block_position
uint64_t next_block_position
Absolute file offset where next block will be written.
Definition context.h:282
aaruformat_context::calculating_md5
bool calculating_md5
True if whole-image MD5 being calculated on-the-fly.
Definition context.h:273
aaruformat_context::geometry_block
GeometryBlockHeader geometry_block
Logical geometry block (if present).
Definition context.h:229
aaruformat_context::sector_suffix_offset
size_t sector_suffix_offset
Current position in sector_suffix.
Definition context.h:287
aaruformat_context::cached_secondary_ddt2
uint64_t * cached_secondary_ddt2
Cached secondary table (big entries) or NULL.
Definition context.h:188
aaruformat_context::json_block
uint8_t * json_block
JSON metadata block payload (UTF-8).
Definition context.h:215
aaruformat_context::media_part_number
uint8_t * media_part_number
Part number of the media represented by the image.
Definition context.h:223
aaruformat_context::sector_decrypted_title_key
uint8_t * sector_decrypted_title_key
DVD decrypted title key (5 bytes) if present.
Definition context.h:209
aaruformat_context::json_block_header
AaruMetadataJsonBlockHeader json_block_header
JSON metadata block header (if present).
Definition context.h:233
aaruformat_context::writing_buffer_position
int writing_buffer_position
Current size / position within writingBuffer.
Definition context.h:289
aaruformat_context::crc64_context
crc64_ctx * crc64_context
Opaque CRC64 context for streaming updates.
Definition context.h:249
aaruformat_context::sectors_per_track
uint32_t sectors_per_track
Sectors per track of the media represented by the image (for variable image, the smallest)
Definition context.h:236
aaruformat_context::sector_subchannel
uint8_t * sector_subchannel
Raw 96-byte subchannel (if captured).
Definition context.h:203
aaruformat_context::comments
uint8_t * comments
Image comments.
Definition context.h:218
aaruformat_context::heads
uint32_t heads
Heads of the media represented by the image.
Definition context.h:235
aaruformat_context::imageStream
FILE * imageStream
Underlying FILE* stream (binary mode).
Definition context.h:176
aaruformat_context::index_entries
UT_array * index_entries
Flattened index entries (UT_array of IndexEntry).
Definition context.h:252
aaruformat_context::mode2_subheaders
uint8_t * mode2_subheaders
MODE2 Form1/Form2 8-byte subheaders (concatenated).
Definition context.h:204
aaruformat_context::image_info
ImageInfo image_info
Exposed high-level image info summary.
Definition context.h:260
aaruformat_context::sector_id
uint8_t * sector_id
DVD sector ID (4 bytes) if present.
Definition context.h:205
aaruformat_context::dump_hardware_header
DumpHardwareHeader dump_hardware_header
Dump hardware header.
Definition context.h:232
aaruformat_context::sha1_context
sha1_ctx sha1_context
Opaque SHA-1 context for streaming updates.
Definition context.h:271
aaruformat_context::readableSectorTags
bool * readableSectorTags
Per-sector boolean array (optical tags read successfully?).
Definition context.h:263
aaruformat_context::tape_partitions
TapePartitionHashEntry * tape_partitions
Hash table root for tape partitions.
Definition context.h:303
aaruformat_context::sector_prefix_ddt
uint32_t * sector_prefix_ddt
Legacy CD sector prefix DDT (deprecated by *2).
Definition context.h:183
aaruformat_context::lzma_dict_size
uint32_t lzma_dict_size
LZMA dictionary size (writing path).
Definition context.h:297
aaruformat_context::track_entries
TrackEntry * track_entries
Full track list (tracksHeader.entries elements).
Definition context.h:242
aaruformat_context::number_of_data_tracks
uint8_t number_of_data_tracks
Count of tracks considered "data" (sequence 1..99 heuristics).
Definition context.h:245
aaruformat_context::sector_suffix_corrected
uint8_t * sector_suffix_corrected
Corrected suffix if stored separately.
Definition context.h:202
aaruformat_context::metadata_block
uint8_t * metadata_block
Raw metadata UTF-16LE concatenated strings.
Definition context.h:213
aaruformat_context::cached_ddt_position
uint64_t cached_ddt_position
Position index of cached secondary DDT.
Definition context.h:191
aaruformat_context::current_track_type
uint8_t current_track_type
Current track type (when writing optical images with tracks, needed for block compression type).
Definition context.h:290
aaruformat_context::writing_long
bool writing_long
True if writing long sectors.
Definition context.h:294
aaruformat_context::media_title
uint8_t * media_title
Title of the media represented by the image.
Definition context.h:217
aaruformat_context::last_media_sequence
int32_t last_media_sequence
Last media of the sequence the media represented by the image corresponds to.
Definition context.h:239
aaruformat_context::mapped_memory_ddt_size
size_t mapped_memory_ddt_size
Length of mmapped DDT if userDataDdt is mmapped.
Definition context.h:193
aaruformat_context::media_manufacturer
uint8_t * media_manufacturer
Manufacturer of the media represented by the image.
Definition context.h:219
aaruformat_context::tracks_header
TracksHeader tracks_header
Tracks header (optical) if present.
Definition context.h:244
crc64_ctx
Minimal ECMA-182 CRC64 incremental state container (running value only).
Definition crc64.h:56
hash_map_t
Minimal open-addressing hash map for 64-bit key/value pairs used in deduplication lookup.
Definition hash_map.h:50
md5_ctx
Definition md5.h:32
mediaTagEntry
Hash table entry for an arbitrary media tag (e.g., proprietary drive/medium descriptor).
Definition context.h:119
mediaTagEntry::data
uint8_t * data
Tag data blob (opaque to library core); length bytes long.
Definition context.h:120
mediaTagEntry::type
int32_t type
Numeric type identifier.
Definition context.h:121
mediaTagEntry::length
uint32_t length
Length in bytes of data.
Definition context.h:122
mediaTagEntry::hh
UT_hash_handle hh
uthash linkage.
Definition context.h:123
structs.h
sha1_ctx
Definition sha1.h:43
sha256_ctx
Definition sha256.h:42
spamsum_ctx
Definition spamsum.h:51