Added server side code for creating

http://discimagechef.claunia.com with statistics and device
	reports.
This commit is contained in:
2017-06-03 01:19:47 +01:00
parent 64e95a31f9
commit 39e72a1cf9
24 changed files with 4988 additions and 1008 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -36,12 +36,59 @@
// ****************************************************************************/
// //$Id$
using System;
using System.Collections.Generic;
using DiscImageChef.Metadata;
namespace DiscImageChef.Server.App_Start
{
public class ScsiEvpd
public static class ScsiEvpd
{
public ScsiEvpd()
public static void Report(pageType[] pages, string vendor, ref Dictionary<string, string> evpdPages)
{
foreach(pageType evpd in pages)
{
if(evpd.page >= 0x01 && evpd.page <= 0x7F)
evpdPages.Add(string.Format("EVPD page {0:X2}h", evpd.page), Decoders.SCSI.EVPD.DecodeASCIIPage(evpd.value).Replace("\n", "<br/>"));
else if(evpd.page == 0x81)
evpdPages.Add(string.Format("EVPD page {0:X2}h", evpd.page), Decoders.SCSI.EVPD.PrettifyPage_81(evpd.value).Replace("\n", "<br/>"));
else if(evpd.page == 0x82)
evpdPages.Add(string.Format("EVPD page {0:X2}h", evpd.page), Decoders.SCSI.EVPD.DecodePage82(evpd.value).Replace("\n", "<br/>"));
else if(evpd.page == 0x83)
evpdPages.Add(string.Format("EVPD page {0:X2}h", evpd.page), Decoders.SCSI.EVPD.PrettifyPage_83(evpd.value).Replace("\n", "<br/>"));
else if(evpd.page == 0x84)
evpdPages.Add(string.Format("EVPD page {0:X2}h", evpd.page), Decoders.SCSI.EVPD.PrettifyPage_84(evpd.value).Replace("\n", "<br/>"));
else if(evpd.page == 0x85)
evpdPages.Add(string.Format("EVPD page {0:X2}h", evpd.page), Decoders.SCSI.EVPD.PrettifyPage_85(evpd.value).Replace("\n", "<br/>"));
else if(evpd.page == 0x86)
evpdPages.Add(string.Format("EVPD page {0:X2}h", evpd.page), Decoders.SCSI.EVPD.PrettifyPage_86(evpd.value).Replace("\n", "<br/>"));
else if(evpd.page == 0x89)
evpdPages.Add(string.Format("EVPD page {0:X2}h", evpd.page), Decoders.SCSI.EVPD.PrettifyPage_89(evpd.value).Replace("\n", "<br/>"));
else if(evpd.page == 0xB0)
evpdPages.Add(string.Format("EVPD page {0:X2}h", evpd.page), Decoders.SCSI.EVPD.PrettifyPage_B0(evpd.value).Replace("\n", "<br/>"));
else if(evpd.page == 0xB2)
evpdPages.Add(string.Format("EVPD page {0:X2}h", evpd.page), string.Format("TapeAlert Supported Flags Bitmap: 0x{0:X16}<br/>", Decoders.SCSI.EVPD.DecodePageB2(evpd.value)));
else if(evpd.page == 0xB4)
evpdPages.Add(string.Format("EVPD page {0:X2}h", evpd.page), Decoders.SCSI.EVPD.DecodePageB4(evpd.value).Replace("\n", "<br/>"));
else if(evpd.page == 0xC0 && vendor.Trim() == "quantum")
evpdPages.Add(string.Format("EVPD page {0:X2}h", evpd.page), Decoders.SCSI.EVPD.PrettifyPage_C0_Quantum(evpd.value).Replace("\n", "<br/>"));
else if(evpd.page == 0xC0 && vendor.Trim() == "seagate")
evpdPages.Add(string.Format("EVPD page {0:X2}h", evpd.page), Decoders.SCSI.EVPD.PrettifyPage_C0_Seagate(evpd.value).Replace("\n", "<br/>"));
else if(evpd.page == 0xC0 && vendor.Trim() == "ibm")
evpdPages.Add(string.Format("EVPD page {0:X2}h", evpd.page), Decoders.SCSI.EVPD.PrettifyPage_C0_IBM(evpd.value).Replace("\n", "<br/>"));
else if(evpd.page == 0xC1 && vendor.Trim() == "ibm")
evpdPages.Add(string.Format("EVPD page {0:X2}h", evpd.page), Decoders.SCSI.EVPD.PrettifyPage_C1_IBM(evpd.value).Replace("\n", "<br/>"));
else if((evpd.page == 0xC0 || evpd.page == 0xC1) && vendor.Trim() == "certance")
evpdPages.Add(string.Format("EVPD page {0:X2}h", evpd.page), Decoders.SCSI.EVPD.PrettifyPage_C0_C1_Certance(evpd.value).Replace("\n", "<br/>"));
else if((evpd.page == 0xC2 || evpd.page == 0xC3 || evpd.page == 0xC4 || evpd.page == 0xC5 || evpd.page == 0xC6) &&
vendor.Trim() == "certance")
evpdPages.Add(string.Format("EVPD page {0:X2}h", evpd.page), Decoders.SCSI.EVPD.PrettifyPage_C2_C3_C4_C5_C6_Certance(evpd.value).Replace("\n", "<br/>"));
else if((evpd.page == 0xC0 || evpd.page == 0xC1 || evpd.page == 0xC2 || evpd.page == 0xC3 || evpd.page == 0xC4 || evpd.page == 0xC5) &&
vendor.Trim() == "hp")
evpdPages.Add(string.Format("EVPD page {0:X2}h", evpd.page), Decoders.SCSI.EVPD.PrettifyPage_C0_to_C5_HP(evpd.value).Replace("\n", "<br/>"));
else if(evpd.page == 0xDF && vendor.Trim() == "certance")
evpdPages.Add(string.Format("EVPD page {0:X2}h", evpd.page), Decoders.SCSI.EVPD.PrettifyPage_DF_Certance(evpd.value).Replace("\n", "<br/>"));
else
evpdPages.Add(string.Format("EVPD page {0:X2}h", evpd.page), "Undecoded");
}
}
}
}

View File

