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