libaaruformat 1.0 Aaru Data Preservation Suite - Format Library

Loading...
Searching...
No Matches
BlockHeader Struct Reference

Header preceding the compressed data payload of a data block (BlockType::DataBlock). More...

`#include <aaruformat/structs/data.h>`

## Data Fields
uint32_t | identifier
| Block identifier, must be BlockType::DataBlock.
uint16_t | type
| Logical data classification (value from DataType).
uint16_t | compression
| Compression algorithm used (value from CompressionType).
uint32_t | sectorSize
| Size in bytes of each logical sector represented in this block.
uint32_t | cmpLength
| Size in bytes of the compressed payload immediately following this header.
uint32_t | length
| Size in bytes of the uncompressed payload resulting after decompression.
uint64_t | cmpCrc64
| CRC64-ECMA of the compressed payload (cmpLength bytes).
uint64_t | crc64
| CRC64-ECMA of the uncompressed payload (length bytes).

## Detailed Description

Header preceding the compressed data payload of a data block (BlockType::DataBlock).

Invariants:

- cmpLength > 0 unless length == 0 (empty block)
- length == 0 implies cmpLength == 0
- If compression == CompressionType::None then cmpLength == length
- length % sectorSize == 0

Validation strategy (recommended for readers):

1. Verify identifier == BlockType::DataBlock.
2. Verify sectorSize is non-zero and a power-of-two or a commonly used size (512/1024/2048/4096/2352).
3. Verify invariants above and CRCs after (de)compression.

Definition at line 70 of file data.h.

## Field Documentation

## ◆ cmpCrc64

uint64_t BlockHeader::cmpCrc64

CRC64-ECMA of the compressed payload (cmpLength bytes).

Definition at line 78 of file data.h.

Referenced by aaruf_close_current_block(), aaruf_verify_image(), write_dvd_long_sector_blocks(), write_dvd_title_key_decrypted_block(), write_media_tags(), write_mode2_subheaders_block(), write_sector_prefix(), write_sector_subchannel(), and write_sector_suffix().

## ◆ cmpLength

uint32_t BlockHeader::cmpLength

Size in bytes of the compressed payload immediately following this header.

Definition at line 76 of file data.h.

Referenced by aaruf_close_current_block(), aaruf_read_sector(), aaruf_verify_image(), process_data_block(), write_dvd_long_sector_blocks(), write_dvd_title_key_decrypted_block(), write_media_tags(), write_mode2_subheaders_block(), write_sector_prefix(), write_sector_subchannel(), and write_sector_suffix().

## ◆ compression

uint16_t BlockHeader::compression

Compression algorithm used (value from CompressionType).

Definition at line 74 of file data.h.

Referenced by aaruf_close_current_block(), aaruf_read_sector(), aaruf_write_sector(), process_data_block(), write_dvd_long_sector_blocks(), write_dvd_title_key_decrypted_block(), write_media_tags(), write_mode2_subheaders_block(), write_sector_prefix(), write_sector_subchannel(), and write_sector_suffix().

## ◆ crc64

uint64_t BlockHeader::crc64

CRC64-ECMA of the uncompressed payload (length bytes).

Definition at line 79 of file data.h.

Referenced by aaruf_close_current_block(), process_data_block(), write_dvd_long_sector_blocks(), write_dvd_title_key_decrypted_block(), write_media_tags(), write_mode2_subheaders_block(), write_sector_prefix(), write_sector_subchannel(), and write_sector_suffix().

## ◆ identifier

uint32_t BlockHeader::identifier

Block identifier, must be BlockType::DataBlock.

Definition at line 72 of file data.h.

Referenced by aaruf_write_sector(), process_data_block(), write_dvd_long_sector_blocks(), write_dvd_title_key_decrypted_block(), write_media_tags(), write_mode2_subheaders_block(), write_sector_prefix(), write_sector_subchannel(), and write_sector_suffix().

## ◆ length

uint32_t BlockHeader::length

Size in bytes of the uncompressed payload resulting after decompression.

Definition at line 77 of file data.h.

Referenced by aaruf_close_current_block(), aaruf_read_sector(), process_data_block(), write_dvd_long_sector_blocks(), write_dvd_title_key_decrypted_block(), write_media_tags(), write_mode2_subheaders_block(), write_sector_prefix(), write_sector_subchannel(), and write_sector_suffix().

## ◆ sectorSize

uint32_t BlockHeader::sectorSize

Size in bytes of each logical sector represented in this block.

Definition at line 75 of file data.h.

Referenced by aaruf_close_current_block(), aaruf_read_sector(), aaruf_write_sector(), and process_data_block().

## ◆ type

uint16_t BlockHeader::type

Logical data classification (value from DataType).

Definition at line 73 of file data.h.

Referenced by aaruf_write_sector(), process_data_block(), write_dvd_long_sector_blocks(), write_dvd_title_key_decrypted_block(), write_media_tags(), write_mode2_subheaders_block(), write_sector_prefix(), write_sector_subchannel(), and write_sector_suffix().

The documentation for this struct was generated from the following file:

- include/aaruformat/structs/data.h