@@ -36,12 +36,346 @@
// ****************************************************************************/
// //$Id$
using System;
using System.Collections.Generic;
using DiscImageChef.Decoders.SCSI.MMC;
using DiscImageChef.Metadata;
namespace DiscImageChef.Server.App_Start
{
public class ScsiMmcFeatures
public static class ScsiMmcFeatures
{
public ScsiMmcFeatures()
public static void Report(mmcFeaturesType ftr, ref List<string> mmcOneValue)
{
if(ftr.SupportsAACS && ftr.AACSVersionSpecified)
mmcOneValue.Add(string.Format("Drive supports AACS version {0}", ftr.AACSVersion));
else if(ftr.SupportsAACS)
mmcOneValue.Add("Drive supports AACS");
if(ftr.AGIDsSpecified)
mmcOneValue.Add(string.Format("Drive supports {0} AGIDs concurrently", ftr.AGIDs));
if(ftr.CanGenerateBindingNonce)
{
mmcOneValue.Add("Drive supports generating the binding nonce");
if(ftr.BindingNonceBlocksSpecified)
mmcOneValue.Add(string.Format("{0} media blocks are required for the binding nonce", ftr.BindingNonceBlocks));
}
if(ftr.BlocksPerReadableUnit > 1)
mmcOneValue.Add(string.Format("{0} logical blocks per media writable unit", ftr.BlocksPerReadableUnit));
if(ftr.BufferUnderrunFreeInDVD)
mmcOneValue.Add("Drive supports zero loss linking writing DVDs");
if(ftr.BufferUnderrunFreeInSAO)
mmcOneValue.Add("Drive supports zero loss linking in Session at Once Mode");
if(ftr.BufferUnderrunFreeInTAO)
mmcOneValue.Add("Drive supports zero loss linking in Track at Once Mode");
if(ftr.CanAudioScan)
mmcOneValue.Add("Drive supports the SCAN command");
if(ftr.CanEject)
mmcOneValue.Add("Drive can eject media");
if(ftr.CanEraseSector)
mmcOneValue.Add("Drive supports media that require erasing before writing");
if(ftr.CanExpandBDRESpareArea)
mmcOneValue.Add("Drive can expand the spare area on a formatted BD-RE disc");
if(ftr.CanFormat)
mmcOneValue.Add("Drive can format media into logical blocks");
if(ftr.CanFormatBDREWithoutSpare)
mmcOneValue.Add("Drive can format BD-RE with no spares allocated");
if(ftr.CanFormatQCert)
mmcOneValue.Add("Drive can format BD-RE discs with quick certification");
if(ftr.CanFormatCert)
mmcOneValue.Add("Drive can format BD-RE discs with full certification");
if(ftr.CanFormatFRF)
mmcOneValue.Add("Drive can fast re-format BD-RE discs");
if(ftr.CanFormatRRM)
mmcOneValue.Add("Drive can format BD-R discs with RRM format");
if(ftr.CanLoad)
mmcOneValue.Add("Drive can load media");
if(ftr.CanMuteSeparateChannels)
mmcOneValue.Add("Drive is able to mute channels separately");
if(ftr.CanOverwriteSAOTrack)
mmcOneValue.Add("Drive can overwrite a SAO track with another in CD-RWs");
if(ftr.CanOverwriteTAOTrack)
mmcOneValue.Add("Drive can overwrite a TAO track with another in CD-RWs");
if(ftr.CanPlayCDAudio)
mmcOneValue.Add("Drive has an analogue audio output");
if(ftr.CanPseudoOverwriteBDR)
mmcOneValue.Add("Drive can write BD-R on Pseudo-OVerwrite SRM mode");
if(ftr.CanReadAllDualR)
mmcOneValue.Add("Drive can read DVD-R DL from all recording modes");
if(ftr.CanReadAllDualRW)
mmcOneValue.Add("Drive can read DVD-RW DL from all recording modes");
if(ftr.CanReadBD)
mmcOneValue.Add("Drive can read BD-ROM");
if(ftr.CanReadBDR)
mmcOneValue.Add("Drive can read BD-R Ver.1");
if(ftr.CanReadBDRE1)
mmcOneValue.Add("Drive can read BD-RE Ver.1");
if(ftr.CanReadBDRE2)
mmcOneValue.Add("Drive can read BD-RE Ver.2");
if(ftr.CanReadBDROM)
mmcOneValue.Add("Drive can read BD-ROM Ver.1");
if(ftr.CanReadBluBCA)
mmcOneValue.Add("Drive can read BD's Burst Cutting Area");
if(ftr.CanReadCD)
mmcOneValue.Add("Drive can read CD-ROM");
if(ftr.CanWriteCDMRW && ftr.CanReadDVDPlusMRW && ftr.CanWriteDVDPlusMRW)
mmcOneValue.Add("Drive can read and write CD-MRW and DVD+MRW");
else if(ftr.CanReadDVDPlusMRW && ftr.CanWriteDVDPlusMRW)
mmcOneValue.Add("Drive can read and write DVD+MRW");
else if(ftr.CanWriteCDMRW && ftr.CanReadDVDPlusMRW)
mmcOneValue.Add("Drive and read DVD+MRW and read and write CD-MRW");
else if(ftr.CanWriteCDMRW)
mmcOneValue.Add("Drive can read and write CD-MRW");
else if(ftr.CanReadDVDPlusMRW)
mmcOneValue.Add("Drive can read CD-MRW and DVD+MRW");
else if(ftr.CanReadCDMRW)
mmcOneValue.Add("Drive can read CD-MRW");
if(ftr.CanReadCPRM_MKB)
mmcOneValue.Add("Drive supports reading Media Key Block of CPRM");
if(ftr.CanReadDDCD)
mmcOneValue.Add("Drive can read DDCDs");
if(ftr.CanReadDVD)
mmcOneValue.Add("Drive can read DVD");
if(ftr.CanWriteDVDPlusRW)
mmcOneValue.Add("Drive can read and write DVD+RW");
else if(ftr.CanReadDVDPlusRW)
mmcOneValue.Add("Drive can read DVD+RW");
if(ftr.CanWriteDVDPlusR)
mmcOneValue.Add("Drive can read and write DVD+R");
else if(ftr.CanReadDVDPlusR)
mmcOneValue.Add("Drive can read DVD+R");
if(ftr.CanWriteDVDPlusRDL)
mmcOneValue.Add("Drive can read and write DVD+R DL");
else if(ftr.CanReadDVDPlusRDL)
mmcOneValue.Add("Drive can read DVD+R DL");
if(ftr.CanReadDriveAACSCertificate)
mmcOneValue.Add("Drive supports reading the Drive Certificate");
if(ftr.CanReadHDDVD && ftr.CanReadHDDVDR && ftr.CanReadHDDVDRAM)
mmcOneValue.Add("Drive can read HD DVD-ROM, HD DVD-RW, HD DVD-R and HD DVD-RAM");
else if(ftr.CanReadHDDVD && ftr.CanReadHDDVDR)
mmcOneValue.Add("Drive can read HD DVD-ROM, HD DVD-RW and HD DVD-R");
else if(ftr.CanReadHDDVD && ftr.CanReadHDDVDRAM)
mmcOneValue.Add("Drive can read HD DVD-ROM, HD DVD-RW and HD DVD-RAM");
else if(ftr.CanReadHDDVD)
mmcOneValue.Add("Drive can read HD DVD-ROM and HD DVD-RW");
if(ftr.CanReadLeadInCDText)
mmcOneValue.Add("Drive can return CD-Text from Lead-In");
if(ftr.CanReadOldBDR)
mmcOneValue.Add("Drive can read BD-R pre-1.0");
if(ftr.CanReadOldBDRE)
mmcOneValue.Add("Drive can read BD-RE pre-1.0");
if(ftr.CanReadOldBDROM)
mmcOneValue.Add("Drive can read BD-ROM pre-1.0");
if(ftr.CanReadSpareAreaInformation)
mmcOneValue.Add("Drive can return Spare Area Information");
if(ftr.CanReportDriveSerial)
mmcOneValue.Add("Drive is to report drive serial number");
if(ftr.CanReportMediaSerial)
mmcOneValue.Add("Drive is to read media serial number");
if(ftr.CanTestWriteDDCDR)
mmcOneValue.Add("Drive can do a test writing with DDCD-R");
if(ftr.CanTestWriteDVD)
mmcOneValue.Add("Drive can do a test writing with DVDs");
if(ftr.CanTestWriteInSAO)
mmcOneValue.Add("Drive can do a test writing in Session at Once Mode");
if(ftr.CanTestWriteInTAO)
mmcOneValue.Add("Drive can do a test writing in Track at Once Mode");
if(ftr.CanUpgradeFirmware)
mmcOneValue.Add("Drive supports Microcode Upgrade");
if(ftr.ErrorRecoveryPage)
mmcOneValue.Add("Drive shall report Read/Write Error Recovery mode page");
if(ftr.Locked)
mmcOneValue.Add("Drive can lock media");
if(ftr.LogicalBlockSize > 0)
mmcOneValue.Add(string.Format("{0} bytes per logical block", ftr.LogicalBlockSize));
if(ftr.MultiRead)
mmcOneValue.Add("Drive claims capability to read all CD formats according to OSTA Multi-Read Specification");
switch(ftr.PhysicalInterfaceStandard)
{
case PhysicalInterfaces.Unspecified:
mmcOneValue.Add("Drive uses an unspecified physical interface");
break;
case PhysicalInterfaces.SCSI:
mmcOneValue.Add("Drive uses SCSI interface");
break;
case PhysicalInterfaces.ATAPI:
mmcOneValue.Add("Drive uses ATAPI interface");
break;
case PhysicalInterfaces.IEEE1394:
mmcOneValue.Add("Drive uses IEEE-1394 interface");
break;
case PhysicalInterfaces.IEEE1394A:
mmcOneValue.Add("Drive uses IEEE-1394A interface");
break;
case PhysicalInterfaces.FC:
mmcOneValue.Add("Drive uses Fibre Channel interface");
break;
case PhysicalInterfaces.IEEE1394B:
mmcOneValue.Add("Drive uses IEEE-1394B interface");
break;
case PhysicalInterfaces.SerialATAPI:
mmcOneValue.Add("Drive uses Serial ATAPI interface");
break;
case PhysicalInterfaces.USB:
mmcOneValue.Add("Drive uses USB interface");
break;
case PhysicalInterfaces.Vendor:
mmcOneValue.Add("Drive uses a vendor unique interface");
break;
default:
mmcOneValue.Add(string.Format("Drive uses an unknown interface with code {0}", (uint)ftr.PhysicalInterfaceStandard));
break;
}
if(ftr.PreventJumper)
mmcOneValue.Add("Drive power ups locked");
if(ftr.SupportsBusEncryption)
mmcOneValue.Add("Drive supports bus encryption");
if(ftr.CanWriteBD)
mmcOneValue.Add("Drive can write BD-R or BD-RE");
if(ftr.CanWriteBDR)
mmcOneValue.Add("Drive can write BD-R Ver.1");
if(ftr.CanWriteBDRE1)
mmcOneValue.Add("Drive can write BD-RE Ver.1");
if(ftr.CanWriteBDRE2)
mmcOneValue.Add("Drive can write BD-RE Ver.2");
if(ftr.CanWriteBusEncryptedBlocks)
mmcOneValue.Add("Drive supports writing with bus encryption");
if(ftr.CanWriteCDRW)
mmcOneValue.Add("Drive can write CD-RW");
if(ftr.CanWriteCDRWCAV)
mmcOneValue.Add("Drive can write High-Speed CD-RW");
if(ftr.CanWriteCDSAO && !ftr.CanWriteRaw)
mmcOneValue.Add("Drive can write CDs in Session at Once Mode:");
else if(!ftr.CanWriteCDSAO && ftr.CanWriteRaw)
mmcOneValue.Add("Drive can write CDs in raw Mode:");
else if(ftr.CanWriteCDSAO && ftr.CanWriteRaw)
mmcOneValue.Add("Drive can write CDs in Session at Once and in Raw Modes:");
if(ftr.CanWriteCDTAO)
mmcOneValue.Add("Drive can write CDs in Track at Once Mode:");
if(ftr.CanWriteCSSManagedDVD)
mmcOneValue.Add("Drive can write CSS managed DVDs");
if(ftr.CanWriteDDCDR)
mmcOneValue.Add("Drive supports writing DDCD-R");
if(ftr.CanWriteDDCDRW)
mmcOneValue.Add("Drive supports writing DDCD-RW");
if(ftr.CanWriteDVDPlusRWDL)
mmcOneValue.Add("Drive can read and write DVD+RW DL");
else if(ftr.CanReadDVDPlusRWDL)
mmcOneValue.Add("Drive can read DVD+RW DL");
if(ftr.CanWriteDVDR && ftr.CanWriteDVDRW && ftr.CanWriteDVDRDL)
mmcOneValue.Add("Drive supports writing DVD-R, DVD-RW and DVD-R DL");
else if(ftr.CanWriteDVDR && ftr.CanWriteDVDRDL)
mmcOneValue.Add("Drive supports writing DVD-R and DVD-R DL");
else if(ftr.CanWriteDVDR && ftr.CanWriteDVDRW)
mmcOneValue.Add("Drive supports writing DVD-R and DVD-RW");
else if(ftr.CanWriteDVDR)
mmcOneValue.Add("Drive supports writing DVD-R");
if(ftr.CanWriteHDDVDR && ftr.CanWriteHDDVDRAM)
mmcOneValue.Add("Drive can write HD DVD-RW, HD DVD-R and HD DVD-RAM");
else if(ftr.CanWriteHDDVDR)
mmcOneValue.Add("Drive can write HD DVD-RW and HD DVD-R");
else if(ftr.CanWriteHDDVDRAM)
mmcOneValue.Add("Drive can write HD DVD-RW and HD DVD-RAM");
// TODO: Write HD DVD-RW
/*
else
mmcOneValue.Add("Drive can write HD DVD-RW");
*/
if(ftr.CanWriteOldBDR)
mmcOneValue.Add("Drive can write BD-R pre-1.0");
if(ftr.CanWriteOldBDRE)
mmcOneValue.Add("Drive can write BD-RE pre-1.0");
if(ftr.CanWriteRWSubchannelInTAO)
{
mmcOneValue.Add("Drive can write user provided data in the R-W subchannels in Track at Once Mode");
if(ftr.CanWriteRawSubchannelInTAO)
mmcOneValue.Add("Drive accepts RAW R-W subchannel data in Track at Once Mode");
if(ftr.CanWritePackedSubchannelInTAO)
mmcOneValue.Add("Drive accepts Packed R-W subchannel data in Track at Once Mode");
}
if(ftr.CanWriteRWSubchannelInSAO)
mmcOneValue.Add("Drive can write user provided data in the R-W subchannels in Session at Once Mode");
if(ftr.CanWriteRaw && ftr.CanWriteRawMultiSession)
mmcOneValue.Add("Drive can write multi-session CDs in raw mode");
if(ftr.EmbeddedChanger)
{
mmcOneValue.Add("Drive contains an embedded changer");
if(ftr.ChangerIsSideChangeCapable)
mmcOneValue.Add("Drive can change disc side");
if(ftr.ChangerSupportsDiscPresent)
mmcOneValue.Add("Drive is able to report slots contents after a reset or change");
mmcOneValue.Add(string.Format("Drive has {0} slots", ftr.ChangerSlots + 1));
}
if(ftr.SupportsCSS && ftr.CSSVersionSpecified)
mmcOneValue.Add(string.Format("Drive supports DVD CSS/CPPM version {0}", ftr.CSSVersion));
else if(ftr.SupportsCSS)
mmcOneValue.Add("Drive supports DVD CSS/CPRM");
if(ftr.SupportsCPRM && ftr.CPRMVersionSpecified)
mmcOneValue.Add(string.Format("Drive supports DVD CPPM version {0}", ftr.CPRMVersion));
else if(ftr.SupportsCPRM)
mmcOneValue.Add("Drive supports DVD CPRM");
if(ftr.DBML)
mmcOneValue.Add("Drive reports Device Busy Class events during medium loading/unloading");
if(ftr.DVDMultiRead)
mmcOneValue.Add("Drive conforms to DVD Multi Drive Read-only Specifications");
if(ftr.FirmwareDateSpecified)
mmcOneValue.Add(string.Format("Drive firmware is dated {0}", ftr.FirmwareDate));
if(ftr.SupportsC2)
mmcOneValue.Add("Drive supports C2 Error Pointers");
if(ftr.SupportsDAP)
mmcOneValue.Add("Drive supports the DAP bit in the READ CD and READ CD MSF commands");
if(ftr.SupportsDeviceBusyEvent)
mmcOneValue.Add("Drive supports Device Busy events");
switch(ftr.LoadingMechanismType)
{
case 0:
mmcOneValue.Add("Drive uses media caddy");
break;
case 1:
mmcOneValue.Add("Drive uses a tray");
break;
case 2:
mmcOneValue.Add("Drive is pop-up");
break;
case 4:
mmcOneValue.Add("Drive is a changer with individually changeable discs");
break;
case 5:
mmcOneValue.Add("Drive is a changer using cartridges");
break;
default:
mmcOneValue.Add(string.Format("Drive uses unknown loading mechanism type {0}", ftr.LoadingMechanismType));
break;
}
if(ftr.SupportsHybridDiscs)
mmcOneValue.Add("Drive is able to access Hybrid discs");
if(ftr.SupportsModePage1Ch)
mmcOneValue.Add("Drive supports the Informational Exceptions Control mode page 1Ch");
if(ftr.SupportsOSSC)
mmcOneValue.Add("Drive supports the Trusted Computing Group Optical Security Subsystem Class");
if(ftr.SupportsPWP)
mmcOneValue.Add("Drive supports set/release of PWP status");
if(ftr.SupportsSWPP)
mmcOneValue.Add("Drive supports the SWPP bit of the Timeout and Protect mode page");
if(ftr.SupportsSecurDisc)
mmcOneValue.Add("Drive supports SecurDisc");
if(ftr.SupportsSeparateVolume)
mmcOneValue.Add("Drive supports separate volume per channel");
if(ftr.SupportsVCPS)
mmcOneValue.Add("Drive supports VCPS");
if(ftr.VolumeLevelsSpecified)
mmcOneValue.Add(string.Format("Drive has {0} volume levels", ftr.VolumeLevels + 1));
if(ftr.SupportsWriteProtectPAC)
mmcOneValue.Add("Drive supports reading/writing the Disc Write Protect PAC on BD-R/-RE media");
if(ftr.SupportsWriteInhibitDCB)
mmcOneValue.Add("Drive supports writing the Write Inhibit DCB on DVD+RW media");
mmcOneValue.Sort();
mmcOneValue.Add("");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -36,12 +36,395 @@
// ****************************************************************************/
// //$Id$
using System;
using System.Collections.Generic;
using DiscImageChef.Metadata;
using DiscImageChef.Decoders.SCSI;
namespace DiscImageChef.Server.App_Start
{
public class ScsiModeSense
public static class ScsiModeSense
{
public ScsiModeSense()
public static void Report(modeType modeSense, string vendor, PeripheralDeviceTypes deviceType, ref List<string> scsiOneValue, ref Dictionary<string, string> modePages)
{
if(modeSense.MediumTypeSpecified)
scsiOneValue.Add(string.Format("Medium type is {0:X2}h", modeSense.MediumType));
if(modeSense.WriteProtected)
scsiOneValue.Add("Device is write protected.");
if(modeSense.BlockDescriptors != null)
{
foreach(blockDescriptorType descriptor in modeSense.BlockDescriptors)
{
if(descriptor.BlocksSpecified && descriptor.BlockLengthSpecified)
scsiOneValue.Add(string.Format("Density code {0:X2}h has {1} blocks of {2} bytes each",
descriptor.Density, descriptor.Blocks, descriptor.BlockLength));
else
scsiOneValue.Add(string.Format("Density code {0:X2}h", descriptor.Density));
}
}
if(modeSense.DPOandFUA)
scsiOneValue.Add("Drive supports DPO and FUA bits");
if(modeSense.BlankCheckEnabled)
scsiOneValue.Add("Blank checking during write is enabled");
if(modeSense.BufferedModeSpecified)
{
switch(modeSense.BufferedMode)
{
case 0:
scsiOneValue.Add("Device writes directly to media");
break;
case 1:
scsiOneValue.Add("Device uses a write cache");
break;
case 2:
scsiOneValue.Add("Device uses a write cache but doesn't return until cache is flushed");
break;
default:
scsiOneValue.Add(string.Format("Unknown buffered mode code 0x{0:X2}", modeSense.BufferedMode));
break;
}
}
if(modeSense.ModePages != null)
{
foreach(modePageType page in modeSense.ModePages)
{
switch(page.page)
{
case 0x00:
{
if(deviceType == PeripheralDeviceTypes.MultiMediaDevice && page.subpage == 0)
modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyModePage_00_SFF(page.value));
else
{
if(page.subpage != 0)
modePages.Add(string.Format("MODE page {0:X2}h subpage {1:X2}h", page.page, page.subpage), "Unknown vendor mode page");
else
modePages.Add(string.Format("MODE page {0:X2}h", page.page), "Unknown vendor mode page");
}
break;
}
case 0x01:
{
if(page.subpage == 0)
{
if(deviceType == PeripheralDeviceTypes.MultiMediaDevice)
modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyModePage_01_MMC(page.value));
else
modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyModePage_01(page.value));
}
else
goto default;
break;
}
case 0x02:
{
if(page.subpage == 0)
modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyModePage_02(page.value));
else
goto default;
break;
}
case 0x03:
{
if(page.subpage == 0)
modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyModePage_03(page.value));
else
goto default;
break;
}
case 0x04:
{
if(page.subpage == 0)
modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyModePage_04(page.value));
else
goto default;
break;
}
case 0x05:
{
if(page.subpage == 0)
modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyModePage_05(page.value));
else
goto default;
break;
}
case 0x06:
{
if(page.subpage == 0)
modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyModePage_06(page.value));
else
goto default;
break;
}
case 0x07:
{
if(page.subpage == 0)
{
if(deviceType == PeripheralDeviceTypes.MultiMediaDevice)
modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyModePage_07_MMC(page.value));
else
modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyModePage_07(page.value));
}
else
goto default;
break;
}
case 0x08:
{
if(page.subpage == 0)
modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyModePage_08(page.value));
else
goto default;
break;
}
case 0x0A:
{
if(page.subpage == 0)
modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyModePage_0A(page.value));
else if(page.subpage == 1)
modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyModePage_0A_S01(page.value));
else
goto default;
break;
}
case 0x0B:
{
if(page.subpage == 0)
modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyModePage_0B(page.value));
else
goto default;
break;
}
case 0x0D:
{
if(page.subpage == 0)
modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyModePage_0D(page.value));
else
goto default;
break;
}
case 0x0E:
{
if(page.subpage == 0)
modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyModePage_0E(page.value));
else
goto default;
break;
}
case 0x0F:
{
if(page.subpage == 0)
modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyModePage_0F(page.value));
else
goto default;
break;
}
case 0x10:
{
if(page.subpage == 0)
{
if(deviceType == Decoders.SCSI.PeripheralDeviceTypes.SequentialAccess)
modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyModePage_10_SSC(page.value));
else
modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyModePage_10(page.value));
}
else
goto default;
break;
}
case 0x11:
{
if(page.subpage == 0)
modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyModePage_11(page.value));
else
goto default;
break;
}
case 0x12:
case 0x13:
case 0x14:
{
if(page.subpage == 0)
modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyModePage_12_13_14(page.value));
else
goto default;
break;
}
case 0x1A:
{
if(page.subpage == 0)
modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyModePage_1A(page.value));
else if(page.subpage == 1)
modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyModePage_1A_S01(page.value));
else
goto default;
break;
}
case 0x1B:
{
if(page.subpage == 0)
modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyModePage_1B(page.value));
else
goto default;
break;
}
case 0x1C:
{
if(page.subpage == 0)
{
if(deviceType == PeripheralDeviceTypes.MultiMediaDevice)
modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyModePage_1C_SFF(page.value));
else
modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyModePage_1C(page.value));
}
else if(page.subpage == 1)
modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyModePage_1C_S01(page.value));
else
goto default;
break;
}
case 0x1D:
{
if(page.subpage == 0)
modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyModePage_1D(page.value));
else
goto default;
break;
}
case 0x21:
{
if(vendor == "CERTANCE")
modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyCertanceModePage_21(page.value));
else
goto default;
break;
}
case 0x22:
{
if(vendor == "CERTANCE")
modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyCertanceModePage_22(page.value));
else
goto default;
break;
}
case 0x24:
{
if(vendor == "IBM")
modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyIBMModePage_24(page.value));
else
goto default;
break;
}
case 0x2A:
{
if(page.subpage == 0)
modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyModePage_2A(page.value));
else
goto default;
break;
}
case 0x2F:
{
if(vendor == "IBM")
modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyIBMModePage_2F(page.value));
else
goto default;
break;
}
case 0x30:
{
if(Modes.IsAppleModePage_30(page.value))
modePages.Add("MODE page 30h", "Drive identifies as an Apple OEM drive");
else
goto default;
break;
}
case 0x3B:
{
if(vendor == "HP")
modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyHPModePage_3B(page.value));
else
goto default;
break;
}
case 0x3C:
{
if(vendor == "HP")
modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyHPModePage_3C(page.value));
else
goto default;
break;
}
case 0x3D:
{
if(vendor == "IBM")
modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyIBMModePage_3D(page.value));
else if(vendor == "HP")
modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyHPModePage_3D(page.value));
else
goto default;
break;
}
case 0x3E:
{
if(vendor == "FUJITSU")
modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyFujitsuModePage_3E(page.value));
else if(vendor == "HP")
modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyHPModePage_3E(page.value));
else
goto default;
break;
}
default:
{
if(page.subpage != 0)
modePages.Add(string.Format("MODE page {0:X2}h subpage {1:X2}h", page.page, page.subpage), "Unknown mode page");
else
modePages.Add(string.Format("MODE page {0:X2}h", page.page), "Unknown mode page");
}
break;
}
}
Dictionary<string, string> newModePages = new Dictionary<string, string>();
foreach(KeyValuePair<string, string> kvp in modePages)
{
if(string.IsNullOrWhiteSpace(kvp.Value))
newModePages.Add(kvp.Key, "Undecoded");
else
newModePages.Add(kvp.Key, kvp.Value.Replace("\n", "<br/>"));
}
modePages = newModePages;
}
}
}
}

