using System; namespace FluentFTP { /// /// Defines the type of encryption to use /// public enum FtpEncryptionMode { /// /// Plain text. /// None, /// /// Encryption is used from the start of the connection, port 990 /// Implicit, /// /// Connection starts in plain text and encryption is enabled /// with the AUTH command immediately after the server greeting. /// Explicit } /// /// The type of response the server responded with /// public enum FtpResponseType : int { /// /// No response /// None = 0, /// /// Success /// PositivePreliminary = 1, /// /// Successs /// PositiveCompletion = 2, /// /// Succcess /// PositiveIntermediate = 3, /// /// Temporary failure /// TransientNegativeCompletion = 4, /// /// Permanent failure /// PermanentNegativeCompletion = 5 } /// /// Server features /// [Flags] public enum FtpCapability : int { /// /// This server said it doesn't support anything! /// NONE = 0, /// /// Supports the MLST command /// MLSD = 1, /// /// Supports the SIZE command /// SIZE = 2, /// /// Supports the MDTM command /// MDTM = 4, /// /// Supports download/upload stream resumes /// REST = 8, /// /// Supports UTF8 /// UTF8 = 16, /// /// PRET Command used in distributed ftp server software DrFTPD /// PRET = 32, /// /// Server supports the MFMT command for setting the /// modifid date of an object on the server /// MFMT = 64, /// /// Server supports the MFCT command for setting the /// created date of an object on the server /// MFCT = 128, /// /// Server supports the MFF command for setting certain facts /// about file sytem objects. If you need this command, it would /// probably be handy to query FEAT your self and have a look at /// the FtpReply.InfoMessages property to see which facts the server /// allows you to modify. /// MFF = 256, /// /// Server supports the STAT command /// STAT = 512, /// /// Support for the HASH command /// HASH = 1024, /// /// Support for the non-standard MD5 command /// MD5 = 2048, /// /// Support for the non-standard XMD5 command /// XMD5 = 4096, /// /// Support for the non-standard XCRC command /// XCRC = 8192, /// /// Support for the non-standard XSHA1 command /// XSHA1 = 16384, /// /// Support for the non-standard XSHA256 command /// XSHA256 = 32768, /// /// Support for the non-standard XSHA512 command /// XSHA512 = 65536 } /// /// Different types of hashing algorithms for computing checksums. /// [Flags] public enum FtpHashAlgorithm : int { /// /// HASH command is not supported /// NONE = 0, /// /// SHA-1 /// SHA1 = 1, /// /// SHA-256 /// SHA256 = 2, /// /// SHA-512 /// SHA512 = 4, /// /// MD5 /// MD5 = 8, /// /// CRC /// CRC = 16 } /// /// IP Versions to allow when connecting /// to a server. /// [Flags] public enum FtpIpVersion : int { /// /// Internet Protocol Version 4 /// IPv4 = 1, /// /// Internet Protocol Version 6 /// IPv6 = 2, /// /// Allow any supported version /// ANY = IPv4 | IPv6 } /// /// Data connection type /// public enum FtpDataConnectionType { /// /// This type of data connection attempts to use the EPSV command /// and if the server does not support EPSV it falls back to the /// PASV command before giving up unless you are connected via IPv6 /// in which case the PASV command is not supported. /// AutoPassive, /// /// Passive data connection. EPSV is a better /// option if it's supported. Passive connections /// connect to the IP address dicated by the server /// which may or may not be accessible by the client /// for example a server behind a NAT device may /// give an IP address on its local network that /// is inaccessible to the client. Please note that IPv6 /// does not support this type data connection. If you /// ask for PASV and are connected via IPv6 EPSV will /// automatically be used in its place. /// PASV, /// /// Same as PASV except the host supplied by the server is ignored /// and the data conncetion is made to the same address that the control /// connection is connected to. This is useful in scenarios where the /// server supplies a private/non-routable network address in the /// PASV response. It's functionally identical to EPSV except some /// servers may not implement the EPSV command. Please note that IPv6 /// does not support this type data connection. If you /// ask for PASV and are connected via IPv6 EPSV will /// automatically be used in its place. /// PASVEX, /// /// Extended passive data connection, recommended. Works /// the same as a PASV connection except the server /// does not dictate an IP address to connect to, instead /// the passive connection goes to the same address used /// in the control connection. This type of data connection /// supports IPv4 and IPv6. /// EPSV, /// /// This type of data connection attempts to use the EPRT command /// and if the server does not support EPRT it falls back to the /// PORT command before giving up unless you are connected via IPv6 /// in which case the PORT command is not supported. /// AutoActive, /// /// Active data connection, not recommended unless /// you have a specific reason for using this type. /// Creates a listening socket on the client which /// requires firewall exceptions on the client system /// as well as client network when connecting to a /// server outside of the client's network. In addition /// the IP address of the interface used to connect to the /// server is the address the server is told to connect to /// which, if behind a NAT device, may be inaccessible to /// the server. This type of data connection is not supported /// by IPv6. If you specify PORT and are connected via IPv6 /// EPRT will automatically be used instead. /// PORT, /// /// Extended active data connection, not recommended /// unless you have a specific reason for using this /// type. Creates a listening socket on the client /// which requires firewall exceptions on the client /// as well as client network when connecting to a /// server outside of the client's network. The server /// connects to the IP address it sees the client comming /// from. This type of data connection supports IPv4 and IPv6. /// EPRT } /// /// Type of data transfer to do /// public enum FtpDataType { /// /// ASCII transfer /// ASCII, /// /// Binary transfer /// Binary } /// /// Type of file system of object /// public enum FtpFileSystemObjectType { /// /// A file /// File, /// /// A directory /// Directory, /// /// A symbolic link /// Link } /// /// Types of file permissions /// [Flags] public enum FtpPermission : uint { /// /// No access /// None = 0, /// /// Executable /// Execute = 1, /// /// Writeable /// Write = 2, /// /// Readable /// Read = 4 } /// /// Types of special UNIX permissions /// [Flags] public enum FtpSpecialPermissions : int { /// /// No special permissions are set /// None = 0, /// /// Sticky bit is set /// Sticky = 1, /// /// SGID bit is set /// SetGroupID = 2, /// /// SUID bit is set /// SetUserID = 4 } /// /// Flags that can dicate how a file listing is performed /// [Flags] public enum FtpListOption { /// /// Load the modify date using MDTM when it could not /// be parsed from the server listing. This only pertains /// to servers that do not implement the MLSD command. /// Modify = 1, /// /// Load the file size using the SIZE command when it /// could not be parsed from the server listing. This /// only pertains to servers that do not support the /// MLSD command. /// Size = 2, /// /// Combines the Modify and Size flags /// SizeModify = Modify | Size, /// /// Show hidden/dot files. This only pertains to servers /// that do not support the MLSD command. This option /// makes use the non standard -a parameter to LIST to /// tell the server to show hidden files. Since it's a /// non-standard option it may not always work. MLSD listings /// have no such option and whether or not a hidden file is /// shown is at the discretion of the server. /// AllFiles = 4, /// /// Force the use of the NLST command even if MLSD /// is supported by the server /// ForceList = 8, /// /// Use the NLST command instead of LIST for a reliable file listing /// NameList = 16, /// /// Combines the ForceList and NameList flags /// ForceNameList = ForceList | NameList, /// /// Try to dereference symbolic links /// DerefLinks = 32, /// /// Sets the ForceList flag and uses `LS' instead of `LIST' as the /// command for getting a directory listing. This option overrides /// ForceNameList and ignores the AllFiles flag. /// UseLS = 64 | ForceList, /// /// Adds the -r option to the list command. Some servers may not /// support this feature. /// Recursive = 128, /// /// Do not retrieve path when no path is supplied to GetListing(), /// instead just execute LIST with no path argument. /// NoPath = 256, /// /// Include two extra items into the listing, for the current directory (".") /// and the parent directory (".."). Meaningless unless you want these two /// items for some reason. /// IncludeSelfAndParent = 512 } }