mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
General code refactor.
This commit is contained in:
@@ -38,38 +38,22 @@
|
|||||||
|
|
||||||
namespace Aaru.CommonTypes.Enums
|
namespace Aaru.CommonTypes.Enums
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Device types</summary>
|
||||||
/// Device types
|
|
||||||
/// </summary>
|
|
||||||
public enum DeviceType
|
public enum DeviceType
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Unknown device type</summary>
|
||||||
/// Unknown device type
|
|
||||||
/// </summary>
|
|
||||||
Unknown = -1,
|
Unknown = -1,
|
||||||
/// <summary>
|
/// <summary>ATA device</summary>
|
||||||
/// ATA device
|
|
||||||
/// </summary>
|
|
||||||
ATA = 1,
|
ATA = 1,
|
||||||
/// <summary>
|
/// <summary>ATA Packet device (aka SCSI over ATA)</summary>
|
||||||
/// ATA Packet device (aka SCSI over ATA)
|
|
||||||
/// </summary>
|
|
||||||
ATAPI = 2,
|
ATAPI = 2,
|
||||||
/// <summary>
|
/// <summary>SCSI device (or USB-MSC, SBP2, FC, UAS, etc)</summary>
|
||||||
/// SCSI device (or USB-MSC, SBP2, FC, UAS, etc)
|
|
||||||
/// </summary>
|
|
||||||
SCSI = 3,
|
SCSI = 3,
|
||||||
/// <summary>
|
/// <summary>SecureDigital memory card</summary>
|
||||||
/// SecureDigital memory card
|
|
||||||
/// </summary>
|
|
||||||
SecureDigital = 4,
|
SecureDigital = 4,
|
||||||
/// <summary>
|
/// <summary>MultiMediaCard memory card</summary>
|
||||||
/// MultiMediaCard memory card
|
|
||||||
/// </summary>
|
|
||||||
MMC = 5,
|
MMC = 5,
|
||||||
/// <summary>
|
/// <summary>NVMe device</summary>
|
||||||
/// NVMe device
|
|
||||||
/// </summary>
|
|
||||||
NVMe = 6
|
NVMe = 6
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -321,9 +321,7 @@ namespace Aaru.CommonTypes.Enums
|
|||||||
NotFound = 0x40
|
NotFound = 0x40
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Types of floppy disks</summary>
|
||||||
/// Types of floppy disks
|
|
||||||
/// </summary>
|
|
||||||
public enum FloppyTypes : byte
|
public enum FloppyTypes : byte
|
||||||
{
|
{
|
||||||
/// <summary>8" floppy</summary>
|
/// <summary>8" floppy</summary>
|
||||||
@@ -340,9 +338,7 @@ namespace Aaru.CommonTypes.Enums
|
|||||||
QuickDisk
|
QuickDisk
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Enumeration of floppy densities</summary>
|
||||||
/// Enumeration of floppy densities
|
|
||||||
/// </summary>
|
|
||||||
public enum FloppyDensities : byte
|
public enum FloppyDensities : byte
|
||||||
{
|
{
|
||||||
/// <summary>Standard coercivity (about 300Oe as found in 8" and 5.25"-double-density disks).</summary>
|
/// <summary>Standard coercivity (about 300Oe as found in 8" and 5.25"-double-density disks).</summary>
|
||||||
@@ -355,76 +351,43 @@ namespace Aaru.CommonTypes.Enums
|
|||||||
Extended
|
Extended
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Capabilities for optical media image formats</summary>
|
||||||
/// Capabilities for optical media image formats
|
|
||||||
/// </summary>
|
|
||||||
[Flags]
|
[Flags]
|
||||||
public enum OpticalImageCapabilities : ulong
|
public enum OpticalImageCapabilities : ulong
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Can store Red Book audio tracks?</summary>
|
||||||
/// Can store Red Book audio tracks?
|
|
||||||
/// </summary>
|
|
||||||
CanStoreAudioTracks = 0x01,
|
CanStoreAudioTracks = 0x01,
|
||||||
/// <summary>
|
/// <summary>Can store CD-V analogue video tracks?</summary>
|
||||||
/// Can store CD-V analogue video tracks?
|
|
||||||
/// </summary>
|
|
||||||
CanStoreVideoTracks = 0x02,
|
CanStoreVideoTracks = 0x02,
|
||||||
/// <summary>
|
/// <summary>Can store Yellow Book data tracks?</summary>
|
||||||
/// Can store Yellow Book data tracks?
|
|
||||||
/// </summary>
|
|
||||||
CanStoreDataTracks = 0x03,
|
CanStoreDataTracks = 0x03,
|
||||||
/// <summary>
|
/// <summary>Can store pregaps without needing to interpret the subchannel?</summary>
|
||||||
/// Can store pregaps without needing to interpret the subchannel?
|
|
||||||
/// </summary>
|
|
||||||
CanStorePregaps = 0x04,
|
CanStorePregaps = 0x04,
|
||||||
/// <summary>
|
/// <summary>Can store indexes without needing to interpret the subchannel?</summary>
|
||||||
/// Can store indexes without needing to interpret the subchannel?
|
|
||||||
/// </summary>
|
|
||||||
CanStoreIndexes = 0x08,
|
CanStoreIndexes = 0x08,
|
||||||
/// <summary>
|
/// <summary>Can store raw P to W subchannel data?</summary>
|
||||||
/// Can store raw P to W subchannel data?
|
|
||||||
/// </summary>
|
|
||||||
CanStoreSubchannelRw = 0x10,
|
CanStoreSubchannelRw = 0x10,
|
||||||
/// <summary>
|
/// <summary>Can store more than one session?</summary>
|
||||||
/// Can store more than one session?
|
|
||||||
/// </summary>
|
|
||||||
CanStoreSessions = 0x20,
|
CanStoreSessions = 0x20,
|
||||||
/// <summary>
|
/// <summary>Can store track ISRCs without needing to interpret the subchannel?</summary>
|
||||||
/// Can store track ISRCs without needing to interpret the subchannel?
|
|
||||||
/// </summary>
|
|
||||||
CanStoreIsrc = 0x40,
|
CanStoreIsrc = 0x40,
|
||||||
/// <summary>
|
/// <summary>Can store Lead-In's CD-TEXT?</summary>
|
||||||
/// Can store Lead-In's CD-TEXT?
|
|
||||||
/// </summary>
|
|
||||||
CanStoreCdText = 0x80,
|
CanStoreCdText = 0x80,
|
||||||
/// <summary>
|
/// <summary>Can store the MCN without needing to interpret the subchannel?</summary>
|
||||||
/// Can store the MCN without needing to interpret the subchannel?
|
|
||||||
/// </summary>
|
|
||||||
CanStoreMcn = 0x100,
|
CanStoreMcn = 0x100,
|
||||||
/// <summary>
|
/// <summary>Can store the whole 2352 bytes of a sector?</summary>
|
||||||
/// Can store the whole 2352 bytes of a sector?
|
|
||||||
/// </summary>
|
|
||||||
CanStoreRawData = 0x200,
|
CanStoreRawData = 0x200,
|
||||||
/// <summary>
|
/// <summary>Can store more than 1 session in media that is not CD based (DVD et al)?</summary>
|
||||||
/// Can store more than 1 session in media that is not CD based (DVD et al)?
|
|
||||||
/// </summary>
|
|
||||||
CanStoreNotCdSessions = 0x2000,
|
CanStoreNotCdSessions = 0x2000,
|
||||||
/// <summary>
|
/// <summary>Can store more than 1 track in media that is not CD based (DVD et al)?</summary>
|
||||||
/// Can store more than 1 track in media that is not CD based (DVD et al)?
|
|
||||||
/// </summary>
|
|
||||||
CanStoreNotCdTracks = 0x4000,
|
CanStoreNotCdTracks = 0x4000,
|
||||||
|
|
||||||
// TODO: Implement
|
// TODO: Implement
|
||||||
/// <summary>
|
/// <summary>Can store scrambled data?</summary>
|
||||||
/// Can store scrambled data?
|
|
||||||
/// </summary>
|
|
||||||
CanStoreScrambledData = 0x400,
|
CanStoreScrambledData = 0x400,
|
||||||
/// <summary>
|
/// <summary>Can store only the user area of a sector (2048, 2324, etc)?</summary>
|
||||||
/// Can store only the user area of a sector (2048, 2324, etc)?
|
|
||||||
/// </summary>
|
|
||||||
CanStoreCookedData = 0x800,
|
CanStoreCookedData = 0x800,
|
||||||
/// <summary>
|
/// <summary>Can store more than 1 track?</summary>
|
||||||
/// Can store more than 1 track?
|
|
||||||
/// </summary>
|
|
||||||
CanStoreMultipleTracks = 0x1000
|
CanStoreMultipleTracks = 0x1000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -149,7 +149,7 @@ namespace Aaru.CommonTypes.Extents
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Checks if the specified item is contained by an extent on this instance</summary>
|
/// <summary>Checks if the specified item is contained by an extent on this instance</summary>
|
||||||
/// <param name="item">Item to seach for</param>
|
/// <param name="item">Item to search for</param>
|
||||||
/// <returns><c>true</c> if any of the extents on this instance contains the item</returns>
|
/// <returns><c>true</c> if any of the extents on this instance contains the item</returns>
|
||||||
public bool Contains(byte item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
|
public bool Contains(byte item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
|
||||||
|
|
||||||
|
|||||||
@@ -43,14 +43,10 @@ using Schemas;
|
|||||||
|
|
||||||
namespace Aaru.CommonTypes.Extents
|
namespace Aaru.CommonTypes.Extents
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Converts extents</summary>
|
||||||
/// Converts extents
|
|
||||||
/// </summary>
|
|
||||||
public static class ExtentsConverter
|
public static class ExtentsConverter
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Converts unsigned long integer extents into XML based extents</summary>
|
||||||
/// Converts unsigned long integer extents into XML based extents
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="extents">Extents</param>
|
/// <param name="extents">Extents</param>
|
||||||
/// <returns>XML based extents</returns>
|
/// <returns>XML based extents</returns>
|
||||||
public static ExtentType[] ToMetadata(ExtentsULong extents)
|
public static ExtentType[] ToMetadata(ExtentsULong extents)
|
||||||
@@ -71,9 +67,7 @@ namespace Aaru.CommonTypes.Extents
|
|||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Converts XML based extents into unsigned long integer extents</summary>
|
||||||
/// Converts XML based extents into unsigned long integer extents
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="extents">XML based extents</param>
|
/// <param name="extents">XML based extents</param>
|
||||||
/// <returns>Extents</returns>
|
/// <returns>Extents</returns>
|
||||||
public static ExtentsULong FromMetadata(ExtentType[] extents)
|
public static ExtentsULong FromMetadata(ExtentType[] extents)
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ namespace Aaru.CommonTypes.Extents
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Checks if the specified item is contained by an extent on this instance</summary>
|
/// <summary>Checks if the specified item is contained by an extent on this instance</summary>
|
||||||
/// <param name="item">Item to seach for</param>
|
/// <param name="item">Item to search for</param>
|
||||||
/// <returns><c>true</c> if any of the extents on this instance contains the item</returns>
|
/// <returns><c>true</c> if any of the extents on this instance contains the item</returns>
|
||||||
public bool Contains(int item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
|
public bool Contains(int item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
|
||||||
|
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ namespace Aaru.CommonTypes.Extents
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Checks if the specified item is contained by an extent on this instance</summary>
|
/// <summary>Checks if the specified item is contained by an extent on this instance</summary>
|
||||||
/// <param name="item">Item to seach for</param>
|
/// <param name="item">Item to search for</param>
|
||||||
/// <returns><c>true</c> if any of the extents on this instance contains the item</returns>
|
/// <returns><c>true</c> if any of the extents on this instance contains the item</returns>
|
||||||
public bool Contains(long item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
|
public bool Contains(long item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
|
||||||
|
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ namespace Aaru.CommonTypes.Extents
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Checks if the specified item is contained by an extent on this instance</summary>
|
/// <summary>Checks if the specified item is contained by an extent on this instance</summary>
|
||||||
/// <param name="item">Item to seach for</param>
|
/// <param name="item">Item to search for</param>
|
||||||
/// <returns><c>true</c> if any of the extents on this instance contains the item</returns>
|
/// <returns><c>true</c> if any of the extents on this instance contains the item</returns>
|
||||||
public bool Contains(sbyte item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
|
public bool Contains(sbyte item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
|
||||||
|
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ namespace Aaru.CommonTypes.Extents
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Checks if the specified item is contained by an extent on this instance</summary>
|
/// <summary>Checks if the specified item is contained by an extent on this instance</summary>
|
||||||
/// <param name="item">Item to seach for</param>
|
/// <param name="item">Item to search for</param>
|
||||||
/// <returns><c>true</c> if any of the extents on this instance contains the item</returns>
|
/// <returns><c>true</c> if any of the extents on this instance contains the item</returns>
|
||||||
public bool Contains(short item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
|
public bool Contains(short item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
|
||||||
|
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ namespace Aaru.CommonTypes.Extents
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Checks if the specified item is contained by an extent on this instance</summary>
|
/// <summary>Checks if the specified item is contained by an extent on this instance</summary>
|
||||||
/// <param name="item">Item to seach for</param>
|
/// <param name="item">Item to search for</param>
|
||||||
/// <returns><c>true</c> if any of the extents on this instance contains the item</returns>
|
/// <returns><c>true</c> if any of the extents on this instance contains the item</returns>
|
||||||
public bool Contains(uint item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
|
public bool Contains(uint item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
|
||||||
|
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ namespace Aaru.CommonTypes.Extents
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Checks if the specified item is contained by an extent on this instance</summary>
|
/// <summary>Checks if the specified item is contained by an extent on this instance</summary>
|
||||||
/// <param name="item">Item to seach for</param>
|
/// <param name="item">Item to search for</param>
|
||||||
/// <returns><c>true</c> if any of the extents on this instance contains the item</returns>
|
/// <returns><c>true</c> if any of the extents on this instance contains the item</returns>
|
||||||
public bool Contains(ulong item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
|
public bool Contains(ulong item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
|
||||||
|
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ namespace Aaru.CommonTypes.Extents
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>Checks if the specified item is contained by an extent on this instance</summary>
|
/// <summary>Checks if the specified item is contained by an extent on this instance</summary>
|
||||||
/// <param name="item">Item to seach for</param>
|
/// <param name="item">Item to search for</param>
|
||||||
/// <returns><c>true</c> if any of the extents on this instance contains the item</returns>
|
/// <returns><c>true</c> if any of the extents on this instance contains the item</returns>
|
||||||
public bool Contains(ushort item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
|
public bool Contains(ushort item) => _backend.Any(extent => item >= extent.Item1 && item <= extent.Item2);
|
||||||
|
|
||||||
|
|||||||
@@ -46,14 +46,10 @@ using Aaru.Console;
|
|||||||
|
|
||||||
namespace Aaru.CommonTypes
|
namespace Aaru.CommonTypes
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Manages the known filters</summary>
|
||||||
/// Manages the known filters
|
|
||||||
/// </summary>
|
|
||||||
public sealed class FiltersList
|
public sealed class FiltersList
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>List of known filters</summary>
|
||||||
/// List of known filters
|
|
||||||
/// </summary>
|
|
||||||
public readonly SortedDictionary<string, IFilter> Filters;
|
public readonly SortedDictionary<string, IFilter> Filters;
|
||||||
|
|
||||||
/// <summary>Fills the list of all known filters</summary>
|
/// <summary>Fills the list of all known filters</summary>
|
||||||
|
|||||||
16
Geometry.cs
16
Geometry.cs
@@ -40,14 +40,10 @@ using System.Linq;
|
|||||||
|
|
||||||
namespace Aaru.CommonTypes
|
namespace Aaru.CommonTypes
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Handles CHS geometries</summary>
|
||||||
/// Handles CHS geometries
|
|
||||||
/// </summary>
|
|
||||||
public static class Geometry
|
public static class Geometry
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>List of known disk geometries</summary>
|
||||||
/// List of known disk geometries
|
|
||||||
/// </summary>
|
|
||||||
public static readonly (ushort cylinders, byte heads, ushort sectorsPerTrack, uint bytesPerSector, MediaEncoding
|
public static readonly (ushort cylinders, byte heads, ushort sectorsPerTrack, uint bytesPerSector, MediaEncoding
|
||||||
encoding, bool variableSectorsPerTrack, MediaType type)[] KnownGeometries =
|
encoding, bool variableSectorsPerTrack, MediaType type)[] KnownGeometries =
|
||||||
{
|
{
|
||||||
@@ -122,9 +118,7 @@ namespace Aaru.CommonTypes
|
|||||||
(1024, 2, 32, 512, MediaEncoding.MFM, false, MediaType.FD32MB)
|
(1024, 2, 32, 512, MediaEncoding.MFM, false, MediaType.FD32MB)
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Gets the media type for a given geometry</summary>
|
||||||
/// Gets the media type for a given geometry
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="geometry">Geometry</param>
|
/// <param name="geometry">Geometry</param>
|
||||||
/// <returns>Media type</returns>
|
/// <returns>Media type</returns>
|
||||||
public static MediaType GetMediaType(
|
public static MediaType GetMediaType(
|
||||||
@@ -139,9 +133,7 @@ namespace Aaru.CommonTypes
|
|||||||
geometry.variableSectorsPerTrack select geom.type).
|
geometry.variableSectorsPerTrack select geom.type).
|
||||||
FirstOrDefault();
|
FirstOrDefault();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Gets the geometry for a given media type</summary>
|
||||||
/// Gets the geometry for a given media type
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="mediaType">Media type</param>
|
/// <param name="mediaType">Media type</param>
|
||||||
/// <returns>Geometry</returns>
|
/// <returns>Geometry</returns>
|
||||||
public static (ushort cylinders, byte heads, ushort sectorsPerTrack, uint bytesPerSector, MediaEncoding encoding
|
public static (ushort cylinders, byte heads, ushort sectorsPerTrack, uint bytesPerSector, MediaEncoding encoding
|
||||||
|
|||||||
@@ -39,9 +39,7 @@ using System.IO;
|
|||||||
|
|
||||||
namespace Aaru.CommonTypes.Interfaces
|
namespace Aaru.CommonTypes.Interfaces
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Supported archive features</summary>
|
||||||
/// Supported archive features
|
|
||||||
/// </summary>
|
|
||||||
[Flags]
|
[Flags]
|
||||||
public enum ArchiveSupportedFeature : uint
|
public enum ArchiveSupportedFeature : uint
|
||||||
{
|
{
|
||||||
@@ -71,9 +69,7 @@ namespace Aaru.CommonTypes.Interfaces
|
|||||||
SupportsXAttrs = 1 << 6
|
SupportsXAttrs = 1 << 6
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Defines the interface to handle an archive (e.g. ZIP, WAD, etc)</summary>
|
||||||
/// Defines the interface to handle an archive (e.g. ZIP, WAD, etc)
|
|
||||||
/// </summary>
|
|
||||||
public interface IArchive
|
public interface IArchive
|
||||||
{
|
{
|
||||||
/// <summary>Descriptive name of the plugin</summary>
|
/// <summary>Descriptive name of the plugin</summary>
|
||||||
|
|||||||
@@ -38,9 +38,7 @@
|
|||||||
|
|
||||||
namespace Aaru.CommonTypes.Interfaces
|
namespace Aaru.CommonTypes.Interfaces
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Defines the interface to implement a checksum or hashing algorithm</summary>
|
||||||
/// Defines the interface to implement a checksum or hashing algorithm
|
|
||||||
/// </summary>
|
|
||||||
public interface IChecksum
|
public interface IChecksum
|
||||||
{
|
{
|
||||||
/// <summary>Updates the hash with data.</summary>
|
/// <summary>Updates the hash with data.</summary>
|
||||||
|
|||||||
@@ -45,9 +45,7 @@ namespace Aaru.CommonTypes.Interfaces
|
|||||||
/// <summary>Interface to implement filesystem plugins.</summary>
|
/// <summary>Interface to implement filesystem plugins.</summary>
|
||||||
public interface IFilesystem
|
public interface IFilesystem
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Defines the encoding used to interpret strings in the filesystem</summary>
|
||||||
/// Defines the encoding used to interpret strings in the filesystem
|
|
||||||
/// </summary>
|
|
||||||
Encoding Encoding { get; }
|
Encoding Encoding { get; }
|
||||||
/// <summary>Plugin name.</summary>
|
/// <summary>Plugin name.</summary>
|
||||||
string Name { get; }
|
string Name { get; }
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ using System.IO;
|
|||||||
namespace Aaru.CommonTypes.Interfaces
|
namespace Aaru.CommonTypes.Interfaces
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Defines a filter, that is, a transformation of the data from a file, like, for example, a compressor (e.g. GZIP),
|
/// Defines a filter, that is, a transformation of the data from a file, like, for example, a compressor (e.g.
|
||||||
/// or a container (e.g. AppleDouble)
|
/// GZIP), or a container (e.g. AppleDouble)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IFilter
|
public interface IFilter
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -41,9 +41,7 @@ using System.Collections.Generic;
|
|||||||
|
|
||||||
namespace Aaru.CommonTypes.Interfaces
|
namespace Aaru.CommonTypes.Interfaces
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Defines an image that can contain partitions</summary>
|
||||||
/// Defines an image that can contain partitions
|
|
||||||
/// </summary>
|
|
||||||
public interface IPartitionableMediaImage
|
public interface IPartitionableMediaImage
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -41,9 +41,7 @@ using System.Collections.Generic;
|
|||||||
|
|
||||||
namespace Aaru.CommonTypes.Interfaces
|
namespace Aaru.CommonTypes.Interfaces
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Defines a register of all known plugins</summary>
|
||||||
/// Defines a register of all known plugins
|
|
||||||
/// </summary>
|
|
||||||
public interface IPluginRegister
|
public interface IPluginRegister
|
||||||
{
|
{
|
||||||
/// <summary>Gets all checksum plugins</summary>
|
/// <summary>Gets all checksum plugins</summary>
|
||||||
|
|||||||
@@ -45,17 +45,13 @@ using Aaru.CommonTypes.Structs;
|
|||||||
namespace Aaru.CommonTypes.Interfaces
|
namespace Aaru.CommonTypes.Interfaces
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
/// <summary>
|
/// <summary>Defines the interface to implement reading the contents of a filesystem</summary>
|
||||||
/// Defines the interface to implement reading the contents of a filesystem
|
|
||||||
/// </summary>
|
|
||||||
public interface IReadOnlyFilesystem : IFilesystem
|
public interface IReadOnlyFilesystem : IFilesystem
|
||||||
{
|
{
|
||||||
/// <summary>Retrieves a list of options supported by the filesystem, with name, type and description</summary>
|
/// <summary>Retrieves a list of options supported by the filesystem, with name, type and description</summary>
|
||||||
IEnumerable<(string name, Type type, string description)> SupportedOptions { get; }
|
IEnumerable<(string name, Type type, string description)> SupportedOptions { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Supported namespaces</summary>
|
||||||
/// Supported namespaces
|
|
||||||
/// </summary>
|
|
||||||
Dictionary<string, string> Namespaces { get; }
|
Dictionary<string, string> Namespaces { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -43,9 +43,7 @@ using Aaru.CommonTypes.Structs;
|
|||||||
namespace Aaru.CommonTypes.Interfaces
|
namespace Aaru.CommonTypes.Interfaces
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
/// <summary>
|
/// <summary>Defines an image that can store the information from streaming, digital, tapes</summary>
|
||||||
/// Defines an image that can store the information from streaming, digital, tapes
|
|
||||||
/// </summary>
|
|
||||||
public interface ITapeImage : IMediaImage
|
public interface ITapeImage : IMediaImage
|
||||||
{
|
{
|
||||||
/// <summary>Gets a list of all the files registered in the image</summary>
|
/// <summary>Gets a list of all the files registered in the image</summary>
|
||||||
|
|||||||
@@ -39,9 +39,7 @@
|
|||||||
|
|
||||||
namespace Aaru.CommonTypes.Interfaces
|
namespace Aaru.CommonTypes.Interfaces
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Defines an image that can verify the integrity of the image itself, but not its contents</summary>
|
||||||
/// Defines an image that can verify the integrity of the image itself, but not its contents
|
|
||||||
/// </summary>
|
|
||||||
public interface IVerifiableImage
|
public interface IVerifiableImage
|
||||||
{
|
{
|
||||||
/// <summary>Verifies media image internal checksum.</summary>
|
/// <summary>Verifies media image internal checksum.</summary>
|
||||||
|
|||||||
@@ -41,9 +41,7 @@ using System.Collections.Generic;
|
|||||||
|
|
||||||
namespace Aaru.CommonTypes.Interfaces
|
namespace Aaru.CommonTypes.Interfaces
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Defines an image that can verify the integrity of the sectors it contains</summary>
|
||||||
/// Defines an image that can verify the integrity of the sectors it contains
|
|
||||||
/// </summary>
|
|
||||||
public interface IVerifiableSectorsImage
|
public interface IVerifiableSectorsImage
|
||||||
{
|
{
|
||||||
/// <summary>Verifies a sector.</summary>
|
/// <summary>Verifies a sector.</summary>
|
||||||
|
|||||||
@@ -62,13 +62,9 @@ namespace Aaru.CommonTypes.Interfaces
|
|||||||
/// <summary>Gets a list of known extensions for format auto-choosing</summary>
|
/// <summary>Gets a list of known extensions for format auto-choosing</summary>
|
||||||
IEnumerable<string> KnownExtensions { get; }
|
IEnumerable<string> KnownExtensions { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>If set to <c>true</c> means the image is opened for writing</summary>
|
||||||
/// If set to <c>true</c> means the image is opened for writing
|
|
||||||
/// </summary>
|
|
||||||
bool IsWriting { get; }
|
bool IsWriting { get; }
|
||||||
/// <summary>
|
/// <summary>Contains a description of the last error</summary>
|
||||||
/// Contains a description of the last error
|
|
||||||
/// </summary>
|
|
||||||
string ErrorMessage { get; }
|
string ErrorMessage { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -42,14 +42,10 @@ using Aaru.CommonTypes.Structs;
|
|||||||
|
|
||||||
namespace Aaru.CommonTypes.Interfaces
|
namespace Aaru.CommonTypes.Interfaces
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Defines an image that is writable and can store an optical disc (CD, DVD, etc)</summary>
|
||||||
/// Defines an image that is writable and can store an optical disc (CD, DVD, etc)
|
|
||||||
/// </summary>
|
|
||||||
public interface IWritableOpticalImage : IWritableImage, IOpticalMediaImage
|
public interface IWritableOpticalImage : IWritableImage, IOpticalMediaImage
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Image format capabilities</summary>
|
||||||
/// Image format capabilities
|
|
||||||
/// </summary>
|
|
||||||
OpticalImageCapabilities OpticalCapabilities { get; }
|
OpticalImageCapabilities OpticalCapabilities { get; }
|
||||||
|
|
||||||
/// <summary>Sets tracks for optical media</summary>
|
/// <summary>Sets tracks for optical media</summary>
|
||||||
|
|||||||
@@ -41,9 +41,7 @@ using Aaru.CommonTypes.Structs;
|
|||||||
|
|
||||||
namespace Aaru.CommonTypes.Interfaces
|
namespace Aaru.CommonTypes.Interfaces
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Defines an image that is writable and can store information about a streaming, digital, tape</summary>
|
||||||
/// Defines an image that is writable and can store information about a streaming, digital, tape
|
|
||||||
/// </summary>
|
|
||||||
public interface IWritableTapeImage : ITapeImage, IWritableImage
|
public interface IWritableTapeImage : ITapeImage, IWritableImage
|
||||||
{
|
{
|
||||||
/// <summary>Registers a new file in the image</summary>
|
/// <summary>Registers a new file in the image</summary>
|
||||||
|
|||||||
@@ -44,29 +44,19 @@ using System.Security.Principal;
|
|||||||
|
|
||||||
namespace Aaru.CommonTypes.Interop
|
namespace Aaru.CommonTypes.Interop
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Detects the underlying execution framework and operating system</summary>
|
||||||
/// Detects the underlying execution framework and operating system
|
|
||||||
/// </summary>
|
|
||||||
public static class DetectOS
|
public static class DetectOS
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Are we running under Mono?</summary>
|
||||||
/// Are we running under Mono?
|
|
||||||
/// </summary>
|
|
||||||
public static readonly bool IsMono =
|
public static readonly bool IsMono =
|
||||||
RuntimeInformation.FrameworkDescription.StartsWith("Mono", StringComparison.Ordinal);
|
RuntimeInformation.FrameworkDescription.StartsWith("Mono", StringComparison.Ordinal);
|
||||||
/// <summary>
|
/// <summary>Are we running under .NET Framework?</summary>
|
||||||
/// Are we running under .NET Framework?
|
|
||||||
/// </summary>
|
|
||||||
public static readonly bool IsNetFramework =
|
public static readonly bool IsNetFramework =
|
||||||
RuntimeInformation.FrameworkDescription.StartsWith(".NET Framework", StringComparison.Ordinal);
|
RuntimeInformation.FrameworkDescription.StartsWith(".NET Framework", StringComparison.Ordinal);
|
||||||
/// <summary>
|
/// <summary>Are we running under .NET Core?</summary>
|
||||||
/// Are we running under .NET Core?
|
|
||||||
/// </summary>
|
|
||||||
public static readonly bool IsNetCore =
|
public static readonly bool IsNetCore =
|
||||||
RuntimeInformation.FrameworkDescription.StartsWith(".NET Core", StringComparison.Ordinal);
|
RuntimeInformation.FrameworkDescription.StartsWith(".NET Core", StringComparison.Ordinal);
|
||||||
/// <summary>
|
/// <summary>Are we running under .NET Native?</summary>
|
||||||
/// Are we running under .NET Native?
|
|
||||||
/// </summary>
|
|
||||||
public static readonly bool IsNetNative =
|
public static readonly bool IsNetNative =
|
||||||
RuntimeInformation.FrameworkDescription.StartsWith(".NET Native", StringComparison.Ordinal);
|
RuntimeInformation.FrameworkDescription.StartsWith(".NET Native", StringComparison.Ordinal);
|
||||||
|
|
||||||
@@ -76,9 +66,7 @@ namespace Aaru.CommonTypes.Interop
|
|||||||
/// <summary>Checks if the underlying runtime runs in 32-bit mode</summary>
|
/// <summary>Checks if the underlying runtime runs in 32-bit mode</summary>
|
||||||
public static readonly bool Is32Bit = IntPtr.Size == 4;
|
public static readonly bool Is32Bit = IntPtr.Size == 4;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Are we running under Windows?</summary>
|
||||||
/// Are we running under Windows?
|
|
||||||
/// </summary>
|
|
||||||
public static bool IsWindows => GetRealPlatformID() == PlatformID.Win32NT ||
|
public static bool IsWindows => GetRealPlatformID() == PlatformID.Win32NT ||
|
||||||
GetRealPlatformID() == PlatformID.Win32S ||
|
GetRealPlatformID() == PlatformID.Win32S ||
|
||||||
GetRealPlatformID() == PlatformID.Win32Windows ||
|
GetRealPlatformID() == PlatformID.Win32Windows ||
|
||||||
@@ -86,9 +74,7 @@ namespace Aaru.CommonTypes.Interop
|
|||||||
GetRealPlatformID() == PlatformID.WindowsPhone ||
|
GetRealPlatformID() == PlatformID.WindowsPhone ||
|
||||||
GetRealPlatformID() == PlatformID.Xbox;
|
GetRealPlatformID() == PlatformID.Xbox;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Are we running with administrative (root) privileges?</summary>
|
||||||
/// Are we running with administrative (root) privileges?
|
|
||||||
/// </summary>
|
|
||||||
public static bool IsAdmin
|
public static bool IsAdmin
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|||||||
@@ -42,18 +42,14 @@ using System.Runtime;
|
|||||||
|
|
||||||
namespace Aaru.CommonTypes.Interop
|
namespace Aaru.CommonTypes.Interop
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Gets our own, or the runtime's version</summary>
|
||||||
/// Gets our own, or the runtime's version
|
|
||||||
/// </summary>
|
|
||||||
public static class Version
|
public static class Version
|
||||||
{
|
{
|
||||||
/// <summary>Gets version string</summary>
|
/// <summary>Gets version string</summary>
|
||||||
/// <returns>Version</returns>
|
/// <returns>Version</returns>
|
||||||
public static string GetVersion() => typeof(Version).Assembly.GetName().Version?.ToString();
|
public static string GetVersion() => typeof(Version).Assembly.GetName().Version?.ToString();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Gets .NET Core version</summary>
|
||||||
/// Gets .NET Core version
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>Version</returns>
|
/// <returns>Version</returns>
|
||||||
public static string GetNetCoreVersion()
|
public static string GetNetCoreVersion()
|
||||||
{
|
{
|
||||||
@@ -76,9 +72,7 @@ namespace Aaru.CommonTypes.Interop
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Gets Mono version</summary>
|
||||||
/// Gets Mono version
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>Version</returns>
|
/// <returns>Version</returns>
|
||||||
public static string GetMonoVersion()
|
public static string GetMonoVersion()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -40,6 +40,7 @@
|
|||||||
// TODO: Rename contents
|
// TODO: Rename contents
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
#pragma warning disable 1591
|
#pragma warning disable 1591
|
||||||
|
|
||||||
// ReSharper disable UnusedMember.Global
|
// ReSharper disable UnusedMember.Global
|
||||||
|
|||||||
@@ -38,9 +38,7 @@ namespace Aaru.CommonTypes
|
|||||||
{
|
{
|
||||||
public static partial class MediaTypeFromDevice
|
public static partial class MediaTypeFromDevice
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Gets the media type from an ATA (not ATAPI) device</summary>
|
||||||
/// Gets the media type from an ATA (not ATAPI) device
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="manufacturer">Manufacturer string</param>
|
/// <param name="manufacturer">Manufacturer string</param>
|
||||||
/// <param name="model">Model string</param>
|
/// <param name="model">Model string</param>
|
||||||
/// <param name="removable">Is the device removable?</param>
|
/// <param name="removable">Is the device removable?</param>
|
||||||
|
|||||||
@@ -37,14 +37,10 @@ using Aaru.Console;
|
|||||||
|
|
||||||
namespace Aaru.CommonTypes
|
namespace Aaru.CommonTypes
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Gets the media type from a real device</summary>
|
||||||
/// Gets the media type from a real device
|
|
||||||
/// </summary>
|
|
||||||
public static partial class MediaTypeFromDevice
|
public static partial class MediaTypeFromDevice
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Gets the media type from an SCSI MultiMedia Commands compliant device</summary>
|
||||||
/// Gets the media type from an SCSI MultiMedia Commands compliant device
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="model">Model string</param>
|
/// <param name="model">Model string</param>
|
||||||
/// <param name="mediumType">Medium type from MODE SENSE</param>
|
/// <param name="mediumType">Medium type from MODE SENSE</param>
|
||||||
/// <param name="densityCode">Density code from MODE SENSE</param>
|
/// <param name="densityCode">Density code from MODE SENSE</param>
|
||||||
|
|||||||
@@ -38,9 +38,7 @@ namespace Aaru.CommonTypes
|
|||||||
{
|
{
|
||||||
public static partial class MediaTypeFromDevice
|
public static partial class MediaTypeFromDevice
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Gets the device type from a SCSI Optical Device</summary>
|
||||||
/// Gets the device type from a SCSI Optical Device
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="mediumType">Medium type from MODE SENSE</param>
|
/// <param name="mediumType">Medium type from MODE SENSE</param>
|
||||||
/// <param name="blocks">Number of blocks in device</param>
|
/// <param name="blocks">Number of blocks in device</param>
|
||||||
/// <param name="blockSize">Size in bytes of a block</param>
|
/// <param name="blockSize">Size in bytes of a block</param>
|
||||||
|
|||||||
@@ -39,9 +39,7 @@ namespace Aaru.CommonTypes
|
|||||||
{
|
{
|
||||||
public static partial class MediaTypeFromDevice
|
public static partial class MediaTypeFromDevice
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Gets the media type from a SCSI Block Commands compliant device</summary>
|
||||||
/// Gets the media type from a SCSI Block Commands compliant device
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="vendor">Vendor string</param>
|
/// <param name="vendor">Vendor string</param>
|
||||||
/// <param name="model">Model string</param>
|
/// <param name="model">Model string</param>
|
||||||
/// <param name="mediumType">Medium type from MODE SENSE</param>
|
/// <param name="mediumType">Medium type from MODE SENSE</param>
|
||||||
|
|||||||
@@ -39,9 +39,7 @@ namespace Aaru.CommonTypes
|
|||||||
{
|
{
|
||||||
public static partial class MediaTypeFromDevice
|
public static partial class MediaTypeFromDevice
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Gets the media type from an SCSI Streaming Commands compliant device</summary>
|
||||||
/// Gets the media type from an SCSI Streaming Commands compliant device
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="scsiPeripheralType">Peripheral type</param>
|
/// <param name="scsiPeripheralType">Peripheral type</param>
|
||||||
/// <param name="vendor">Vendor string</param>
|
/// <param name="vendor">Vendor string</param>
|
||||||
/// <param name="model">Model string</param>
|
/// <param name="model">Model string</param>
|
||||||
|
|||||||
@@ -40,30 +40,18 @@ using System.ComponentModel.DataAnnotations;
|
|||||||
|
|
||||||
namespace Aaru.CommonTypes.Metadata
|
namespace Aaru.CommonTypes.Metadata
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Describes CD reading offset</summary>
|
||||||
/// Describes CD reading offset
|
|
||||||
/// </summary>
|
|
||||||
public class CdOffset
|
public class CdOffset
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Drive manufacturer</summary>
|
||||||
/// Drive manufacturer
|
|
||||||
/// </summary>
|
|
||||||
public string Manufacturer { get; set; }
|
public string Manufacturer { get; set; }
|
||||||
/// <summary>
|
/// <summary>Drive model</summary>
|
||||||
/// Drive model
|
|
||||||
/// </summary>
|
|
||||||
public string Model { get; set; }
|
public string Model { get; set; }
|
||||||
/// <summary>
|
/// <summary>Reading offset</summary>
|
||||||
/// Reading offset
|
|
||||||
/// </summary>
|
|
||||||
public short Offset { get; set; }
|
public short Offset { get; set; }
|
||||||
/// <summary>
|
/// <summary>Number of times this offset has been submitted</summary>
|
||||||
/// Number of times this offset has been submitted
|
|
||||||
/// </summary>
|
|
||||||
public int Submissions { get; set; }
|
public int Submissions { get; set; }
|
||||||
/// <summary>
|
/// <summary>Percentage of submissions in agreement with this offset</summary>
|
||||||
/// Percentage of submissions in agreement with this offset
|
|
||||||
/// </summary>
|
|
||||||
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:P0}")]
|
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:P0}")]
|
||||||
public float Agreement { get; set; }
|
public float Agreement { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ using Aaru.CommonTypes.Structs.Devices.ATA;
|
|||||||
using Aaru.CommonTypes.Structs.Devices.SCSI;
|
using Aaru.CommonTypes.Structs.Devices.SCSI;
|
||||||
using Aaru.CommonTypes.Structs.Devices.SCSI.Modes;
|
using Aaru.CommonTypes.Structs.Devices.SCSI.Modes;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
// This is obsolete
|
// This is obsolete
|
||||||
#pragma warning disable 1591
|
#pragma warning disable 1591
|
||||||
|
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ using Aaru.CommonTypes.Structs.Devices.ATA;
|
|||||||
using Aaru.CommonTypes.Structs.Devices.SCSI;
|
using Aaru.CommonTypes.Structs.Devices.SCSI;
|
||||||
using Aaru.CommonTypes.Structs.Devices.SCSI.Modes;
|
using Aaru.CommonTypes.Structs.Devices.SCSI.Modes;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
// TODO: Re-enable CS1591 in this file
|
// TODO: Re-enable CS1591 in this file
|
||||||
#pragma warning disable 1591
|
#pragma warning disable 1591
|
||||||
|
|
||||||
|
|||||||
@@ -42,14 +42,10 @@ using Schemas;
|
|||||||
|
|
||||||
namespace Aaru.CommonTypes.Metadata
|
namespace Aaru.CommonTypes.Metadata
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Physical dimensions for media types</summary>
|
||||||
/// Physical dimensions for media types
|
|
||||||
/// </summary>
|
|
||||||
public static class Dimensions
|
public static class Dimensions
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Gets the physical dimensions, in metadata expected format, for a given media type</summary>
|
||||||
/// Gets the physical dimensions, in metadata expected format, for a given media type
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="dskType">Media type</param>
|
/// <param name="dskType">Media type</param>
|
||||||
/// <returns>Dimensions metadata</returns>
|
/// <returns>Dimensions metadata</returns>
|
||||||
public static DimensionsType DimensionsFromMediaType(CommonTypes.MediaType dskType)
|
public static DimensionsType DimensionsFromMediaType(CommonTypes.MediaType dskType)
|
||||||
|
|||||||
@@ -39,14 +39,10 @@
|
|||||||
#pragma warning disable 612
|
#pragma warning disable 612
|
||||||
namespace Aaru.CommonTypes.Metadata
|
namespace Aaru.CommonTypes.Metadata
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Handles media type for metadata</summary>
|
||||||
/// Handles media type for metadata
|
|
||||||
/// </summary>
|
|
||||||
public static class MediaType
|
public static class MediaType
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Converts a media type of a pair of type and subtype strings to use in metadata</summary>
|
||||||
/// Converts a media type of a pair of type and subtype strings to use in metadata
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="dskType">Media type</param>
|
/// <param name="dskType">Media type</param>
|
||||||
/// <returns>Media type and subtype for metadata</returns>
|
/// <returns>Media type and subtype for metadata</returns>
|
||||||
public static (string type, string subType) MediaTypeToString(CommonTypes.MediaType dskType)
|
public static (string type, string subType) MediaTypeToString(CommonTypes.MediaType dskType)
|
||||||
|
|||||||
@@ -43,61 +43,37 @@ using Schemas;
|
|||||||
|
|
||||||
namespace Aaru.CommonTypes.Metadata
|
namespace Aaru.CommonTypes.Metadata
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Information that allows to resume a dump</summary>
|
||||||
/// Information that allows to resume a dump
|
|
||||||
/// </summary>
|
|
||||||
[Serializable, XmlRoot("DicResume", Namespace = "", IsNullable = false)]
|
[Serializable, XmlRoot("DicResume", Namespace = "", IsNullable = false)]
|
||||||
public class Resume
|
public class Resume
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>List of blocks that returned an error on reading</summary>
|
||||||
/// List of blocks that returned an error on reading
|
|
||||||
/// </summary>
|
|
||||||
[XmlArrayItem("Block")]
|
[XmlArrayItem("Block")]
|
||||||
public List<ulong> BadBlocks;
|
public List<ulong> BadBlocks;
|
||||||
/// <summary>
|
/// <summary>Date/time this resume file was created</summary>
|
||||||
/// Date/time this resume file was created
|
|
||||||
/// </summary>
|
|
||||||
[XmlElement(DataType = "dateTime")]
|
[XmlElement(DataType = "dateTime")]
|
||||||
public DateTime CreationDate;
|
public DateTime CreationDate;
|
||||||
/// <summary>
|
/// <summary>Last block on media</summary>
|
||||||
/// Last block on media
|
|
||||||
/// </summary>
|
|
||||||
public ulong LastBlock;
|
public ulong LastBlock;
|
||||||
/// <summary>
|
/// <summary>Date/time this resume file was last written to</summary>
|
||||||
/// Date/time this resume file was last written to
|
|
||||||
/// </summary>
|
|
||||||
[XmlElement(DataType = "dateTime")]
|
[XmlElement(DataType = "dateTime")]
|
||||||
public DateTime LastWriteDate;
|
public DateTime LastWriteDate;
|
||||||
/// <summary>
|
/// <summary>Next block to read</summary>
|
||||||
/// Next block to read
|
|
||||||
/// </summary>
|
|
||||||
public ulong NextBlock;
|
public ulong NextBlock;
|
||||||
/// <summary>
|
/// <summary>Is media removable?</summary>
|
||||||
/// Is media removable?
|
|
||||||
/// </summary>
|
|
||||||
public bool Removable;
|
public bool Removable;
|
||||||
/// <summary>
|
/// <summary>Is media a tape?</summary>
|
||||||
/// Is media a tape?
|
|
||||||
/// </summary>
|
|
||||||
public bool Tape;
|
public bool Tape;
|
||||||
/// <summary>
|
/// <summary>List of CD subchannels that did not read correctly</summary>
|
||||||
/// List of CD subchannels that did not read correctly
|
|
||||||
/// </summary>
|
|
||||||
[XmlArrayItem("Block")]
|
[XmlArrayItem("Block")]
|
||||||
public List<int> BadSubchannels;
|
public List<int> BadSubchannels;
|
||||||
/// <summary>
|
/// <summary>Extents of BLANK sectors for magneto-opticals</summary>
|
||||||
/// Extents of BLANK sectors for magneto-opticals
|
|
||||||
/// </summary>
|
|
||||||
[XmlArrayItem("Extent")]
|
[XmlArrayItem("Extent")]
|
||||||
public ExtentType[] BlankExtents;
|
public ExtentType[] BlankExtents;
|
||||||
/// <summary>
|
/// <summary>Title keys that has not been read</summary>
|
||||||
/// Title keys that has not been read
|
|
||||||
/// </summary>
|
|
||||||
[XmlArrayItem("Block")]
|
[XmlArrayItem("Block")]
|
||||||
public List<ulong> MissingTitleKeys;
|
public List<ulong> MissingTitleKeys;
|
||||||
/// <summary>
|
/// <summary>List of dump tries</summary>
|
||||||
/// List of dump tries
|
|
||||||
/// </summary>
|
|
||||||
[XmlArrayItem("DumpTry")]
|
[XmlArrayItem("DumpTry")]
|
||||||
public List<DumpHardwareType> Tries;
|
public List<DumpHardwareType> Tries;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,14 +39,13 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
|
|
||||||
// ReSharper disable ClassNeverInstantiated.Global
|
// ReSharper disable ClassNeverInstantiated.Global
|
||||||
// ReSharper disable UnusedMember.Global
|
// ReSharper disable UnusedMember.Global
|
||||||
|
|
||||||
namespace Aaru.CommonTypes.Metadata
|
namespace Aaru.CommonTypes.Metadata
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Statistics</summary>
|
||||||
/// Statistics
|
|
||||||
/// </summary>
|
|
||||||
[XmlRoot("DicStats", Namespace = "", IsNullable = false)]
|
[XmlRoot("DicStats", Namespace = "", IsNullable = false)]
|
||||||
public class Stats
|
public class Stats
|
||||||
{
|
{
|
||||||
@@ -84,9 +83,7 @@ namespace Aaru.CommonTypes.Metadata
|
|||||||
public VerifyStats Verify { get; set; }
|
public VerifyStats Verify { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>DTO for statistics</summary>
|
||||||
/// DTO for statistics
|
|
||||||
/// </summary>
|
|
||||||
[SuppressMessage("ReSharper", "CollectionNeverQueried.Global")]
|
[SuppressMessage("ReSharper", "CollectionNeverQueried.Global")]
|
||||||
public class StatsDto
|
public class StatsDto
|
||||||
{
|
{
|
||||||
@@ -116,9 +113,7 @@ namespace Aaru.CommonTypes.Metadata
|
|||||||
public List<OsStats> RemoteOperatingSystems { get; set; }
|
public List<OsStats> RemoteOperatingSystems { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Command execution statistics</summary>
|
||||||
/// Command execution statistics
|
|
||||||
/// </summary>
|
|
||||||
[SuppressMessage("ReSharper", "UnassignedField.Global")]
|
[SuppressMessage("ReSharper", "UnassignedField.Global")]
|
||||||
public class CommandsStats
|
public class CommandsStats
|
||||||
{
|
{
|
||||||
@@ -175,47 +170,29 @@ namespace Aaru.CommonTypes.Metadata
|
|||||||
public long Failed;
|
public long Failed;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Verification statistics</summary>
|
||||||
/// Verification statistics
|
|
||||||
/// </summary>
|
|
||||||
public class VerifyStats
|
public class VerifyStats
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Image verification statistics</summary>
|
||||||
/// Image verification statistics
|
|
||||||
/// </summary>
|
|
||||||
public VerifiedItems MediaImages;
|
public VerifiedItems MediaImages;
|
||||||
/// <summary>
|
/// <summary>Image contents verification statistics</summary>
|
||||||
/// Image contents verification statistics
|
|
||||||
/// </summary>
|
|
||||||
public ScannedSectors Sectors;
|
public ScannedSectors Sectors;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Image contents verification statistics</summary>
|
||||||
/// Image contents verification statistics
|
|
||||||
/// </summary>
|
|
||||||
public class ScannedSectors
|
public class ScannedSectors
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Sectors found to be correct</summary>
|
||||||
/// Sectors found to be correct
|
|
||||||
/// </summary>
|
|
||||||
public long Correct;
|
public long Correct;
|
||||||
/// <summary>
|
/// <summary>Sectors found to be incorrect</summary>
|
||||||
/// Sectors found to be incorrect
|
|
||||||
/// </summary>
|
|
||||||
public long Error;
|
public long Error;
|
||||||
/// <summary>
|
/// <summary>Total number of verified sectors</summary>
|
||||||
/// Total number of verified sectors
|
|
||||||
/// </summary>
|
|
||||||
public long Total;
|
public long Total;
|
||||||
/// <summary>
|
/// <summary>Total number of sectors that could not be verified</summary>
|
||||||
/// Total number of sectors that could not be verified
|
|
||||||
/// </summary>
|
|
||||||
public long Unverifiable;
|
public long Unverifiable;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Media scanning time statistics</summary>
|
||||||
/// Media scanning time statistics
|
|
||||||
/// </summary>
|
|
||||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||||
public class TimeStats
|
public class TimeStats
|
||||||
{
|
{
|
||||||
@@ -233,159 +210,99 @@ namespace Aaru.CommonTypes.Metadata
|
|||||||
public long MoreThan500ms;
|
public long MoreThan500ms;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Media scanning statistics</summary>
|
||||||
/// Media scanning statistics
|
|
||||||
/// </summary>
|
|
||||||
public class MediaScanStats
|
public class MediaScanStats
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Statistics of scanned sectors</summary>
|
||||||
/// Statistics of scanned sectors
|
|
||||||
/// </summary>
|
|
||||||
public ScannedSectors Sectors;
|
public ScannedSectors Sectors;
|
||||||
/// <summary>
|
/// <summary>Scan time statistics</summary>
|
||||||
/// Scan time statistics
|
|
||||||
/// </summary>
|
|
||||||
public TimeStats Times;
|
public TimeStats Times;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Checksum type statistics</summary>
|
||||||
/// Checksum type statistics
|
|
||||||
/// </summary>
|
|
||||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||||
public class ChecksumStats
|
public class ChecksumStats
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Checksum algorithm</summary>
|
||||||
/// Checksum algorithm
|
|
||||||
/// </summary>
|
|
||||||
[XmlAttribute]
|
[XmlAttribute]
|
||||||
public string algorithm;
|
public string algorithm;
|
||||||
/// <summary>
|
/// <summary>Time taken to execute algorithm</summary>
|
||||||
/// Time taken to execute algorithm
|
|
||||||
/// </summary>
|
|
||||||
[XmlText]
|
[XmlText]
|
||||||
public double Value;
|
public double Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Benchmark statistics</summary>
|
||||||
/// Benchmark statistics
|
|
||||||
/// </summary>
|
|
||||||
public class BenchmarkStats
|
public class BenchmarkStats
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Total time taken to run the checksum algorithms in parallel</summary>
|
||||||
/// Total time taken to run the checksum algorithms in parallel
|
|
||||||
/// </summary>
|
|
||||||
public double All;
|
public double All;
|
||||||
/// <summary>
|
/// <summary>List of time taken by each checksum algorithm</summary>
|
||||||
/// List of time taken by each checksum algorithm
|
|
||||||
/// </summary>
|
|
||||||
[XmlElement("Checksum")]
|
[XmlElement("Checksum")]
|
||||||
public List<ChecksumStats> Checksum;
|
public List<ChecksumStats> Checksum;
|
||||||
/// <summary>
|
/// <summary>Time taken to benchmark entropy calculation</summary>
|
||||||
/// Time taken to benchmark entropy calculation
|
|
||||||
/// </summary>
|
|
||||||
public double Entropy;
|
public double Entropy;
|
||||||
/// <summary>
|
/// <summary>Maximum amount of memory used while running the benchmark</summary>
|
||||||
/// Maximum amount of memory used while running the benchmark
|
|
||||||
/// </summary>
|
|
||||||
public long MaxMemory;
|
public long MaxMemory;
|
||||||
/// <summary>
|
/// <summary>Minimum amount of memory used while running the benchmark</summary>
|
||||||
/// Minimum amount of memory used while running the benchmark
|
|
||||||
/// </summary>
|
|
||||||
public long MinMemory;
|
public long MinMemory;
|
||||||
/// <summary>
|
/// <summary>Total time taken to run the checksum algorithms sequentially</summary>
|
||||||
/// Total time taken to run the checksum algorithms sequentially
|
|
||||||
/// </summary>
|
|
||||||
public double Sequential;
|
public double Sequential;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Media statistics</summary>
|
||||||
/// Media statistics
|
|
||||||
/// </summary>
|
|
||||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||||
public class MediaStats
|
public class MediaStats
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Found in a real device?</summary>
|
||||||
/// Found in a real device?
|
|
||||||
/// </summary>
|
|
||||||
[XmlAttribute]
|
[XmlAttribute]
|
||||||
public bool real;
|
public bool real;
|
||||||
/// <summary>
|
/// <summary>Media type</summary>
|
||||||
/// Media type
|
|
||||||
/// </summary>
|
|
||||||
[XmlAttribute]
|
[XmlAttribute]
|
||||||
public string type;
|
public string type;
|
||||||
/// <summary>
|
/// <summary>Number of times it has been found</summary>
|
||||||
/// Number of times it has been found
|
|
||||||
/// </summary>
|
|
||||||
[XmlText]
|
[XmlText]
|
||||||
public long Value;
|
public long Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Device statistics</summary>
|
||||||
/// Device statistics
|
|
||||||
/// </summary>
|
|
||||||
public class DeviceStats
|
public class DeviceStats
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Is manufacturer null?</summary>
|
||||||
/// Is manufacturer null?
|
|
||||||
/// </summary>
|
|
||||||
[XmlIgnore]
|
[XmlIgnore]
|
||||||
public bool ManufacturerSpecified;
|
public bool ManufacturerSpecified;
|
||||||
/// <summary>
|
/// <summary>Manufacturer string</summary>
|
||||||
/// Manufacturer string
|
|
||||||
/// </summary>
|
|
||||||
public string Manufacturer { get; set; }
|
public string Manufacturer { get; set; }
|
||||||
/// <summary>
|
/// <summary>Model string</summary>
|
||||||
/// Model string
|
|
||||||
/// </summary>
|
|
||||||
public string Model { get; set; }
|
public string Model { get; set; }
|
||||||
/// <summary>
|
/// <summary>Revision or firmware version</summary>
|
||||||
/// Revision or firmware version
|
|
||||||
/// </summary>
|
|
||||||
public string Revision { get; set; }
|
public string Revision { get; set; }
|
||||||
/// <summary>
|
/// <summary>Bus the device was attached to</summary>
|
||||||
/// Bus the device was attached to
|
|
||||||
/// </summary>
|
|
||||||
public string Bus { get; set; }
|
public string Bus { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Name=value pair statistics</summary>
|
||||||
/// Name=value pair statistics
|
|
||||||
/// </summary>
|
|
||||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||||
public class NameValueStats
|
public class NameValueStats
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Name</summary>
|
||||||
/// Name
|
|
||||||
/// </summary>
|
|
||||||
[XmlAttribute]
|
[XmlAttribute]
|
||||||
public string name { get; set; }
|
public string name { get; set; }
|
||||||
/// <summary>
|
/// <summary>Number of times it has been used/found</summary>
|
||||||
/// Number of times it has been used/found
|
|
||||||
/// </summary>
|
|
||||||
[XmlText]
|
[XmlText]
|
||||||
public long Value { get; set; }
|
public long Value { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Operating system statistics</summary>
|
||||||
/// Operating system statistics
|
|
||||||
/// </summary>
|
|
||||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||||
public class OsStats
|
public class OsStats
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Operating system name</summary>
|
||||||
/// Operating system name
|
|
||||||
/// </summary>
|
|
||||||
[XmlAttribute]
|
[XmlAttribute]
|
||||||
public string name { get; set; }
|
public string name { get; set; }
|
||||||
/// <summary>
|
/// <summary>Operating system version</summary>
|
||||||
/// Operating system version
|
|
||||||
/// </summary>
|
|
||||||
[XmlAttribute]
|
[XmlAttribute]
|
||||||
public string version { get; set; }
|
public string version { get; set; }
|
||||||
/// <summary>
|
/// <summary>Number of times Aaru run on it</summary>
|
||||||
/// Number of times Aaru run on it
|
|
||||||
/// </summary>
|
|
||||||
[XmlText]
|
[XmlText]
|
||||||
public long Value { get; set; }
|
public long Value { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,9 +41,7 @@ using Schemas;
|
|||||||
|
|
||||||
namespace Aaru.CommonTypes.Metadata
|
namespace Aaru.CommonTypes.Metadata
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Manages Aaru's version for metadata</summary>
|
||||||
/// Manages Aaru's version for metadata
|
|
||||||
/// </summary>
|
|
||||||
public static class Version
|
public static class Version
|
||||||
{
|
{
|
||||||
/// <summary>Gets XML software type for the running version</summary>
|
/// <summary>Gets XML software type for the running version</summary>
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ namespace Aaru.CommonTypes
|
|||||||
public override bool Equals(object obj) => obj is Partition partition && Equals(partition);
|
public override bool Equals(object obj) => obj is Partition partition && Equals(partition);
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|
||||||
// ReSharper disable once NonReadonlyMemberInGetHashCode
|
// ReSharper disable once NonReadonlyMemberInGetHashCode
|
||||||
public override int GetHashCode() => Start.GetHashCode() + End.GetHashCode();
|
public override int GetHashCode() => Start.GetHashCode() + End.GetHashCode();
|
||||||
|
|
||||||
|
|||||||
@@ -46,6 +46,8 @@ namespace Aaru.CommonTypes
|
|||||||
/// <summary>Contain all plugins (filesystem, partition and image)</summary>
|
/// <summary>Contain all plugins (filesystem, partition and image)</summary>
|
||||||
public class PluginBase
|
public class PluginBase
|
||||||
{
|
{
|
||||||
|
/// <summary>List of all archive formats</summary>
|
||||||
|
public readonly SortedDictionary<string, IArchive> Archives;
|
||||||
/// <summary>List of checksum plugins</summary>
|
/// <summary>List of checksum plugins</summary>
|
||||||
public readonly List<IChecksum> Checksums;
|
public readonly List<IChecksum> Checksums;
|
||||||
/// <summary>List of filter plugins</summary>
|
/// <summary>List of filter plugins</summary>
|
||||||
@@ -64,8 +66,6 @@ namespace Aaru.CommonTypes
|
|||||||
public readonly SortedDictionary<string, IWritableFloppyImage> WritableFloppyImages;
|
public readonly SortedDictionary<string, IWritableFloppyImage> WritableFloppyImages;
|
||||||
/// <summary>List of writable media image plugins</summary>
|
/// <summary>List of writable media image plugins</summary>
|
||||||
public readonly SortedDictionary<string, IWritableImage> WritableImages;
|
public readonly SortedDictionary<string, IWritableImage> WritableImages;
|
||||||
/// <summary>List of all archive formats</summary>
|
|
||||||
public readonly SortedDictionary<string, IArchive> Archives;
|
|
||||||
|
|
||||||
/// <summary>Initializes the plugins lists</summary>
|
/// <summary>Initializes the plugins lists</summary>
|
||||||
public PluginBase()
|
public PluginBase()
|
||||||
@@ -82,9 +82,7 @@ namespace Aaru.CommonTypes
|
|||||||
Archives = new SortedDictionary<string, IArchive>();
|
Archives = new SortedDictionary<string, IArchive>();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Adds plugins to the central plugin register</summary>
|
||||||
/// Adds plugins to the central plugin register
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="pluginRegister">Plugin register</param>
|
/// <param name="pluginRegister">Plugin register</param>
|
||||||
public void AddPlugins(IPluginRegister pluginRegister)
|
public void AddPlugins(IPluginRegister pluginRegister)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -327,9 +327,7 @@ namespace Aaru.CommonTypes.Structs.Devices.ATA
|
|||||||
ZonedBit0 = 0x0001
|
ZonedBit0 = 0x0001
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Data set management flag bits.</summary>
|
||||||
/// Data set management flag bits.
|
|
||||||
/// </summary>
|
|
||||||
[Flags]
|
[Flags]
|
||||||
public enum DataSetMgmtBit : ushort
|
public enum DataSetMgmtBit : ushort
|
||||||
{
|
{
|
||||||
@@ -344,9 +342,7 @@ namespace Aaru.CommonTypes.Structs.Devices.ATA
|
|||||||
Trim = 0x0001
|
Trim = 0x0001
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Device form factor</summary>
|
||||||
/// Device form factor
|
|
||||||
/// </summary>
|
|
||||||
public enum DeviceFormFactorEnum : ushort
|
public enum DeviceFormFactorEnum : ushort
|
||||||
{
|
{
|
||||||
/// <summary>Size not reported</summary>
|
/// <summary>Size not reported</summary>
|
||||||
@@ -460,9 +456,7 @@ namespace Aaru.CommonTypes.Structs.Devices.ATA
|
|||||||
#pragma warning restore 1591
|
#pragma warning restore 1591
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>SATA capabilities flags</summary>
|
||||||
/// SATA capabilities flags
|
|
||||||
/// </summary>
|
|
||||||
[Flags]
|
[Flags]
|
||||||
public enum SATACapabilitiesBit : ushort
|
public enum SATACapabilitiesBit : ushort
|
||||||
{
|
{
|
||||||
@@ -496,9 +490,7 @@ namespace Aaru.CommonTypes.Structs.Devices.ATA
|
|||||||
Clear = 0x0001
|
Clear = 0x0001
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>More SATA capabilities flags</summary>
|
||||||
/// More SATA capabilities flags
|
|
||||||
/// </summary>
|
|
||||||
[Flags]
|
[Flags]
|
||||||
public enum SATACapabilitiesBit2 : ushort
|
public enum SATACapabilitiesBit2 : ushort
|
||||||
{
|
{
|
||||||
@@ -527,9 +519,7 @@ namespace Aaru.CommonTypes.Structs.Devices.ATA
|
|||||||
Clear = 0x0001
|
Clear = 0x0001
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>SATA features flags</summary>
|
||||||
/// SATA features flags
|
|
||||||
/// </summary>
|
|
||||||
[Flags]
|
[Flags]
|
||||||
public enum SATAFeaturesBit : ushort
|
public enum SATAFeaturesBit : ushort
|
||||||
{
|
{
|
||||||
@@ -560,9 +550,7 @@ namespace Aaru.CommonTypes.Structs.Devices.ATA
|
|||||||
Clear = 0x0001
|
Clear = 0x0001
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>SCT Command Transport flags</summary>
|
||||||
/// SCT Command Transport flags
|
|
||||||
/// </summary>
|
|
||||||
[Flags]
|
[Flags]
|
||||||
public enum SCTCommandTransportBit : ushort
|
public enum SCTCommandTransportBit : ushort
|
||||||
{
|
{
|
||||||
@@ -614,9 +602,7 @@ namespace Aaru.CommonTypes.Structs.Devices.ATA
|
|||||||
Supported = 0x0001
|
Supported = 0x0001
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Specific configuration flags</summary>
|
||||||
/// Specific configuration flags
|
|
||||||
/// </summary>
|
|
||||||
public enum SpecificConfigurationEnum : ushort
|
public enum SpecificConfigurationEnum : ushort
|
||||||
{
|
{
|
||||||
/// <summary>Device requires SET FEATURES to spin up and IDENTIFY DEVICE response is incomplete</summary>
|
/// <summary>Device requires SET FEATURES to spin up and IDENTIFY DEVICE response is incomplete</summary>
|
||||||
@@ -629,9 +615,7 @@ namespace Aaru.CommonTypes.Structs.Devices.ATA
|
|||||||
NotRequiresSetCompleteResponse = 0xC837
|
NotRequiresSetCompleteResponse = 0xC837
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Transfer mode flags</summary>
|
||||||
/// Transfer mode flags
|
|
||||||
/// </summary>
|
|
||||||
[Flags]
|
[Flags]
|
||||||
public enum TransferMode : byte
|
public enum TransferMode : byte
|
||||||
{
|
{
|
||||||
@@ -642,9 +626,7 @@ namespace Aaru.CommonTypes.Structs.Devices.ATA
|
|||||||
#pragma warning restore 1591
|
#pragma warning restore 1591
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Trusted Computing flags</summary>
|
||||||
/// Trusted Computing flags
|
|
||||||
/// </summary>
|
|
||||||
[Flags]
|
[Flags]
|
||||||
public enum TrustedComputingBit : ushort
|
public enum TrustedComputingBit : ushort
|
||||||
{
|
{
|
||||||
@@ -663,9 +645,7 @@ namespace Aaru.CommonTypes.Structs.Devices.ATA
|
|||||||
TrustedComputing = 0x0001
|
TrustedComputing = 0x0001
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>IDENTIFY DEVICE decoded response</summary>
|
||||||
/// IDENTIFY DEVICE decoded response
|
|
||||||
/// </summary>
|
|
||||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 2)]
|
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 2)]
|
||||||
public struct IdentifyDevice
|
public struct IdentifyDevice
|
||||||
{
|
{
|
||||||
@@ -1017,9 +997,7 @@ namespace Aaru.CommonTypes.Structs.Devices.ATA
|
|||||||
public byte Checksum;
|
public byte Checksum;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Decodes a raw IDENTIFY DEVICE response</summary>
|
||||||
/// Decodes a raw IDENTIFY DEVICE response
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="IdentifyDeviceResponse">Raw IDENTIFY DEVICE response</param>
|
/// <param name="IdentifyDeviceResponse">Raw IDENTIFY DEVICE response</param>
|
||||||
/// <returns>Decoded IDENTIFY DEVICE</returns>
|
/// <returns>Decoded IDENTIFY DEVICE</returns>
|
||||||
public static IdentifyDevice? Decode(byte[] IdentifyDeviceResponse)
|
public static IdentifyDevice? Decode(byte[] IdentifyDeviceResponse)
|
||||||
@@ -1050,9 +1028,7 @@ namespace Aaru.CommonTypes.Structs.Devices.ATA
|
|||||||
return ATAID;
|
return ATAID;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Encodes a raw IDENTIFY DEVICE response</summary>
|
||||||
/// Encodes a raw IDENTIFY DEVICE response
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="identify">Decoded IDENTIFY DEVICE</param>
|
/// <param name="identify">Decoded IDENTIFY DEVICE</param>
|
||||||
/// <returns>Raw IDENTIFY DEVICE response</returns>
|
/// <returns>Raw IDENTIFY DEVICE response</returns>
|
||||||
public static byte[] Encode(IdentifyDevice? identify)
|
public static byte[] Encode(IdentifyDevice? identify)
|
||||||
|
|||||||
@@ -34,9 +34,7 @@ using System.Diagnostics.CodeAnalysis;
|
|||||||
|
|
||||||
namespace Aaru.CommonTypes.Structs.Devices.SCSI
|
namespace Aaru.CommonTypes.Structs.Devices.SCSI
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>List of known SCSI peripheral qualifiers</summary>
|
||||||
/// List of known SCSI peripheral qualifiers
|
|
||||||
/// </summary>
|
|
||||||
public enum PeripheralQualifiers : byte
|
public enum PeripheralQualifiers : byte
|
||||||
{
|
{
|
||||||
/// <summary>Peripheral qualifier: Device is connected and supported</summary>
|
/// <summary>Peripheral qualifier: Device is connected and supported</summary>
|
||||||
@@ -51,9 +49,7 @@ namespace Aaru.CommonTypes.Structs.Devices.SCSI
|
|||||||
VendorMask = 0x04
|
VendorMask = 0x04
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>List of known peripheral device types</summary>
|
||||||
/// List of known peripheral device types
|
|
||||||
/// </summary>
|
|
||||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||||
public enum PeripheralDeviceTypes : byte
|
public enum PeripheralDeviceTypes : byte
|
||||||
{
|
{
|
||||||
@@ -105,9 +101,7 @@ namespace Aaru.CommonTypes.Structs.Devices.SCSI
|
|||||||
UnknownDevice = 0x1F
|
UnknownDevice = 0x1F
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>List of known ANSI SCSI standards</summary>
|
||||||
/// List of known ANSI SCSI standards
|
|
||||||
/// </summary>
|
|
||||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||||
public enum ANSIVersions : byte
|
public enum ANSIVersions : byte
|
||||||
{
|
{
|
||||||
@@ -127,9 +121,7 @@ namespace Aaru.CommonTypes.Structs.Devices.SCSI
|
|||||||
ANSI2008Version = 0x06
|
ANSI2008Version = 0x06
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>List of known ECMA SCSI standards</summary>
|
||||||
/// List of known ECMA SCSI standards
|
|
||||||
/// </summary>
|
|
||||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||||
public enum ECMAVersions : byte
|
public enum ECMAVersions : byte
|
||||||
{
|
{
|
||||||
@@ -139,9 +131,7 @@ namespace Aaru.CommonTypes.Structs.Devices.SCSI
|
|||||||
ECMA111 = 0x01
|
ECMA111 = 0x01
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>List of known ISO SCSI standards</summary>
|
||||||
/// List of known ISO SCSI standards
|
|
||||||
/// </summary>
|
|
||||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||||
public enum ISOVersions : byte
|
public enum ISOVersions : byte
|
||||||
{
|
{
|
||||||
@@ -151,9 +141,7 @@ namespace Aaru.CommonTypes.Structs.Devices.SCSI
|
|||||||
ISO1995Version = 0x02
|
ISO1995Version = 0x02
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>List of known SCSI Parallel Interface clocking types</summary>
|
||||||
/// List of known SCSI Parallel Interface clocking types
|
|
||||||
/// </summary>
|
|
||||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||||
public enum SPIClocking : byte
|
public enum SPIClocking : byte
|
||||||
{
|
{
|
||||||
@@ -167,9 +155,7 @@ namespace Aaru.CommonTypes.Structs.Devices.SCSI
|
|||||||
STandDT = 0x03
|
STandDT = 0x03
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>List of known TGPS values</summary>
|
||||||
/// List of known TGPS values
|
|
||||||
/// </summary>
|
|
||||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||||
public enum TGPSValues : byte
|
public enum TGPSValues : byte
|
||||||
{
|
{
|
||||||
@@ -183,9 +169,7 @@ namespace Aaru.CommonTypes.Structs.Devices.SCSI
|
|||||||
Both = 0x03
|
Both = 0x03
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>List of known SCSI protocols</summary>
|
||||||
/// List of known SCSI protocols
|
|
||||||
/// </summary>
|
|
||||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||||
public enum ProtocolIdentifiers : byte
|
public enum ProtocolIdentifiers : byte
|
||||||
{
|
{
|
||||||
@@ -217,37 +201,23 @@ namespace Aaru.CommonTypes.Structs.Devices.SCSI
|
|||||||
NoProtocol = 15
|
NoProtocol = 15
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>List of known SCSI definitions</summary>
|
||||||
/// List of known SCSI definitions
|
|
||||||
/// </summary>
|
|
||||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||||
public enum ScsiDefinitions : byte
|
public enum ScsiDefinitions : byte
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Unknown</summary>
|
||||||
/// Unknown
|
|
||||||
/// </summary>
|
|
||||||
Current = 0,
|
Current = 0,
|
||||||
/// <summary>
|
/// <summary>SCSI-1</summary>
|
||||||
/// SCSI-1
|
|
||||||
/// </summary>
|
|
||||||
SCSI1 = 1,
|
SCSI1 = 1,
|
||||||
/// <summary>
|
/// <summary>Unknown</summary>
|
||||||
/// Unknown
|
|
||||||
/// </summary>
|
|
||||||
CCS = 2,
|
CCS = 2,
|
||||||
/// <summary>
|
/// <summary>SCSI-2</summary>
|
||||||
/// SCSI-2
|
|
||||||
/// </summary>
|
|
||||||
SCSI2 = 3,
|
SCSI2 = 3,
|
||||||
/// <summary>
|
/// <summary>SCSI-3</summary>
|
||||||
/// SCSI-3
|
|
||||||
/// </summary>
|
|
||||||
SCSI3 = 4
|
SCSI3 = 4
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>List of known SCSI physical interfaces</summary>
|
||||||
/// List of known SCSI physical interfaces
|
|
||||||
/// </summary>
|
|
||||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||||
public enum PhysicalInterfaces : uint
|
public enum PhysicalInterfaces : uint
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -251,9 +251,7 @@ namespace Aaru.CommonTypes.Structs.Devices.SCSI
|
|||||||
0x48, 0x69, 0x2D, 0x4D, 0x44, 0x20, 0x20, 0x20
|
0x48, 0x69, 0x2D, 0x4D, 0x44, 0x20, 0x20, 0x20
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Decodes a SCSI INQUIRY response</summary>
|
||||||
/// Decodes a SCSI INQUIRY response
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="SCSIInquiryResponse">INQUIRY raw response data</param>
|
/// <param name="SCSIInquiryResponse">INQUIRY raw response data</param>
|
||||||
/// <returns>Decoded SCSI INQUIRY</returns>
|
/// <returns>Decoded SCSI INQUIRY</returns>
|
||||||
#region Public methods
|
#region Public methods
|
||||||
@@ -513,9 +511,7 @@ namespace Aaru.CommonTypes.Structs.Devices.SCSI
|
|||||||
return decoded;
|
return decoded;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Encodes a SCSI INQUIRY response</summary>
|
||||||
/// Encodes a SCSI INQUIRY response
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="inq">Decoded SCSI INQUIRY</param>
|
/// <param name="inq">Decoded SCSI INQUIRY</param>
|
||||||
/// <returns>Raw SCSI INQUIRY response</returns>
|
/// <returns>Raw SCSI INQUIRY response</returns>
|
||||||
public static byte[] Encode(Inquiry? inq)
|
public static byte[] Encode(Inquiry? inq)
|
||||||
|
|||||||
@@ -46,9 +46,7 @@ namespace Aaru.CommonTypes.Structs.Devices.SCSI.Modes
|
|||||||
SuppressMessage("ReSharper", "MemberCanBePrivate.Global"), SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
SuppressMessage("ReSharper", "MemberCanBePrivate.Global"), SuppressMessage("ReSharper", "NotAccessedField.Global")]
|
||||||
public class ModePage_2A
|
public class ModePage_2A
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Write speed performance descriptors</summary>
|
||||||
/// Write speed performance descriptors
|
|
||||||
/// </summary>
|
|
||||||
public ModePage_2A_WriteDescriptor[] WriteSpeedPerformanceDescriptors;
|
public ModePage_2A_WriteDescriptor[] WriteSpeedPerformanceDescriptors;
|
||||||
/// <summary>Parameters can be saved</summary>
|
/// <summary>Parameters can be saved</summary>
|
||||||
public bool PS { get; set; }
|
public bool PS { get; set; }
|
||||||
@@ -97,133 +95,74 @@ namespace Aaru.CommonTypes.Structs.Devices.SCSI.Modes
|
|||||||
/// <summary>Current drive speed in Kbytes/second</summary>
|
/// <summary>Current drive speed in Kbytes/second</summary>
|
||||||
public ushort CurrentSpeed { get; set; }
|
public ushort CurrentSpeed { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Can read packet media</summary>
|
||||||
/// Can read packet media
|
|
||||||
/// </summary>
|
|
||||||
public bool Method2 { get; set; }
|
public bool Method2 { get; set; }
|
||||||
/// <summary>
|
/// <summary>Can read CD-RW</summary>
|
||||||
/// Can read CD-RW
|
|
||||||
/// </summary>
|
|
||||||
public bool ReadCDRW { get; set; }
|
public bool ReadCDRW { get; set; }
|
||||||
/// <summary>
|
/// <summary>Can read CD-R</summary>
|
||||||
/// Can read CD-R
|
|
||||||
/// </summary>
|
|
||||||
public bool ReadCDR { get; set; }
|
public bool ReadCDR { get; set; }
|
||||||
/// <summary>
|
/// <summary>Can write CD-RW</summary>
|
||||||
/// Can write CD-RW
|
|
||||||
/// </summary>
|
|
||||||
public bool WriteCDRW { get; set; }
|
public bool WriteCDRW { get; set; }
|
||||||
/// <summary>
|
/// <summary>Can write CD-R</summary>
|
||||||
/// Can write CD-R
|
|
||||||
/// </summary>
|
|
||||||
public bool WriteCDR { get; set; }
|
public bool WriteCDR { get; set; }
|
||||||
/// <summary>
|
/// <summary>Supports IEC-958 digital output on port 2</summary>
|
||||||
/// Supports IEC-958 digital output on port 2
|
|
||||||
/// </summary>
|
|
||||||
public bool DigitalPort2 { get; set; }
|
public bool DigitalPort2 { get; set; }
|
||||||
/// <summary>
|
/// <summary>Supports IEC-958 digital output on port 1</summary>
|
||||||
/// Supports IEC-958 digital output on port 1
|
|
||||||
/// </summary>
|
|
||||||
public bool DigitalPort1 { get; set; }
|
public bool DigitalPort1 { get; set; }
|
||||||
/// <summary>
|
/// <summary>Can deliver a composite audio and video data stream</summary>
|
||||||
/// Can deliver a composite audio and video data stream
|
|
||||||
/// </summary>
|
|
||||||
public bool Composite { get; set; }
|
public bool Composite { get; set; }
|
||||||
/// <summary>
|
/// <summary>This bit controls the behavior of the LOAD/UNLOAD command when trying to load a Slot with no Disc present</summary>
|
||||||
/// This bit controls the behavior of the LOAD/UNLOAD command when trying to load a Slot with no Disc present
|
|
||||||
/// </summary>
|
|
||||||
public bool SSS { get; set; }
|
public bool SSS { get; set; }
|
||||||
/// <summary>
|
/// <summary>Contains a changer that can report the exact contents of the slots</summary>
|
||||||
/// Contains a changer that can report the exact contents of the slots
|
|
||||||
/// </summary>
|
|
||||||
public bool SDP { get; set; }
|
public bool SDP { get; set; }
|
||||||
/// <summary>
|
/// <summary>Page length</summary>
|
||||||
/// Page length
|
|
||||||
/// </summary>
|
|
||||||
public byte Length { get; set; }
|
public byte Length { get; set; }
|
||||||
/// <summary>
|
/// <summary>Set if LSB comes first</summary>
|
||||||
/// Set if LSB comes first
|
|
||||||
/// </summary>
|
|
||||||
public bool LSBF { get; set; }
|
public bool LSBF { get; set; }
|
||||||
/// <summary>
|
/// <summary>Set if HIGH on LRCK indicates left channel. Clear if HIGH on LRCK indicates right channel.</summary>
|
||||||
/// Set if HIGH on LRCK indicates left channel. Clear if HIGH on LRCK indicates right channel.
|
|
||||||
/// </summary>
|
|
||||||
public bool RCK { get; set; }
|
public bool RCK { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Set if data valid on the falling edge of the BCK signal. Clear if data valid on the rising edge of the BCK signal
|
/// Set if data valid on the falling edge of the BCK signal. Clear if data valid on the rising edge of the BCK
|
||||||
|
/// signal
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool BCK { get; set; }
|
public bool BCK { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Can do a test write</summary>
|
||||||
/// Can do a test write
|
|
||||||
/// </summary>
|
|
||||||
public bool TestWrite { get; set; }
|
public bool TestWrite { get; set; }
|
||||||
/// <summary>
|
/// <summary>Maximum write speed</summary>
|
||||||
/// Maximum write speed
|
|
||||||
/// </summary>
|
|
||||||
public ushort MaxWriteSpeed { get; set; }
|
public ushort MaxWriteSpeed { get; set; }
|
||||||
/// <summary>
|
/// <summary>Current write speed</summary>
|
||||||
/// Current write speed
|
|
||||||
/// </summary>
|
|
||||||
public ushort CurrentWriteSpeed { get; set; }
|
public ushort CurrentWriteSpeed { get; set; }
|
||||||
/// <summary>
|
/// <summary>Can read disc's barcode</summary>
|
||||||
/// Can read disc's barcode
|
|
||||||
/// </summary>
|
|
||||||
public bool ReadBarcode { get; set; }
|
public bool ReadBarcode { get; set; }
|
||||||
/// <summary>
|
/// <summary>Can read DVD-RAM</summary>
|
||||||
/// Can read DVD-RAM
|
|
||||||
/// </summary>
|
|
||||||
public bool ReadDVDRAM { get; set; }
|
public bool ReadDVDRAM { get; set; }
|
||||||
/// <summary>
|
/// <summary>Can read DVD-R</summary>
|
||||||
/// Can read DVD-R
|
|
||||||
/// </summary>
|
|
||||||
public bool ReadDVDR { get; set; }
|
public bool ReadDVDR { get; set; }
|
||||||
/// <summary>
|
/// <summary>Can read DVD-ROM</summary>
|
||||||
/// Can read DVD-ROM
|
|
||||||
/// </summary>
|
|
||||||
public bool ReadDVDROM { get; set; }
|
public bool ReadDVDROM { get; set; }
|
||||||
/// <summary>
|
/// <summary>Can write DVD-RAM</summary>
|
||||||
/// Can write DVD-RAM
|
|
||||||
/// </summary>
|
|
||||||
public bool WriteDVDRAM { get; set; }
|
public bool WriteDVDRAM { get; set; }
|
||||||
/// <summary>
|
/// <summary>Can write DVD-R</summary>
|
||||||
/// Can write DVD-R
|
|
||||||
/// </summary>
|
|
||||||
public bool WriteDVDR { get; set; }
|
public bool WriteDVDR { get; set; }
|
||||||
/// <summary>
|
/// <summary>Can read raw R-W subchannel from the Lead-In</summary>
|
||||||
/// Can read raw R-W subchannel from the Lead-In
|
|
||||||
/// </summary>
|
|
||||||
public bool LeadInPW { get; set; }
|
public bool LeadInPW { get; set; }
|
||||||
/// <summary>
|
/// <summary>Can read both sides of a disc</summary>
|
||||||
/// Can read both sides of a disc
|
|
||||||
/// </summary>
|
|
||||||
public bool SCC { get; set; }
|
public bool SCC { get; set; }
|
||||||
/// <summary>
|
/// <summary>Support copyright management</summary>
|
||||||
/// Support copyright management
|
|
||||||
/// </summary>
|
|
||||||
public ushort CMRSupported { get; set; }
|
public ushort CMRSupported { get; set; }
|
||||||
/// <summary>
|
/// <summary>Supports buffer under-run free recording</summary>
|
||||||
/// Supports buffer under-run free recording
|
|
||||||
/// </summary>
|
|
||||||
public bool BUF { get; set; }
|
public bool BUF { get; set; }
|
||||||
/// <summary>
|
/// <summary>Selected rotational control</summary>
|
||||||
/// Selected rotational control
|
|
||||||
/// </summary>
|
|
||||||
public byte RotationControlSelected { get; set; }
|
public byte RotationControlSelected { get; set; }
|
||||||
/// <summary>
|
/// <summary>Current write speed selected</summary>
|
||||||
/// Current write speed selected
|
|
||||||
/// </summary>
|
|
||||||
public ushort CurrentWriteSpeedSelected { get; set; }
|
public ushort CurrentWriteSpeedSelected { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Database ID</summary>
|
||||||
/// Database ID
|
|
||||||
/// </summary>
|
|
||||||
[JsonIgnore, Key]
|
[JsonIgnore, Key]
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Decodes the page 2Ah of a MODE SENSE response</summary>
|
||||||
/// Decodes the page 2Ah of a MODE SENSE response
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="pageResponse">Raw page 2Ah</param>
|
/// <param name="pageResponse">Raw page 2Ah</param>
|
||||||
/// <returns>Decoded page 2Ah</returns>
|
/// <returns>Decoded page 2Ah</returns>
|
||||||
public static ModePage_2A Decode(byte[] pageResponse)
|
public static ModePage_2A Decode(byte[] pageResponse)
|
||||||
@@ -337,9 +276,7 @@ namespace Aaru.CommonTypes.Structs.Devices.SCSI.Modes
|
|||||||
return decoded;
|
return decoded;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Encodes a page 2Ah of a MODE SENSE response</summary>
|
||||||
/// Encodes a page 2Ah of a MODE SENSE response
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="decoded">Decoded page 2Ah</param>
|
/// <param name="decoded">Decoded page 2Ah</param>
|
||||||
/// <returns>Raw page 2Ah</returns>
|
/// <returns>Raw page 2Ah</returns>
|
||||||
public static byte[] Encode(ModePage_2A decoded)
|
public static byte[] Encode(ModePage_2A decoded)
|
||||||
@@ -564,19 +501,13 @@ namespace Aaru.CommonTypes.Structs.Devices.SCSI.Modes
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Page 2Ah write descriptor</summary>
|
||||||
/// Page 2Ah write descriptor
|
|
||||||
/// </summary>
|
|
||||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||||
public struct ModePage_2A_WriteDescriptor
|
public struct ModePage_2A_WriteDescriptor
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Rotational control</summary>
|
||||||
/// Rotational control
|
|
||||||
/// </summary>
|
|
||||||
public byte RotationControl;
|
public byte RotationControl;
|
||||||
/// <summary>
|
/// <summary>Write speed</summary>
|
||||||
/// Write speed
|
|
||||||
/// </summary>
|
|
||||||
public ushort WriteSpeed;
|
public ushort WriteSpeed;
|
||||||
}
|
}
|
||||||
#endregion Mode Page 0x2A: CD-ROM capabilities page
|
#endregion Mode Page 0x2A: CD-ROM capabilities page
|
||||||
|
|||||||
@@ -227,9 +227,7 @@ namespace Aaru.CommonTypes.Structs
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Information about a volume</summary>
|
||||||
/// Information about a volume
|
|
||||||
/// </summary>
|
|
||||||
public class FileSystemInfo
|
public class FileSystemInfo
|
||||||
{
|
{
|
||||||
/// <summary>Blocks for this filesystem</summary>
|
/// <summary>Blocks for this filesystem</summary>
|
||||||
@@ -249,53 +247,35 @@ namespace Aaru.CommonTypes.Structs
|
|||||||
/// <summary>Filesystem type</summary>
|
/// <summary>Filesystem type</summary>
|
||||||
public string Type;
|
public string Type;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Initializes an empty instance of this structure</summary>
|
||||||
/// Initializes an empty instance of this structure
|
|
||||||
/// </summary>
|
|
||||||
public FileSystemInfo() => Id = new FileSystemId();
|
public FileSystemInfo() => Id = new FileSystemId();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Gets a clone of this structure</summary>
|
||||||
/// Gets a clone of this structure
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>Clone of this structure</returns>
|
/// <returns>Clone of this structure</returns>
|
||||||
public FileSystemInfo ShallowCopy() => (FileSystemInfo)MemberwiseClone();
|
public FileSystemInfo ShallowCopy() => (FileSystemInfo)MemberwiseClone();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Stores a filesystem volume unique identifier or serial number</summary>
|
||||||
/// Stores a filesystem volume unique identifier or serial number
|
|
||||||
/// </summary>
|
|
||||||
[StructLayout(LayoutKind.Explicit)]
|
[StructLayout(LayoutKind.Explicit)]
|
||||||
public struct FileSystemId
|
public struct FileSystemId
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Set to <c>true</c> if the identifier is a 32-bit integer</summary>
|
||||||
/// Set to <c>true</c> if the identifier is a 32-bit integer
|
|
||||||
/// </summary>
|
|
||||||
[FieldOffset(0)]
|
[FieldOffset(0)]
|
||||||
public bool IsInt;
|
public bool IsInt;
|
||||||
/// <summary>
|
/// <summary>Set to <c>true</c> if the identifier is a 64-bit integer</summary>
|
||||||
/// Set to <c>true</c> if the identifier is a 64-bit integer
|
|
||||||
/// </summary>
|
|
||||||
[FieldOffset(1)]
|
[FieldOffset(1)]
|
||||||
public bool IsLong;
|
public bool IsLong;
|
||||||
/// <summary>
|
/// <summary>Set to <c>true</c> if the identifier is a GUID</summary>
|
||||||
/// Set to <c>true</c> if the identifier is a GUID
|
|
||||||
/// </summary>
|
|
||||||
[FieldOffset(2)]
|
[FieldOffset(2)]
|
||||||
public bool IsGuid;
|
public bool IsGuid;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Identifier as a 32-bit integer</summary>
|
||||||
/// Identifier as a 32-bit integer
|
|
||||||
/// </summary>
|
|
||||||
[FieldOffset(3)]
|
[FieldOffset(3)]
|
||||||
public uint Serial32;
|
public uint Serial32;
|
||||||
/// <summary>
|
/// <summary>Identifier as a 64-bit integer</summary>
|
||||||
/// Identifier as a 64-bit integer
|
|
||||||
/// </summary>
|
|
||||||
[FieldOffset(3)]
|
[FieldOffset(3)]
|
||||||
public ulong Serial64;
|
public ulong Serial64;
|
||||||
/// <summary>
|
/// <summary>Identifier as a GUID</summary>
|
||||||
/// Identifier as a GUID
|
|
||||||
/// </summary>
|
|
||||||
[FieldOffset(3)]
|
[FieldOffset(3)]
|
||||||
public Guid uuid;
|
public Guid uuid;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -167,9 +167,7 @@ namespace Aaru.CommonTypes.Structs
|
|||||||
/// <summary>Partition type</summary>
|
/// <summary>Partition type</summary>
|
||||||
public TrackType TrackType;
|
public TrackType TrackType;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>Initializes an empty instance of this structure</summary>
|
||||||
/// Initializes an empty instance of this structure
|
|
||||||
/// </summary>
|
|
||||||
public Track() => Indexes = new Dictionary<ushort, int>();
|
public Track() => Indexes = new Dictionary<ushort, int>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,9 +38,7 @@
|
|||||||
|
|
||||||
namespace Aaru.CommonTypes.Structs
|
namespace Aaru.CommonTypes.Structs
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Describes a tape file</summary>
|
||||||
/// Describes a tape file
|
|
||||||
/// </summary>
|
|
||||||
public struct TapeFile
|
public struct TapeFile
|
||||||
{
|
{
|
||||||
/// <summary>File number</summary>
|
/// <summary>File number</summary>
|
||||||
|
|||||||
@@ -38,9 +38,7 @@
|
|||||||
|
|
||||||
namespace Aaru.CommonTypes.Structs
|
namespace Aaru.CommonTypes.Structs
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>Describes a tape partition</summary>
|
||||||
/// Describes a tape partition
|
|
||||||
/// </summary>
|
|
||||||
public struct TapePartition
|
public struct TapePartition
|
||||||
{
|
{
|
||||||
/// <summary>Partition number</summary>
|
/// <summary>Partition number</summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user