View File

@@ -36,12 +36,42 @@
// ****************************************************************************/
// //$Id$
using System;
using System.Collections.Generic;
using DiscImageChef.Metadata;
namespace DiscImageChef.Server.App_Start
{
public class SscTestedMedia
public static class SscTestedMedia
{
public SscTestedMedia()
public static void Report(SequentialMedia[] testedMedia, ref List<string> mediaOneValue)
{
foreach(SequentialMedia media in testedMedia)
{
if(!string.IsNullOrWhiteSpace(media.MediumTypeName))
{
mediaOneValue.Add(string.Format("<i>Information for medium named \"{0}\"</i>", media.MediumTypeName));
if(media.MediumTypeSpecified)
mediaOneValue.Add(string.Format("Medium type code: {0:X2}h", media.MediumType));
}
else if(media.MediumTypeSpecified)
mediaOneValue.Add(string.Format("<i>Information for medium type {0:X2}h</i>", media.MediumType));
else
mediaOneValue.Add("<i>Information for unknown medium type</i>");
if(!string.IsNullOrWhiteSpace(media.Manufacturer))
mediaOneValue.Add(string.Format("Medium manufactured by: {0}", media.Manufacturer));
if(!string.IsNullOrWhiteSpace(media.Model))
mediaOneValue.Add(string.Format("Medium model: {0}", media.Model));
if(media.DensitySpecified)
mediaOneValue.Add(string.Format("Medium has density code {0:X2}h", media.Density));
if(media.CanReadMediaSerial)
mediaOneValue.Add("Drive can read medium serial number.");
if(media.MediaIsRecognized)
mediaOneValue.Add("DiscImageChef recognizes this medium.");
mediaOneValue.Add("");
}
}
}
}

