|
libaaruformat 1.0
Aaru Data Preservation Suite - Format Library
|
Header for a tape file metadata block containing file layout information. More...
#include <aaruformat/structs/tape.h>
Data Fields | |
| uint32_t | identifier |
| Block type identifier. | |
| uint32_t | entries |
| Number of file entries following this header. | |
| uint64_t | length |
| Size of entry data in bytes (excluding this header). | |
| uint64_t | crc64 |
| CRC64-ECMA checksum of the entry data. | |
Header for a tape file metadata block containing file layout information.
This structure serves as the header for a TapeFileBlock, which documents all logical files present on the tape medium. The block consists of this fixed-size header followed by a variable-length array of TapeFileEntry structures (one per file).
Block Structure:
Purpose: The tape file block enables:
Identifier Field: The identifier field must be set to BlockType::TapeFileBlock to indicate this block type. This allows the Aaru format parser to recognize and correctly interpret the block during image loading.
Entry Count: The entries field specifies the number of TapeFileEntry structures that follow the header. A tape with no files would have entries=0, though this is unusual. Maximum value is 2^32-1 (4,294,967,295 files), though practical limits are much lower.
Block Length: The length field contains the size in bytes of the data following this header (i.e., the array of TapeFileEntry structures). This is calculated as: length = entries × sizeof(TapeFileEntry)
The header itself is NOT included in the length value. Total block size is: total_size = sizeof(TapeFileHeader) + length
CRC64 Checksum: The crc64 field contains a CRC64-ECMA checksum computed over the entry data (the array of TapeFileEntry structures, excluding this header). This provides integrity verification to detect corruption in the file table. The CRC is calculated using the ECMA polynomial.
File Order: Entries should be ordered by partition number (ascending), then by file number (ascending) within each partition. This ordering facilitates efficient lookup and matches the physical organization of most tape formats.
Alignment: When written to the Aaru image, this block is aligned to the image's block alignment boundary (typically 2^blockAlignmentShift bytes). Padding may be inserted before the block to achieve proper alignment.
Index Integration: After writing this block to the image file, an IndexEntry is created with:
| uint64_t TapeFileHeader::crc64 |
CRC64-ECMA checksum of the entry data.
Computed over the array of TapeFileEntry structures only. Does NOT include this header. Used for integrity verification.
Definition at line 245 of file tape.h.
Referenced by process_tape_files_block(), and write_tape_file_block().
| uint32_t TapeFileHeader::entries |
Number of file entries following this header.
Specifies how many TapeFileEntry structures are in this block. Valid range: 0 to 2^32-1.
Definition at line 241 of file tape.h.
Referenced by process_tape_files_block().
| uint32_t TapeFileHeader::identifier |
Block type identifier.
Must be set to BlockType::TapeFileBlock. This magic value allows parsers to identify the block type.
Definition at line 239 of file tape.h.
Referenced by process_tape_files_block(), and write_tape_file_block().
| uint64_t TapeFileHeader::length |
Size of entry data in bytes (excluding this header).
Calculated as: entries × sizeof(TapeFileEntry). This is the number of bytes following the header.
Definition at line 243 of file tape.h.
Referenced by write_tape_file_block().