// /*************************************************************************** // Aaru Data Preservation Suite // ---------------------------------------------------------------------------- // // Filename : Structs.cs // Author(s) : Natalia Portillo // // Component : Fossil filesystem plugin // // --[ 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 . // // ---------------------------------------------------------------------------- // Copyright © 2011-2024 Natalia Portillo // ****************************************************************************/ using System.Runtime.InteropServices; namespace Aaru.Filesystems; /// /// Implements detection for the Plan-9 Fossil on-disk filesystem public sealed partial class Fossil { #region Nested type: Header [StructLayout(LayoutKind.Sequential, Pack = 1)] readonly struct Header { /// Magic number public readonly uint magic; /// Header version public readonly ushort version; /// Block size public readonly ushort blockSize; /// Block containing superblock public readonly uint super; /// Block containing labels public readonly uint label; /// Where do data blocks start public readonly uint data; /// How many data blocks does it have public readonly uint end; } #endregion #region Nested type: SuperBlock [StructLayout(LayoutKind.Sequential, Pack = 1)] readonly struct SuperBlock { /// Magic number public readonly uint magic; /// Header version public readonly ushort version; /// file system low epoch public readonly uint epochLow; /// file system high(active) epoch public readonly uint epochHigh; /// next qid to allocate public readonly ulong qid; /// data block number: root of active file system public readonly int active; /// data block number: root of next file system to archive public readonly int next; /// data block number: root of file system currently being archived public readonly int current; /// Venti score of last successful archive [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)] public readonly byte[] last; /// name of file system(just a comment) [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] public readonly byte[] name; } #endregion }