libaaruformat
1.0
Aaru Data Preservation Suite - Format Library
Toggle main menu visibility
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
49
typedef
struct
ErasureCodingMapHeader
50
{
51
uint32_t
identifier
;
52
uint8_t
algorithm
;
53
uint8_t
stripeGroupCount
;
54
uint16_t
compression
;
55
uint64_t
cmpLength
;
56
uint64_t
length
;
57
uint64_t
cmpCrc64
;
58
uint64_t
crc64
;
59
}
ErasureCodingMapHeader
;
60
68
typedef
struct
StripeGroupDescriptor
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
;
76
}
StripeGroupDescriptor
;
77
87
typedef
struct
StripeDataBlockEntry
88
{
89
uint64_t
offset
;
90
uint32_t
onDiskSize
;
91
uint64_t
shardCrc64
;
92
}
StripeDataBlockEntry
;
93
98
typedef
struct
StripeParityBlockEntry
99
{
100
uint64_t
offset
;
101
}
StripeParityBlockEntry
;
102
116
typedef
struct
AaruRecoveryFooter
117
{
118
uint64_t
ecmbOffset
;
119
uint64_t
ecmbLength
;
120
uint64_t
headerCrc64
;
121
AaruHeaderV2
backupHeader
;
122
uint64_t
footerMagic
;
123
}
AaruRecoveryFooter
;
124
125
#pragma pack(pop)
126
127
#endif
/* LIBAARUFORMAT_ERASURE_H */
AaruHeaderV2
Version 2 container header with GUID, alignment shifts, and feature negotiation bitmaps.
Definition
header.h:107
AaruRecoveryFooter
Recovery footer written at the very end of the file (last 160 bytes).
Definition
erasure.h:117
AaruRecoveryFooter::headerCrc64
uint64_t headerCrc64
CRC64-ECMA of the original AaruHeaderV2 (147 bytes at offset 0).
Definition
erasure.h:120
AaruRecoveryFooter::ecmbOffset
uint64_t ecmbOffset
Absolute file offset of the primary ECMB.
Definition
erasure.h:118
AaruRecoveryFooter::footerMagic
uint64_t footerMagic
Must be AARU_RECOVERY_FOOTER_MAGIC (0x52464D4345525641).
Definition
erasure.h:122
AaruRecoveryFooter::ecmbLength
uint64_t ecmbLength
Total on-disk size of the ECMB (header + payload).
Definition
erasure.h:119
AaruRecoveryFooter::backupHeader
AaruHeaderV2 backupHeader
Complete copy of AaruHeaderV2 from file offset 0.
Definition
erasure.h:121
ErasureCodingMapHeader
Header for the Erasure Coding Map Block (BlockType::ErasureCodingMapBlock).
Definition
erasure.h:50
ErasureCodingMapHeader::algorithm
uint8_t algorithm
Erasure coding algorithm (ErasureCodingAlgorithm).
Definition
erasure.h:52
ErasureCodingMapHeader::cmpLength
uint64_t cmpLength
Size in bytes of the compressed mapping payload.
Definition
erasure.h:55
ErasureCodingMapHeader::cmpCrc64
uint64_t cmpCrc64
CRC64-ECMA of the compressed mapping payload.
Definition
erasure.h:57
ErasureCodingMapHeader::crc64
uint64_t crc64
CRC64-ECMA of the uncompressed mapping payload.
Definition
erasure.h:58
ErasureCodingMapHeader::compression
uint16_t compression
Compression algorithm for the mapping payload (CompressionType).
Definition
erasure.h:54
ErasureCodingMapHeader::identifier
uint32_t identifier
Block identifier, must be BlockType::ErasureCodingMapBlock (0x424D4345).
Definition
erasure.h:51
ErasureCodingMapHeader::stripeGroupCount
uint8_t stripeGroupCount
Number of stripe groups in payload (typically 5).
Definition
erasure.h:53
ErasureCodingMapHeader::length
uint64_t length
Size in bytes of the uncompressed mapping payload.
Definition
erasure.h:56
StripeDataBlockEntry
Per-data-block metadata within a stripe descriptor.
Definition
erasure.h:88
StripeDataBlockEntry::onDiskSize
uint32_t onDiskSize
Actual on-disk bytes (sizeof(header) + cmpLength).
Definition
erasure.h:90
StripeDataBlockEntry::offset
uint64_t offset
Absolute file offset of the block.
Definition
erasure.h:89
StripeDataBlockEntry::shardCrc64
uint64_t shardCrc64
CRC64-ECMA of on-disk bytes zero-padded to shardSize.
Definition
erasure.h:91
StripeGroupDescriptor
Describes one protection group within the ECMB payload.
Definition
erasure.h:69
StripeGroupDescriptor::shardSize
uint32_t shardSize
Fixed shard size in bytes (max possible on-disk block size for this group).
Definition
erasure.h:73
StripeGroupDescriptor::K
uint16_t K
Number of data blocks per stripe.
Definition
erasure.h:71
StripeGroupDescriptor::groupType
uint8_t groupType
Protection group type (ErasureCodingGroupType).
Definition
erasure.h:70
StripeGroupDescriptor::interleaveDepth
uint16_t interleaveDepth
Interleave depth D (K for full interleave, 1 for consecutive).
Definition
erasure.h:75
StripeGroupDescriptor::stripeCount
uint32_t stripeCount
Number of stripes in this group.
Definition
erasure.h:74
StripeGroupDescriptor::M
uint16_t M
Number of parity blocks per stripe.
Definition
erasure.h:72
StripeParityBlockEntry
Per-parity-block metadata within a stripe descriptor.
Definition
erasure.h:99
StripeParityBlockEntry::offset
uint64_t offset
Absolute file offset of the parity DBLK.
Definition
erasure.h:100
include
aaruformat
structs
erasure.h
Generated by
1.18.0