libaaruformat 1.0
Aaru Data Preservation Suite - Format Library
Loading...
Searching...
No Matches
erasure.h
Go to the documentation of this file.
1/*
2 * This file is part of the Aaru Data Preservation Suite.
3 * Copyright (c) 2019-2026 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_ERASURE_H
20#define LIBAARUFORMAT_ERASURE_H
21
22#include <stdint.h>
23
24#pragma pack(push, 1)
25
36
50{
51 uint32_t identifier;
52 uint8_t algorithm;
54 uint16_t compression;
55 uint64_t cmpLength;
56 uint64_t length;
57 uint64_t cmpCrc64;
58 uint64_t crc64;
60
69{
70 uint8_t groupType;
71 uint16_t K;
72 uint16_t M;
73 uint32_t shardSize;
74 uint32_t stripeCount;
75 uint16_t interleaveDepth;
77
88{
89 uint64_t offset;
90 uint32_t onDiskSize;
91 uint64_t shardCrc64;
93
102
124
125#pragma pack(pop)
126
127#endif /* LIBAARUFORMAT_ERASURE_H */
Version 2 container header with GUID, alignment shifts, and feature negotiation bitmaps.
Definition header.h:107
Recovery footer written at the very end of the file (last 160 bytes).
Definition erasure.h:117
uint64_t headerCrc64
CRC64-ECMA of the original AaruHeaderV2 (128 bytes at offset 0).
Definition erasure.h:120
uint64_t ecmbOffset
Absolute file offset of the primary ECMB.
Definition erasure.h:118
uint64_t footerMagic
Must be AARU_RECOVERY_FOOTER_MAGIC (0x52464D4345525641).
Definition erasure.h:122
uint64_t ecmbLength
Total on-disk size of the ECMB (header + payload).
Definition erasure.h:119
AaruHeaderV2 backupHeader
Complete copy of AaruHeaderV2 from file offset 0.
Definition erasure.h:121
Header for the Erasure Coding Map Block (BlockType::ErasureCodingMapBlock).
Definition erasure.h:50
uint8_t algorithm
Erasure coding algorithm (ErasureCodingAlgorithm).
Definition erasure.h:52
uint64_t cmpLength
Size in bytes of the compressed mapping payload.
Definition erasure.h:55
uint64_t cmpCrc64
CRC64-ECMA of the compressed mapping payload.
Definition erasure.h:57
uint64_t crc64
CRC64-ECMA of the uncompressed mapping payload.
Definition erasure.h:58
uint16_t compression
Compression algorithm for the mapping payload (CompressionType).
Definition erasure.h:54
uint32_t identifier
Block identifier, must be BlockType::ErasureCodingMapBlock (0x424D4345).
Definition erasure.h:51
uint8_t stripeGroupCount
Number of stripe groups in payload (typically 5).
Definition erasure.h:53
uint64_t length
Size in bytes of the uncompressed mapping payload.
Definition erasure.h:56
Per-data-block metadata within a stripe descriptor.
Definition erasure.h:88
uint32_t onDiskSize
Actual on-disk bytes (sizeof(header) + cmpLength).
Definition erasure.h:90
uint64_t offset
Absolute file offset of the block.
Definition erasure.h:89
uint64_t shardCrc64
CRC64-ECMA of on-disk bytes zero-padded to shardSize.
Definition erasure.h:91
Describes one protection group within the ECMB payload.
Definition erasure.h:69
uint32_t shardSize
Fixed shard size in bytes (max possible on-disk block size for this group).
Definition erasure.h:73
uint16_t K
Number of data blocks per stripe.
Definition erasure.h:71
uint8_t groupType
Protection group type (ErasureCodingGroupType).
Definition erasure.h:70
uint16_t interleaveDepth
Interleave depth D (K for full interleave, 1 for consecutive).
Definition erasure.h:75
uint32_t stripeCount
Number of stripes in this group.
Definition erasure.h:74
uint16_t M
Number of parity blocks per stripe.
Definition erasure.h:72
Per-parity-block metadata within a stripe descriptor.
Definition erasure.h:99
uint64_t offset
Absolute file offset of the parity DBLK.
Definition erasure.h:100