View File

@@ -36,12 +36,278 @@
// ****************************************************************************/
// //$Id$
using System;
using System.Collections.Generic;
using DiscImageChef.Metadata;
namespace DiscImageChef.Server.App_Start
{
public class TestedMedia
public static class TestedMedia
{
public TestedMedia()
public static void Report(testedMediaType[] testedMedias, bool ata, ref List<string> mediaOneValue)
{
foreach(testedMediaType testedMedia in testedMedias)
{
if(!string.IsNullOrWhiteSpace(testedMedia.MediumTypeName))
{
mediaOneValue.Add(string.Format("<i>Information for medium named \"{0}\"</i>", testedMedia.MediumTypeName));
if(testedMedia.MediumTypeSpecified)
mediaOneValue.Add(string.Format("Medium type code: {0:X2}h", testedMedia.MediumType));
}
else if(testedMedia.MediumTypeSpecified)
mediaOneValue.Add(string.Format("<i>Information for medium type {0:X2}h</i>", testedMedia.MediumType));
else
mediaOneValue.Add("<i>Information for unknown medium type</i>");
if(testedMedia.MediaIsRecognized)
mediaOneValue.Add("Drive recognizes this medium.");
else
mediaOneValue.Add("Drive does not recognize this medium.");
if(!string.IsNullOrWhiteSpace(testedMedia.Manufacturer))
mediaOneValue.Add(string.Format("Medium manufactured by: {0}", testedMedia.Manufacturer));
if(!string.IsNullOrWhiteSpace(testedMedia.Model))
mediaOneValue.Add(string.Format("Medium model: {0}", testedMedia.Model));
if(testedMedia.DensitySpecified)
mediaOneValue.Add(string.Format("Density code: {0:X2}h", testedMedia.Density));
if(testedMedia.BlockSizeSpecified)
mediaOneValue.Add(string.Format("Logical sector size: {0} bytes", testedMedia.BlockSize));
if(testedMedia.PhysicalBlockSizeSpecified)
mediaOneValue.Add(string.Format("Physical sector size: {0} bytes", testedMedia.PhysicalBlockSize));
if(testedMedia.LongBlockSizeSpecified)
mediaOneValue.Add(string.Format("READ LONG sector size: {0} bytes", testedMedia.LongBlockSize));
if(testedMedia.BlocksSpecified && testedMedia.BlockSizeSpecified)
{
mediaOneValue.Add(string.Format("Medium has {0} blocks of {1} bytes each", testedMedia.Blocks, testedMedia.BlockSize));
if(((testedMedia.Blocks * testedMedia.BlockSize) / 1024 / 1024) > 1000000)
{
mediaOneValue.Add(string.Format("Medium size: {0} bytes, {1} Tb, {2} TiB", testedMedia.Blocks * testedMedia.BlockSize,
(testedMedia.Blocks * testedMedia.BlockSize) / 1000 / 1000 / 1000 / 1000, (testedMedia.Blocks * testedMedia.BlockSize) / 1024 / 1024 / 1024 / 1024));
}
else if(((testedMedia.Blocks * testedMedia.BlockSize) / 1024 / 1024) > 1000)
{
mediaOneValue.Add(string.Format("Medium size: {0} bytes, {1} Gb, {2} GiB", testedMedia.Blocks * testedMedia.BlockSize,
(testedMedia.Blocks * testedMedia.BlockSize) / 1000 / 1000 / 1000, (testedMedia.Blocks * testedMedia.BlockSize) / 1024 / 1024 / 1024));
}
else
{
mediaOneValue.Add(string.Format("Medium size: {0} bytes, {1} Mb, {2} MiB", testedMedia.Blocks * testedMedia.BlockSize,
(testedMedia.Blocks * testedMedia.BlockSize) / 1000 / 1000, (testedMedia.Blocks * testedMedia.BlockSize) / 1024 / 1024));
}
}
if(testedMedia.CHS != null && testedMedia.CurrentCHS != null)
{
int currentSectors = testedMedia.CurrentCHS.Cylinders * testedMedia.CurrentCHS.Heads * testedMedia.CurrentCHS.Sectors;
mediaOneValue.Add(string.Format("Cylinders: {0} max., {1} current", testedMedia.CHS.Cylinders, testedMedia.CurrentCHS.Cylinders));
mediaOneValue.Add(string.Format("Heads: {0} max., {1} current", testedMedia.CHS.Heads, testedMedia.CurrentCHS.Heads));
mediaOneValue.Add(string.Format("Sectors per track: {0} max., {1} current", testedMedia.CHS.Sectors, testedMedia.CurrentCHS.Sectors));
mediaOneValue.Add(string.Format("Sectors addressable in CHS mode: {0} max., {1} current", testedMedia.CHS.Cylinders * testedMedia.CHS.Heads * testedMedia.CHS.Sectors,
currentSectors));
mediaOneValue.Add(string.Format("Medium size in CHS mode: {0} bytes, {1} Mb, {2} MiB", (ulong)currentSectors * testedMedia.BlockSize,
((ulong)currentSectors * testedMedia.BlockSize) / 1000 / 1000, ((ulong)currentSectors * testedMedia.BlockSize) / 1024 / 1024));
}
if(testedMedia.LBASectorsSpecified)
{
mediaOneValue.Add(string.Format("Sectors addressable in sectors in 28-bit LBA mode: {0}", testedMedia.LBASectors));
if((((ulong)testedMedia.LBASectors * testedMedia.BlockSize) / 1024 / 1024) > 1000000)
{
mediaOneValue.Add(string.Format("Medium size in 28-bit LBA mode: {0} bytes, {1} Tb, {2} TiB", (ulong)testedMedia.LBASectors * testedMedia.BlockSize,
((ulong)testedMedia.LBASectors * testedMedia.BlockSize) / 1000 / 1000 / 1000 / 1000, ((ulong)testedMedia.LBASectors * testedMedia.BlockSize) / 1024 / 1024 / 1024 / 1024));
}
else if((((ulong)testedMedia.LBASectors * testedMedia.BlockSize) / 1024 / 1024) > 1000)
{
mediaOneValue.Add(string.Format("Medium size in 28-bit LBA mode: {0} bytes, {1} Gb, {2} GiB", (ulong)testedMedia.LBASectors * testedMedia.BlockSize,
((ulong)testedMedia.LBASectors * testedMedia.BlockSize) / 1000 / 1000 / 1000, ((ulong)testedMedia.LBASectors * testedMedia.BlockSize) / 1024 / 1024 / 1024));
}
else
{
mediaOneValue.Add(string.Format("Medium size in 28-bit LBA mode: {0} bytes, {1} Mb, {2} MiB", (ulong)testedMedia.LBASectors * testedMedia.BlockSize,
((ulong)testedMedia.LBASectors * testedMedia.BlockSize) / 1000 / 1000, ((ulong)testedMedia.LBASectors * testedMedia.BlockSize) / 1024 / 1024));
}
}
if(testedMedia.LBA48SectorsSpecified)
{
mediaOneValue.Add(string.Format("Sectors addressable in sectors in 48-bit LBA mode: {0}", testedMedia.LBA48Sectors));
if(((testedMedia.LBA48Sectors * testedMedia.BlockSize) / 1024 / 1024) > 1000000)
{
mediaOneValue.Add(string.Format("Medium size in 48-bit LBA mode: {0} bytes, {1} Tb, {2} TiB", testedMedia.LBA48Sectors * testedMedia.BlockSize,
(testedMedia.LBA48Sectors * testedMedia.BlockSize) / 1000 / 1000 / 1000 / 1000, (testedMedia.LBA48Sectors * testedMedia.BlockSize) / 1024 / 1024 / 1024 / 1024));
}
else if(((testedMedia.LBA48Sectors * testedMedia.BlockSize) / 1024 / 1024) > 1000)
{
mediaOneValue.Add(string.Format("Medium size in 48-bit LBA mode: {0} bytes, {1} Gb, {2} GiB", testedMedia.LBA48Sectors * testedMedia.BlockSize,
(testedMedia.LBA48Sectors * testedMedia.BlockSize) / 1000 / 1000 / 1000, (testedMedia.LBA48Sectors * testedMedia.BlockSize) / 1024 / 1024 / 1024));
}
else
{
mediaOneValue.Add(string.Format("Medium size in 48-bit LBA mode: {0} bytes, {1} Mb, {2} MiB", testedMedia.LBA48Sectors * testedMedia.BlockSize,
(testedMedia.LBA48Sectors * testedMedia.BlockSize) / 1000 / 1000, (testedMedia.LBA48Sectors * testedMedia.BlockSize) / 1024 / 1024));
}
}
if(testedMedia.NominalRotationRateSpecified &&
testedMedia.NominalRotationRate != 0x0000 &&
testedMedia.NominalRotationRate != 0xFFFF)
{
if(testedMedia.NominalRotationRate == 0x0001)
mediaOneValue.Add("Medium does not rotate.");
else
mediaOneValue.Add(string.Format("Medium rotates at {0} rpm", testedMedia.NominalRotationRate));
}
if(testedMedia.BlockSizeSpecified &&
testedMedia.PhysicalBlockSizeSpecified &&
(testedMedia.BlockSize != testedMedia.PhysicalBlockSize) &&
(testedMedia.LogicalAlignment & 0x8000) == 0x0000 &&
(testedMedia.LogicalAlignment & 0x4000) == 0x4000)
{
mediaOneValue.Add(string.Format("Logical sector starts at offset {0} from physical sector", testedMedia.LogicalAlignment & 0x3FFF));
}
if(testedMedia.SupportsRead && ata)
mediaOneValue.Add("Device can use the READ SECTOR(S) command in CHS mode with this medium");
if(testedMedia.SupportsReadRetry)
mediaOneValue.Add("Device can use the READ SECTOR(S) RETRY command in CHS mode with this medium");
if(testedMedia.SupportsReadDma)
mediaOneValue.Add("Device can use the READ DMA command in CHS mode with this medium");
if(testedMedia.SupportsReadDmaRetry)
mediaOneValue.Add("Device can use the READ DMA RETRY command in CHS mode with this medium");
if(testedMedia.SupportsReadLong && ata)
mediaOneValue.Add("Device can use the READ LONG command in CHS mode with this medium");
if(testedMedia.SupportsReadLongRetry)
mediaOneValue.Add("Device can use the READ LONG RETRY command in CHS mode with this medium");
if(testedMedia.SupportsReadLba)
mediaOneValue.Add("Device can use the READ SECTOR(S) command in 28-bit LBA mode with this medium");
if(testedMedia.SupportsReadRetryLba)
mediaOneValue.Add("Device can use the READ SECTOR(S) RETRY command in 28-bit LBA mode with this medium");
if(testedMedia.SupportsReadDmaLba)
mediaOneValue.Add("Device can use the READ DMA command in 28-bit LBA mode with this medium");
if(testedMedia.SupportsReadDmaRetryLba)
mediaOneValue.Add("Device can use the READ DMA RETRY command in 28-bit LBA mode with this medium");
if(testedMedia.SupportsReadLongLba)
mediaOneValue.Add("Device can use the READ LONG command in 28-bit LBA mode with this medium");
if(testedMedia.SupportsReadLongRetryLba)
mediaOneValue.Add("Device can use the READ LONG RETRY command in 28-bit LBA mode with this medium");
if(testedMedia.SupportsReadLba48)
mediaOneValue.Add("Device can use the READ SECTOR(S) command in 48-bit LBA mode with this medium");
if(testedMedia.SupportsReadDmaLba48)
mediaOneValue.Add("Device can use the READ DMA command in 48-bit LBA mode with this medium");
if(testedMedia.SupportsSeek)
mediaOneValue.Add("Device can use the SEEK command in CHS mode with this medium");
if(testedMedia.SupportsSeekLba)
mediaOneValue.Add("Device can use the SEEK command in 28-bit LBA mode with this medium");
if(testedMedia.SupportsReadCapacity)
mediaOneValue.Add("Device can use the READ CAPACITY (10) command with this medium");
if(testedMedia.SupportsReadCapacity16)
mediaOneValue.Add("Device can use the READ CAPACITY (16) command with this medium");
if(testedMedia.SupportsRead && !ata)
mediaOneValue.Add("Device can use the READ (6) command with this medium");
if(testedMedia.SupportsRead10)
mediaOneValue.Add("Device can use the READ (10) command with this medium");
if(testedMedia.SupportsRead12)
mediaOneValue.Add("Device can use the READ (12) command with this medium");
if(testedMedia.SupportsRead16)
mediaOneValue.Add("Device can use the READ (16) command with this medium");
if(testedMedia.SupportsReadLong && !ata)
mediaOneValue.Add("Device can use the READ LONG (10) command with this medium");
if(testedMedia.SupportsReadLong16)
mediaOneValue.Add("Device can use the READ LONG (16) command with this medium");
if(testedMedia.SupportsReadCd)
mediaOneValue.Add("Device can use the READ CD command with LBA addressing with this medium");
if(testedMedia.SupportsReadCdMsf)
mediaOneValue.Add("Device can use the READ CD command with MM:SS:FF addressing with this medium");
if(testedMedia.SupportsReadCdRaw)
mediaOneValue.Add("Device can use the READ CD command with LBA addressing with this medium to read raw sector");
if(testedMedia.SupportsReadCdMsfRaw)
mediaOneValue.Add("Device can use the READ CD command with MM:SS:FF addressing with this medium read raw sector");
if(testedMedia.SupportsHLDTSTReadRawDVD)
mediaOneValue.Add("Device can use the HL-DT-ST vendor READ DVD (RAW) command with this medium");
if(testedMedia.SupportsNECReadCDDA)
mediaOneValue.Add("Device can use the NEC vendor READ CD-DA command with this medium");
if(testedMedia.SupportsPioneerReadCDDA)
mediaOneValue.Add("Device can use the PIONEER vendor READ CD-DA command with this medium");
if(testedMedia.SupportsPioneerReadCDDAMSF)
mediaOneValue.Add("Device can use the PIONEER vendor READ CD-DA MSF command with this medium");
if(testedMedia.SupportsPlextorReadCDDA)
mediaOneValue.Add("Device can use the PLEXTOR vendor READ CD-DA command with this medium");
if(testedMedia.SupportsPlextorReadRawDVD)
mediaOneValue.Add("Device can use the PLEXOR vendor READ DVD (RAW) command with this medium");
if(testedMedia.CanReadAACS)
mediaOneValue.Add("Device can read the Advanced Access Content System from this medium");
if(testedMedia.CanReadADIP)
mediaOneValue.Add("Device can read the DVD ADress-In-Pregroove from this medium");
if(testedMedia.CanReadATIP)
mediaOneValue.Add("Device can read the CD Absolute-Time-In-Pregroove from this medium");
if(testedMedia.CanReadBCA)
mediaOneValue.Add("Device can read the Burst Cutting Area from this medium");
if(testedMedia.CanReadC2Pointers)
mediaOneValue.Add("Device can report the C2 pointers when reading from this medium");
if(testedMedia.CanReadCMI)
mediaOneValue.Add("Device can read the Copyright Management Information from this medium");
if(testedMedia.CanReadCorrectedSubchannel)
mediaOneValue.Add("Device can correct subchannels when reading from this medium");
if(testedMedia.CanReadCorrectedSubchannelWithC2)
mediaOneValue.Add("Device can correct subchannels and report the C2 pointers when reading from this medium");
if(testedMedia.CanReadDCB)
mediaOneValue.Add("Device can read the Disc Control Blocks from this medium");
if(testedMedia.CanReadDDS)
mediaOneValue.Add("Device can read the Disc Definition Structure from this medium");
if(testedMedia.CanReadDMI)
mediaOneValue.Add("Device can read the Disc Manufacurer Information from this medium");
if(testedMedia.CanReadDiscInformation)
mediaOneValue.Add("Device can read the Disc Information from this medium");
if(testedMedia.CanReadFullTOC)
mediaOneValue.Add("Device can read the Table of Contents from this medium, without processing it");
if(testedMedia.CanReadHDCMI)
mediaOneValue.Add("Device can read the HD DVD Copyright Management Information from this medium");
if(testedMedia.CanReadLayerCapacity)
mediaOneValue.Add("Device can read the layer capacity from this medium");
if(testedMedia.CanReadLeadIn)
mediaOneValue.Add("Device can read the Lead-In from this medium");
if(testedMedia.CanReadLeadOut)
mediaOneValue.Add("Device can read the Lead-Out from this medium");
if(testedMedia.CanReadMediaID)
mediaOneValue.Add("Device can read the Media ID from this medium");
if(testedMedia.CanReadMediaSerial)
mediaOneValue.Add("Device can read the Media Serial Number from this medium");
if(testedMedia.CanReadPAC)
mediaOneValue.Add("Device can read the PAC from this medium");
if(testedMedia.CanReadPFI)
mediaOneValue.Add("Device can read the Physical Format Information from this medium");
if(testedMedia.CanReadPMA)
mediaOneValue.Add("Device can read the Power Management Area from this medium");
if(testedMedia.CanReadPQSubchannel)
mediaOneValue.Add("Device can read the P to Q subchannels from this medium");
if(testedMedia.CanReadPQSubchannelWithC2)
mediaOneValue.Add("Device can read the P to Q subchannels from this medium reporting the C2 pointers");
if(testedMedia.CanReadPRI)
mediaOneValue.Add("Device can read the Pre-Recorded Information from this medium");
if(testedMedia.CanReadRWSubchannel)
mediaOneValue.Add("Device can read the R to W subchannels from this medium");
if(testedMedia.CanReadRWSubchannelWithC2)
mediaOneValue.Add("Device can read the R to W subchannels from this medium reporting the C2 pointers");
if(testedMedia.CanReadRecordablePFI)
mediaOneValue.Add("Device can read the Physical Format Information from Lead-In from this medium");
if(testedMedia.CanReadSpareAreaInformation)
mediaOneValue.Add("Device can read the Spare Area Information from this medium");
if(testedMedia.CanReadTOC)
mediaOneValue.Add("Device can read the Table of Contents from this medium");
mediaOneValue.Add("");
}
}
}
}

View File

@@ -1,21 +1,21 @@
using System.Web.Http;
namespace DiscImageChef.Server
{
{
public static class WebApiConfig
{
{
public static void Register(HttpConfiguration config)
{
// Web API configuration and services
{
// Web API configuration and services
// Web API routes
config.MapHttpAttributeRoutes();
// Web API routes
config.MapHttpAttributeRoutes();
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
}
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
}
}
}