mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Refactor image classes and split them to smaller files.
This commit is contained in:
106
DiscImageChef.DiscImages/QCOW2/Structs.cs
Normal file
106
DiscImageChef.DiscImages/QCOW2/Structs.cs
Normal file
@@ -0,0 +1,106 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Structs.cs
|
||||
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
||||
//
|
||||
// Component : Disk image plugins.
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Contains structures for QEMU Copy-On-Write v2 disk images.
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// 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/>.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright © 2011-2018 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace DiscImageChef.DiscImages
|
||||
{
|
||||
public partial class Qcow2
|
||||
{
|
||||
/// <summary>
|
||||
/// QCOW header, big-endian
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
struct QCow2Header
|
||||
{
|
||||
/// <summary>
|
||||
/// <see cref="Qcow2.QCOW_MAGIC" />
|
||||
/// </summary>
|
||||
public uint magic;
|
||||
/// <summary>
|
||||
/// Must be 1
|
||||
/// </summary>
|
||||
public uint version;
|
||||
/// <summary>
|
||||
/// Offset inside file to string containing backing file
|
||||
/// </summary>
|
||||
public ulong backing_file_offset;
|
||||
/// <summary>
|
||||
/// Size of <see cref="backing_file_offset" />
|
||||
/// </summary>
|
||||
public uint backing_file_size;
|
||||
/// <summary>
|
||||
/// Cluster bits
|
||||
/// </summary>
|
||||
public uint cluster_bits;
|
||||
/// <summary>
|
||||
/// Size in bytes
|
||||
/// </summary>
|
||||
public ulong size;
|
||||
/// <summary>
|
||||
/// Encryption method
|
||||
/// </summary>
|
||||
public uint crypt_method;
|
||||
/// <summary>
|
||||
/// Size of L1 table
|
||||
/// </summary>
|
||||
public uint l1_size;
|
||||
/// <summary>
|
||||
/// Offset to L1 table
|
||||
/// </summary>
|
||||
public ulong l1_table_offset;
|
||||
/// <summary>
|
||||
/// Offset to reference count table
|
||||
/// </summary>
|
||||
public ulong refcount_table_offset;
|
||||
/// <summary>
|
||||
/// How many clusters does the refcount table span
|
||||
/// </summary>
|
||||
public uint refcount_table_clusters;
|
||||
/// <summary>
|
||||
/// Number of snapshots
|
||||
/// </summary>
|
||||
public uint nb_snapshots;
|
||||
/// <summary>
|
||||
/// Offset to QCowSnapshotHeader
|
||||
/// </summary>
|
||||
public ulong snapshots_offset;
|
||||
|
||||
// Added in version 3
|
||||
public ulong features;
|
||||
public ulong compat_features;
|
||||
public ulong autoclear_features;
|
||||
public uint refcount_order;
|
||||
public uint header_length;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user