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

◆ cmpLength

◆ compression

◆ crc64

◆ identifier

◆ length

uint32_t BlockHeader::length

◆ 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


The documentation for this struct was generated from the following file:
  • include/aaruformat/structs/data.h