// /*************************************************************************** // Aaru Data Preservation Suite // ---------------------------------------------------------------------------- // // Filename : Structs.cs // Author(s) : Natalia Portillo // // Component : Random Block File 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-2025 Natalia Portillo // ****************************************************************************/ using System.Runtime.InteropServices; using Aaru.CommonTypes.Attributes; namespace Aaru.Filesystems; /// /// Implements detection of the Locus filesystem public sealed partial class RBF { #region Nested type: IdSector /// Identification sector. Wherever the sector this resides on, becomes LSN 0. [StructLayout(LayoutKind.Sequential, Pack = 1)] [SwapEndian] partial struct IdSector { /// Sectors on disk [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public byte[] dd_tot; /// Tracks public byte dd_tks; /// Bytes in allocation map public ushort dd_map; /// Sectors per cluster public ushort dd_bit; /// LSN of root directory [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public byte[] dd_dir; /// Owner ID public ushort dd_own; /// Attributes public byte dd_att; /// Disk ID public ushort dd_dsk; /// Format byte public byte dd_fmt; /// Sectors per track public ushort dd_spt; /// Reserved public ushort dd_res; /// LSN of boot file [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public byte[] dd_bt; /// Size of boot file public ushort dd_bsz; /// Creation date [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] public byte[] dd_dat; /// Volume name [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] public byte[] dd_nam; /// Path options [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] public byte[] dd_opt; /// Reserved public byte reserved; /// Magic number public uint dd_sync; /// LSN of allocation map public uint dd_maplsn; /// Size of an LSN public ushort dd_lsnsize; /// Version ID public ushort dd_versid; } #endregion #region Nested type: NewIdSector /// /// Identification sector. Wherever the sector this resides on, becomes LSN 0. Introduced on OS-9000, this can be /// big or little endian. /// [StructLayout(LayoutKind.Sequential, Pack = 1)] [SwapEndian] partial struct NewIdSector { /// Magic number public uint rid_sync; /// Disk ID public uint rid_diskid; /// Sectors on disk public uint rid_totblocks; /// Cylinders public ushort rid_cylinders; /// Sectors in cylinder 0 public ushort rid_cyl0size; /// Sectors per cylinder public ushort rid_cylsize; /// Heads public ushort rid_heads; /// Bytes per sector public ushort rid_blocksize; /// Disk format public ushort rid_format; /// Flags public ushort rid_flags; /// Padding public ushort rid_unused1; /// Sector of allocation bitmap public uint rid_bitmap; /// Sector of debugger FD public uint rid_firstboot; /// Sector of bootfile FD public uint rid_bootfile; /// Sector of root directory FD public uint rid_rootdir; /// Group owner of media public ushort rid_group; /// Owner of media public ushort rid_owner; /// Creation time public uint rid_ctime; /// Last write time for this structure public uint rid_mtime; /// Volume name [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] public byte[] rid_name; /// Endian flag public byte rid_endflag; /// Padding [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public byte[] rid_unused2; /// Parity public uint rid_parity; } #endregion }