19#ifndef LIBAARUFORMAT_CONTEXT_H
20#define LIBAARUFORMAT_CONTEXT_H
68#ifndef MD5_DIGEST_LENGTH
69#define MD5_DIGEST_LENGTH 16
72#ifndef SHA1_DIGEST_LENGTH
73#define SHA1_DIGEST_LENGTH 20
76#ifndef SHA256_DIGEST_LENGTH
77#define SHA256_DIGEST_LENGTH 32
#define MD5_DIGEST_LENGTH
struct TapeFileHashEntry tapeFileHashEntry
CRC64 (ECMA-182) core context and precomputed slicing-by-4 tables.
#define SHA1_DIGEST_LENGTH
#define SHA256_DIGEST_LENGTH
Lookup tables and state for Compact Disc EDC/ECC (P/Q) regeneration / verification.
uint8_t * ecc_f_table
Forward (F) ECC table.
bool inited_edc
True once EDC/ECC tables have been initialized.
uint32_t * edc_table
EDC (CRC) lookup table.
uint8_t * ecc_b_table
Backward (B) ECC table (allocated, size implementation-defined).
Collected whole‑image checksums / hashes present in a checksum block.
uint8_t * spamsum
SpamSum fuzzy hash (ASCII), allocated length+1 with trailing 0.
bool hasSha256
True if sha256[] buffer populated.
uint8_t sha1[20]
SHA-1 digest (20 bytes).
uint8_t sha256[32]
SHA-256 digest (32 bytes).
uint8_t md5[16]
MD5 digest (16 bytes).
bool hasSpamSum
True if spamsum pointer allocated and signature read.
bool hasSha1
True if sha1[] buffer populated.
uint8_t blake3[BLAKE3_OUT_LEN]
BLAKE3 digest (32 bytes).
bool hasMd5
True if md5[] buffer populated.
bool hasBlake3
True if blake3[] buffer populated.
Inclusive [start,end] logical sector range contributed by a single hardware environment.
uint64_t end
Ending LBA (inclusive); >= start.
uint64_t start
Starting LBA (inclusive).
In-memory representation of a dump hardware entry plus decoded variable-length fields & extents.
uint8_t * firmware
Firmware version string or NULL.
uint8_t * revision
Hardware revision string or NULL.
uint8_t * model
Model string or NULL.
uint8_t * softwareName
Dump software name or NULL.
struct DumpExtent * extents
Array of extents (entry.extents elements) or NULL.
uint8_t * manufacturer
Manufacturer string (UTF-8) or NULL.
uint8_t * softwareVersion
Dump software version or NULL.
uint8_t * serial
Serial number string or NULL.
DumpHardwareEntry entry
Fixed-size header with lengths & counts.
uint8_t * softwareOperatingSystem
Host operating system string or NULL.
Per-environment length table describing subsequent UTF-8 strings and optional extent array.
High-level summary of an opened Aaru image containing metadata and media characteristics.
UT_hash_handle hh
UTHASH handle.
uint64_t key
Key: sector address.
uint64_t value
Value: DDT entry.
Describes a single logical file on a tape medium.
UT_hash_handle hh
UTHASH handle.
uint64_t key
Composite key: partition << 32 | file.
TapeFileEntry fileEntry
The actual tape file data.
Describes a single physical partition on a tape medium.
UT_hash_handle hh
UTHASH handle.
uint8_t key
Key: partition.
TapePartitionEntry partitionEntry
The actual tape partition data.
Single optical disc track descriptor (sequence, type, LBAs, session, ISRC, flags).
Master context representing an open or in‑creation Aaru image.
uint8_t * media_barcode
Barcode of the media represented by the image.
DdtHeader2 user_data_ddt_header
Active user data DDT v2 header (primary table meta).
Checksums checksums
Whole-image checksums discovered.
uint8_t library_major_version
Linked library major version.
uint8_t * creator
Who (person) created the image?
bool deduplicate
Storage deduplication active (duplicates coalesce).
size_t sector_suffix_length
Length of sector_suffix.
bool compression_enabled
True if block compression enabled (writing path).
uint64_t last_written_block
Last written block number (write path).
uint8_t * cicm_block
CICM XML payload.
uint8_t * sector_cpr_mai
DVD sector CPR_MAI (6 bytes) if present.
hash_map_t * sector_hash_map
Deduplication hash map (fingerprint->entry mapping).
uint8_t * sector_prefix_corrected
Corrected variant (post error correction) if stored.
uint64_t * user_data_ddt
Legacy flat DDT pointer (NULL when using v2 mini/big arrays).
sha256_ctx sha256_context
Opaque SHA-256 context for streaming updates.
TrackEntry * data_tracks
Filtered list of data tracks (subset of trackEntries).
uint32_t cylinders
Cylinders of the media represented by the image.
bool calculating_sha256
True if whole-image SHA-256 being calculated on-the-fly.
uint8_t * drive_firmware_revision
Firmware revision of the drive used to read the media represented by the image.
uint8_t * media_serial_number
Serial number of the media represented by the image.
struct CacheHeader block_header_cache
LRU/Cache header for block headers.
uint8_t * sector_ied
DVD sector IED (2 bytes) if present.
md5_ctx md5_context
Opaque MD5 context for streaming updates.
uint64_t * user_data_ddt2
DDT entries (big variant) primary/secondary current.
MetadataBlockHeader metadata_block_header
Metadata block header.
int32_t media_sequence
Number in sequence for the media represented by the image.
uint8_t shift
Legacy overall shift (deprecated by data_shift/table_shift).
uint8_t * sector_prefix
Raw per-sector prefix (e.g., sync+header) uncorrected.
uint64_t * sector_suffix_ddt2
CD sector suffix DDT V2.
tapeFileHashEntry * tape_files
Hash table root for tape files.
uint64_t cached_ddt_offset
File offset of currently cached secondary DDT (0=none).
bool is_tape
True if the image is a tape image.
uint8_t * sector_edc
DVD sector EDC (4 bytes) if present.
bool calculating_sha1
True if whole-image SHA-1 being calculated on-the-fly.
uint8_t * media_model
Model of the media represented by the image.
uint8_t * drive_serial_number
Serial number of the drive used to read the media represented by the image.
CdEccContext * ecc_cd_context
CD ECC/EDC helper tables (allocated on demand).
bool rewinded
True if stream has been rewound after open (write path).
struct CacheHeader block_cache
LRU/Cache header for block payloads.
uint32_t * sector_suffix_ddt
Legacy CD sector suffix DDT.
uint8_t * drive_manufacturer
Manufacturer of the drive used to read the media represented by the image.
bool in_memory_ddt
True if primary (and possibly secondary) DDT loaded.
uint8_t * sector_suffix
Raw per-sector suffix (EDC/ECC) uncorrected.
AaruHeaderV2 header
Parsed container header (v2).
int current_block_offset
Logical offset inside block (units: bytes or sectors depending on path).
bool is_writing
True if context opened/created for writing.
TapeDdtHashEntry * tape_ddt
Hash table root for tape DDT entries.
spamsum_ctx * spamsum_context
Opaque SpamSum context for streaming updates.
CicmMetadataBlock cicm_block_header
CICM metadata header (if present).
size_t sector_prefix_offset
Current position in sector_prefix.
uint8_t * drive_model
Model of the drive used to read the media represented by the image.
BlockHeader current_block_header
Header for block currently being assembled (write path).
int ddt_version
DDT version in use (1=legacy, 2=v2 hierarchical).
uint64_t magic
File magic (AARU_MAGIC) post-open.
uint8_t * writing_buffer
Accumulation buffer for current block data.
uint64_t * sector_prefix_ddt2
CD sector prefix DDT V2.
bool calculating_spamsum
True if whole-image SpamSum being calculated on-the-fly.
uint64_t primary_ddt_offset
File offset of the primary DDT v2 table.
size_t sector_prefix_length
Length of sector_prefix.
mediaTagEntry * mediaTags
Hash table of extra media tags (uthash root).
blake3_hasher * blake3_context
Opaque BLAKE3 context for streaming updates.
bool calculating_blake3
True if whole-image BLAKE3 being calculated on-the-fly.
uint8_t library_minor_version
Linked library minor version;.
struct DumpHardwareEntriesWithData * dump_hardware_entries_with_data
Array of dump hardware entries + strings.
uint64_t next_block_position
Absolute file offset where next block will be written.
bool calculating_md5
True if whole-image MD5 being calculated on-the-fly.
GeometryBlockHeader geometry_block
Logical geometry block (if present).
size_t sector_suffix_offset
Current position in sector_suffix.
uint64_t * cached_secondary_ddt2
Cached secondary table (big entries) or NULL.
uint8_t * json_block
JSON metadata block payload (UTF-8).
uint8_t * media_part_number
Part number of the media represented by the image.
uint8_t * sector_decrypted_title_key
DVD decrypted title key (5 bytes) if present.
AaruMetadataJsonBlockHeader json_block_header
JSON metadata block header (if present).
int writing_buffer_position
Current size / position within writingBuffer.
crc64_ctx * crc64_context
Opaque CRC64 context for streaming updates.
uint32_t sectors_per_track
Sectors per track of the media represented by the image (for variable image, the smallest)
uint8_t * sector_subchannel
Raw 96-byte subchannel (if captured).
uint8_t * comments
Image comments.
uint32_t heads
Heads of the media represented by the image.
FILE * imageStream
Underlying FILE* stream (binary mode).
UT_array * index_entries
Flattened index entries (UT_array of IndexEntry).
uint8_t * mode2_subheaders
MODE2 Form1/Form2 8-byte subheaders (concatenated).
ImageInfo image_info
Exposed high-level image info summary.
uint8_t * sector_id
DVD sector ID (4 bytes) if present.
DumpHardwareHeader dump_hardware_header
Dump hardware header.
sha1_ctx sha1_context
Opaque SHA-1 context for streaming updates.
bool * readableSectorTags
Per-sector boolean array (optical tags read successfully?).
TapePartitionHashEntry * tape_partitions
Hash table root for tape partitions.
uint32_t * sector_prefix_ddt
Legacy CD sector prefix DDT (deprecated by *2).
uint32_t lzma_dict_size
LZMA dictionary size (writing path).
TrackEntry * track_entries
Full track list (tracksHeader.entries elements).
uint8_t number_of_data_tracks
Count of tracks considered "data" (sequence 1..99 heuristics).
uint8_t * sector_suffix_corrected
Corrected suffix if stored separately.
uint8_t * metadata_block
Raw metadata UTF-16LE concatenated strings.
uint64_t cached_ddt_position
Position index of cached secondary DDT.
uint8_t current_track_type
Current track type (when writing optical images with tracks, needed for block compression type).
bool writing_long
True if writing long sectors.
uint8_t * media_title
Title of the media represented by the image.
int32_t last_media_sequence
Last media of the sequence the media represented by the image corresponds to.
size_t mapped_memory_ddt_size
Length of mmapped DDT if userDataDdt is mmapped.
uint8_t * media_manufacturer
Manufacturer of the media represented by the image.
TracksHeader tracks_header
Tracks header (optical) if present.
Minimal ECMA-182 CRC64 incremental state container (running value only).
Minimal open-addressing hash map for 64-bit key/value pairs used in deduplication lookup.
Hash table entry for an arbitrary media tag (e.g., proprietary drive/medium descriptor).
uint8_t * data
Tag data blob (opaque to library core); length bytes long.
int32_t type
Numeric type identifier.
uint32_t length
Length in bytes of data.
UT_hash_handle hh
uthash linkage.