// /*************************************************************************** // The Disc Image Chef // ---------------------------------------------------------------------------- // // Filename : Enums.cs // Version : 1.0 // Author(s) : Natalia Portillo // // Component : Linux direct device access // // Revision : $Revision$ // Last change by : $Author$ // Date : $Date$ // // --[ Description ] ---------------------------------------------------------- // // Contains enumerations necessary for directly interfacing devices under Linux // // --[ License ] -------------------------------------------------------------- // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as // published by the Free Software Foundation, either version 3 of the // License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // ---------------------------------------------------------------------------- // Copyright (C) 2011-2015 Claunia.com // ****************************************************************************/ // //$Id$ using System; namespace DiscImageChef.Devices.Linux { [Flags] enum FileFlags : int { /// /// O_RDONLY /// Readonly = 00000000, /// /// O_WRONLY /// Writeonly = 00000001, /// /// O_RDWR /// ReadWrite = 00000002, /// /// O_CREAT /// OpenOrCreate = 00000100, /// /// O_EXCL /// CreateNew = 00000200, /// /// O_NOCTTY /// NoControlTTY = 00000400, /// /// O_TRUNC /// Truncate = 00001000, /// /// O_APPEND /// Append = 00002000, /// /// O_NONBLOCK /// NonBlocking = 00004000, /// /// O_DSYNC /// Synchronous = 00010000, /// /// O_ASYNC /// Async = 00020000, /// /// O_DIRECT /// Direct = 00040000, /// /// O_LARGEFILE /// LargeFile = 00100000, /// /// O_DIRECTORY /// Directory = 00200000, /// /// O_NOFOLLOW /// NoFollowSymlink = 00400000, /// /// O_NOATIME /// NoAccessTime = 01000000, /// /// O_CLOEXEC /// CloseOnExec = 02000000 } /// /// Direction of SCSI transfer /// enum ScsiIoctlDirection : int { /// /// No data transfer happens /// SG_DXFER_NONE /// None = -1, /// /// From host to device /// SG_DXFER_TO_DEV /// Out = -2, /// /// From device to host /// SG_DXFER_FROM_DEV /// In = -3, /// /// Bidirectional device/host /// SG_DXFER_TO_FROM_DEV /// Unspecified = -4, /// /// Unspecified /// SG_DXFER_UNKNOWN /// Unknown = -5 } enum LinuxIoctl : uint { // SCSI IOCtls SG_GET_VERSION_NUM = 0x2282, SG_IO = 0x2285, } [Flags] enum SgInfo : uint { /// /// Mask to check OK /// OkMask = 0x01, /// /// No sense or driver noise /// Ok = 0x00, /// /// Check Condition /// CheckCondition = 0x01, /// /// Direct I/O mask /// DirectIoMask = 0x06, /// /// Transfer via kernel buffers (or no transfer) /// IndirectIo = 0x00, /// /// Direct I/O performed /// DirectIo = 0x02, /// /// Partial direct and partial indirect I/O /// MixedIo = 0x04 } }