mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
269 lines
10 KiB
C#
269 lines
10 KiB
C#
namespace Aaru.Images;
|
|
|
|
public sealed partial class AaruFormat
|
|
{
|
|
#region Nested type: BlockType
|
|
|
|
/// <summary>List of known blocks types (libaaruformat is the reference, not this)</summary>
|
|
enum BlockType : uint
|
|
{
|
|
/// <summary>Block containing data</summary>
|
|
DataBlock = 0x4B4C4244,
|
|
/// <summary>Block containing a deduplication table</summary>
|
|
DeDuplicationTable = 0x2A544444,
|
|
/// <summary>Block containing the index</summary>
|
|
Index = 0x58444E49,
|
|
/// <summary>Block containing the index</summary>
|
|
Index2 = 0x32584449,
|
|
/// <summary>Block containing logical geometry</summary>
|
|
GeometryBlock = 0x4D4F4547,
|
|
/// <summary>Block containing metadata</summary>
|
|
MetadataBlock = 0x4154454D,
|
|
/// <summary>Block containing optical disc tracks</summary>
|
|
TracksBlock = 0x534B5254,
|
|
/// <summary>Block containing CICM XML metadata</summary>
|
|
CicmBlock = 0x4D434943,
|
|
/// <summary>Block containing contents checksums</summary>
|
|
ChecksumBlock = 0x4D534B43,
|
|
/// <summary>Block containing data position measurements</summary>
|
|
DataPositionMeasurementBlock = 0x2A4D5044,
|
|
/// <summary>Block containing a snapshot index</summary>
|
|
SnapshotBlock = 0x50414E53,
|
|
/// <summary>Block containing how to locate the parent image</summary>
|
|
ParentBlock = 0x544E5250,
|
|
/// <summary>Block containing an array of hardware used to create the image</summary>
|
|
DumpHardwareBlock = 0x2A504D44,
|
|
/// <summary>Block containing list of files for a tape image</summary>
|
|
TapeFileBlock = 0x454C4654,
|
|
/// <summary>Block containing list of partitions for a tape image</summary>
|
|
TapePartitionBlock = 0x54425054,
|
|
/// <summary>Block containing list of indexes for Compact Disc tracks</summary>
|
|
CompactDiscIndexesBlock = 0x58494443,
|
|
/// <summary>Block containing JSON version of Aaru Metadata</summary>
|
|
AaruMetadataJsonBlock = 0x444D534A
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Nested type: SectorStatus
|
|
|
|
enum SectorStatus : byte
|
|
{
|
|
/// <summary>
|
|
/// Sector(s) not yet acquired during image dumping.
|
|
/// </summary>
|
|
NotDumped = 0x0,
|
|
/// <summary>
|
|
/// Sector(s) successfully dumped without error.
|
|
/// </summary>
|
|
Dumped = 0x1,
|
|
/// <summary>
|
|
/// Error during dumping; data may be incomplete or corrupt.
|
|
/// </summary>
|
|
Errored = 0x2,
|
|
/// <summary>
|
|
/// Valid MODE 1 data with regenerable suffix/prefix.
|
|
/// </summary>
|
|
Mode1Correct = 0x3,
|
|
/// <summary>
|
|
/// Suffix verified/regenerable for MODE 2 Form 1.
|
|
/// </summary>
|
|
Mode2Form1Ok = 0x4,
|
|
/// <summary>
|
|
/// Suffix matches MODE 2 Form 2 with valid CRC.
|
|
/// </summary>
|
|
Mode2Form2Ok = 0x5,
|
|
/// <summary>
|
|
/// Suffix matches MODE 2 Form 2 but CRC empty/missing.
|
|
/// </summary>
|
|
Mode2Form2NoCrc = 0x6,
|
|
/// <summary>
|
|
/// Pointer references a twin sector table.
|
|
/// </summary>
|
|
Twin = 0x7,
|
|
/// <summary>
|
|
/// Sector physically unrecorded; repeated reads non-deterministic.
|
|
/// </summary>
|
|
Unrecorded = 0x8,
|
|
/// <summary>
|
|
/// Content encrypted and stored encrypted in image.
|
|
/// </summary>
|
|
Encrypted = 0x9,
|
|
/// <summary>
|
|
/// Content originally encrypted but stored decrypted in image.
|
|
/// </summary>
|
|
Unencrypted = 0xA
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Nested type: Status
|
|
|
|
/// <summary>
|
|
/// <para>Ok = 0</para>
|
|
/// </summary>
|
|
enum Status
|
|
{
|
|
/// <summary>
|
|
/// Ok.
|
|
/// </summary>
|
|
Ok = 0,
|
|
/// <summary>
|
|
/// Sector has not been dumped.
|
|
/// <remarks>AARUF_STATUS_SECTOR_NOT_DUMPED</remarks>
|
|
/// </summary>
|
|
SectorNotDumped = 1,
|
|
/// <summary>
|
|
/// Input file/stream failed magic or structural validation.
|
|
/// <remarks>AARUF_ERROR_NOT_AARUFORMAT</remarks>
|
|
/// </summary>
|
|
NotAaruFormat = -1,
|
|
/// <summary>
|
|
/// File size insufficient for mandatory header / structures.
|
|
/// <remarks>AARUF_ERROR_FILE_TOO_SMALL</remarks>
|
|
/// </summary>
|
|
FileTooSmall = -2,
|
|
/// <summary>
|
|
/// Image uses a newer incompatible on-disk version.
|
|
/// <remarks>AARUF_ERROR_INCOMPATIBLE_VERSION</remarks>
|
|
/// </summary>
|
|
IncompatibleVersion = -3,
|
|
/// <summary>
|
|
/// Index block unreadable / truncated / bad identifier.
|
|
/// <remarks>AARUF_ERROR_CANNOT_READ_INDEX</remarks>
|
|
/// </summary>
|
|
CannotReadIndex = -4,
|
|
/// <summary>
|
|
/// Requested logical sector outside media bounds.
|
|
/// <remarks>AARUF_ERROR_SECTOR_OUT_OF_BOUNDS</remarks>
|
|
/// </summary>
|
|
SectorOutOfBounds = -5,
|
|
/// <summary>
|
|
/// Failed to read container header.
|
|
/// <remarks>AARUF_ERROR_CANNOT_READ_HEADER</remarks>
|
|
/// </summary>
|
|
CannotReadHeader = -6,
|
|
/// <summary>
|
|
/// Generic block read failure (seek/read error).
|
|
/// <remarks>AARUF_ERROR_CANNOT_READ_BLOCK</remarks>
|
|
/// </summary>
|
|
CannotReadBlock = -7,
|
|
/// <summary>
|
|
/// Block marked with unsupported compression algorithm.
|
|
/// <remarks>AARUF_ERROR_UNSUPPORTED_COMPRESSION</remarks>
|
|
/// </summary>
|
|
UnsupportedCompression = -8,
|
|
/// <summary>
|
|
/// Memory allocation failure (critical).
|
|
/// <remarks>AARUF_ERROR_NOT_ENOUGH_MEMORY</remarks>
|
|
/// </summary>
|
|
NotEnoughMemory = -9,
|
|
/// <summary>
|
|
/// Caller-supplied buffer insufficient for data.
|
|
/// <remarks>AARUF_ERROR_BUFFER_TOO_SMALL</remarks>
|
|
/// </summary>
|
|
BufferTooSmall = -10,
|
|
/// <summary>
|
|
/// Requested media tag absent.
|
|
/// <remarks>AARUF_ERROR_MEDIA_TAG_NOT_PRESENT</remarks>
|
|
/// </summary>
|
|
MediaTagNotPresent = -11,
|
|
/// <summary>
|
|
/// Operation incompatible with image media type.
|
|
/// <remarks>AARUF_ERROR_INCORRECT_MEDIA_TYPE</remarks>
|
|
/// </summary>
|
|
IncorrectMediaType = -12,
|
|
/// <summary>
|
|
/// Referenced track number not present.
|
|
/// <remarks>AARUF_ERROR_TRACK_NOT_FOUND</remarks>
|
|
/// </summary>
|
|
TrackNotFound = -13,
|
|
/// <summary>
|
|
/// Internal logic assertion hit unexpected path.
|
|
/// <remarks>AARUF_ERROR_REACHED_UNREACHABLE_CODE</remarks>
|
|
/// </summary>
|
|
ReachedUnreachableCode = -14,
|
|
/// <summary>
|
|
/// Track metadata internally inconsistent or malformed.
|
|
/// <remarks>AARUF_ERROR_INVALID_TRACK_FORMAT</remarks>
|
|
/// </summary>
|
|
InvalidTrackFormat = -15,
|
|
/// <summary>
|
|
/// Requested sector tag (e.g. subchannel/prefix) not stored.
|
|
/// <remarks>AARUF_ERROR_SECTOR_TAG_NOT_PRESENT</remarks>
|
|
/// </summary>
|
|
SectorTagNotPresent = -16,
|
|
/// <summary>
|
|
/// Decompression routine failed or size mismatch.
|
|
/// <remarks>AARUF_ERROR_CANNOT_DECOMPRESS_BLOCK</remarks>
|
|
/// </summary>
|
|
CannotDecompressBlock = -17,
|
|
/// <summary>
|
|
/// CRC64 mismatch indicating corruption.
|
|
/// <remarks>AARUF_ERROR_INVALID_BLOCK_CRC</remarks>
|
|
/// </summary>
|
|
InvalidBlockCrc = -18,
|
|
/// <summary>
|
|
/// Output file could not be created / opened for write.
|
|
/// <remarks>AARUF_ERROR_CANNOT_CREATE_FILE</remarks>
|
|
/// </summary>
|
|
CannotCreateFile = -19,
|
|
/// <summary>
|
|
/// Application name field length invalid (sanity limit).
|
|
/// <remarks>AARUF_ERROR_INVALID_APP_NAME_LENGTH</remarks>
|
|
/// </summary>
|
|
InvalidAppNameLength = -20,
|
|
/// <summary>
|
|
/// Failure writing container header.
|
|
/// <remarks>AARUF_ERROR_CANNOT_WRITE_HEADER</remarks>
|
|
/// </summary>
|
|
CannotWriteHeader = -21,
|
|
/// <summary>
|
|
/// Operation requires write mode but context is read-only.
|
|
/// <remarks>AARUF_READ_ONLY</remarks>
|
|
/// </summary>
|
|
ReadOnly = -22,
|
|
/// <summary>
|
|
/// Failure writing block header.
|
|
/// <remarks>AARUF_ERROR_CANNOT_WRITE_BLOCK_HEADER</remarks>
|
|
/// </summary>
|
|
CannotWriteBlockHeader = -23,
|
|
/// <summary>
|
|
/// Failure writing block payload.
|
|
/// <remarks>AARUF_ERROR_CANNOT_WRITE_BLOCK_DATA</remarks>
|
|
/// </summary>
|
|
CannotWriteBlockData = -24,
|
|
/// <summary>
|
|
/// Failed to encode/store a DDT entry (overflow or IO).
|
|
/// <remarks>AARUF_ERROR_CANNOT_SET_DDT_ENTRY</remarks>
|
|
/// </summary>
|
|
CannotSetDdtEntry = -25,
|
|
/// <summary>
|
|
/// Data size does not match expected size.
|
|
/// <remarks>AARUF_ERROR_INCORRECT_DATA_SIZE</remarks>
|
|
/// </summary>
|
|
IncorrectDataSize = -26,
|
|
/// <summary>
|
|
/// Invalid or unsupported media or sector tag format.
|
|
/// <remarks>AARUF_ERROR_INVALID_TAG</remarks>
|
|
/// </summary>
|
|
InvalidTag = -27,
|
|
/// <summary>
|
|
/// Requested tape file number not present in image.
|
|
/// <remarks>AARUF_ERROR_TAPE_FILE_NOT_FOUND</remarks>
|
|
/// </summary>
|
|
TapeFileNotFound = -28,
|
|
/// <summary>
|
|
/// Requested tape partition not present in image.
|
|
/// <remarks>AARUF_ERROR_TAPE_PARTITION_NOT_FOUND</remarks>
|
|
/// </summary>
|
|
TapePartitionNotFound = -29,
|
|
/// <summary>
|
|
/// Requested metadata not present in image.
|
|
/// <remarks>AARUF_ERROR_METADATA_NOT_PRESENT</remarks>
|
|
/// </summary>
|
|
MetadataNotPresent = -30
|
|
}
|
|
|
|
#endregion
|
|
} |