Loading...
Searching...
No Matches
ddt.h
Go to the documentation of this file.
/*
* This file is part of the Aaru Data Preservation Suite.
* Copyright (c) 2019-2026 Natalia Portillo.
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of the
* License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIBAARUFORMAT_DDT_H
#define LIBAARUFORMAT_DDT_H
#include <stdint.h> // fixed-width types for on-disk layout
#pragma pack(push, 1)
typedef struct DdtHeader
{
uint32_t identifier;
uint16_t type;
uint16_t compression;
uint8_t shift;
uint64_t entries;
uint64_t cmpLength;
uint64_t length;
uint64_t cmpCrc64;
uint64_t crc64;
} DdtHeader;
typedef struct DdtHeader2
{
uint32_t identifier;
uint16_t type;
uint16_t compression;
uint8_t levels;
uint8_t tableLevel;
uint64_t previousLevelOffset;
uint32_t negative;
uint64_t blocks;
uint32_t overflow;
uint64_t
start;
uint8_t blockAlignmentShift;
uint8_t dataShift;
uint8_t tableShift;
uint64_t entries;
uint64_t cmpLength;
uint64_t length;
uint64_t cmpCrc64;
uint64_t crc64;
} DdtHeader2;
#pragma pack(pop)
#endif // LIBAARUFORMAT_DDT_H
DdtHeader2
Header preceding a version 2 hierarchical deduplication table.
Definition ddt.h:142
DdtHeader2::cmpCrc64
uint64_t cmpCrc64
CRC64-ECMA of compressed table payload.
Definition ddt.h:161
DdtHeader2::type
uint16_t type
Data classification (DataType) for sectors referenced by this table.
Definition ddt.h:144
DdtHeader2::start
uint64_t start
Base internal index covered by this table (used for secondary tables; currently informational).
Definition ddt.h:153
DdtHeader2::crc64
uint64_t crc64
CRC64-ECMA of uncompressed table payload.
Definition ddt.h:162
DdtHeader2::entries
uint64_t entries
Number of entries contained in (uncompressed) table payload.
Definition ddt.h:158
DdtHeader2::levels
uint8_t levels
Total number of hierarchy levels (root depth); > 0.
Definition ddt.h:146
DdtHeader2::length
uint64_t length
Uncompressed payload size in bytes.
Definition ddt.h:160
DdtHeader2::identifier
uint32_t identifier
Block identifier, must be BlockType::DeDuplicationTable2.
Definition ddt.h:143
DdtHeader2::tableShift
uint8_t tableShift
2^tableShift = number of logical sectors per primary entry (multi-level only; 0 for single-level or s...
Definition ddt.h:156
DdtHeader2::blocks
uint64_t blocks
Total internal span (negative + usable + overflow) in logical sectors.
Definition ddt.h:150
DdtHeader2::blockAlignmentShift
uint8_t blockAlignmentShift
2^blockAlignmentShift = block alignment boundary in bytes.
Definition ddt.h:154
DdtHeader2::overflow
uint32_t overflow
Trailing dumped sectors beyond user area (overflow range), still mapped with entries.
Definition ddt.h:151
DdtHeader2::negative
uint32_t negative
Leading negative LBA count; added to external L to build internal index.
Definition ddt.h:149
DdtHeader2::tableLevel
uint8_t tableLevel
Zero-based level index of this table (0 = root, increases downward).
Definition ddt.h:147
DdtHeader2::compression
uint16_t compression
Compression algorithm for this table body (CompressionType).
Definition ddt.h:145
DdtHeader2::dataShift
uint8_t dataShift
2^dataShift = sectors represented per increment in blockIndex field.
Definition ddt.h:155
DdtHeader2::cmpLength
uint64_t cmpLength
Compressed payload size in bytes.
Definition ddt.h:159
DdtHeader2::previousLevelOffset
uint64_t previousLevelOffset
Absolute byte offset of the parent (previous) level table; 0 if root.
Definition ddt.h:148
DdtHeader
Header preceding a version 1 (flat) deduplication table body.
Definition ddt.h:66
DdtHeader::crc64
uint64_t crc64
CRC64-ECMA of the uncompressed payload.
Definition ddt.h:75
DdtHeader::shift
uint8_t shift
Left shift applied to per-entry file offset component forming logicalEntryValue.
Definition ddt.h:70
DdtHeader::compression
uint16_t compression
Compression algorithm for the table body (CompressionType).
Definition ddt.h:69
DdtHeader::identifier
uint32_t identifier
Block identifier, must be BlockType::DeDuplicationTable.
Definition ddt.h:67
DdtHeader::cmpLength
uint64_t cmpLength
Size in bytes of compressed entries payload.
Definition ddt.h:72
DdtHeader::length
uint64_t length
Size in bytes of uncompressed entries payload.
Definition ddt.h:73
DdtHeader::entries
uint64_t entries
Number of deduplication entries contained in (uncompressed) table.
Definition ddt.h:71
DdtHeader::type
uint16_t type
Data classification (DataType) for sectors referenced by this table.
Definition ddt.h:68
DdtHeader::cmpCrc64
uint64_t cmpCrc64
CRC64-ECMA of the compressed payload.
Definition ddt.h:74