123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548 |
- //---------------------------------------------------------------------------
- #ifndef SessionDataH
- #define SessionDataH
- #include "Common.h"
- #include "Option.h"
- #include "FileBuffer.h"
- #include "NamedObjs.h"
- #include "HierarchicalStorage.h"
- #include "Configuration.h"
- #include <Xml.XMLIntf.hpp>
- //---------------------------------------------------------------------------
- #define SET_SESSION_PROPERTY(Property) \
- if (F##Property != value) { F##Property = value; Modify(); }
- //---------------------------------------------------------------------------
- enum TCipher { cipWarn, cip3DES, cipBlowfish, cipAES, cipDES, cipArcfour };
- #define CIPHER_COUNT (cipArcfour+1)
- // explicit values to skip obsoleted fsExternalSSH, fsExternalSFTP
- enum TFSProtocol { fsSCPonly = 0, fsSFTP = 1, fsSFTPonly = 2, fsFTP = 5, fsWebDAV = 6 };
- #define FSPROTOCOL_COUNT (fsWebDAV+1)
- enum TProxyMethod { pmNone, pmSocks4, pmSocks5, pmHTTP, pmTelnet, pmCmd };
- enum TSshProt { ssh1only, ssh1, ssh2, ssh2only };
- enum TKex { kexWarn, kexDHGroup1, kexDHGroup14, kexDHGEx, kexRSA };
- #define KEX_COUNT (kexRSA+1)
- enum TSshBug { sbIgnore1, sbPlainPW1, sbRSA1, sbHMAC2, sbDeriveKey2, sbRSAPad2,
- sbPKSessID2, sbRekey2, sbMaxPkt2, sbIgnore2 };
- #define BUG_COUNT (sbIgnore2+1)
- enum TSftpBug { sbSymlink, sbSignedTS };
- #define SFTP_BUG_COUNT (sbSignedTS+1)
- enum TPingType { ptOff, ptNullPacket, ptDummyCommand };
- enum TAddressFamily { afAuto, afIPv4, afIPv6 };
- enum TFtps { ftpsNone, ftpsImplicit, ftpsExplicitSsl, ftpsExplicitTls };
- // has to match SSL_VERSION_XXX constants in AsyncSslSocketLayer.h
- enum TTlsVersion { ssl2 = 2, ssl3 = 3, tls10 = 10, tls11 = 11, tls12 = 12 };
- enum TSessionSource { ssNone, ssStored, ssStoredModified };
- //---------------------------------------------------------------------------
- extern const wchar_t CipherNames[CIPHER_COUNT][10];
- extern const wchar_t KexNames[KEX_COUNT][20];
- extern const wchar_t SshProtList[][10];
- extern const wchar_t ProxyMethodList[][10];
- extern const TCipher DefaultCipherList[CIPHER_COUNT];
- extern const TKex DefaultKexList[KEX_COUNT];
- extern const wchar_t FSProtocolNames[FSPROTOCOL_COUNT][16];
- extern const int DefaultSendBuf;
- extern const UnicodeString AnonymousUserName;
- extern const UnicodeString AnonymousPassword;
- extern const int SshPortNumber;
- extern const int FtpPortNumber;
- extern const int FtpsImplicitPortNumber;
- extern const int HTTPPortNumber;
- extern const int HTTPSPortNumber;
- extern const int TelnetPortNumber;
- extern const UnicodeString PuttySshProtocol;
- extern const UnicodeString PuttyTelnetProtocol;
- //---------------------------------------------------------------------------
- class TStoredSessionList;
- //---------------------------------------------------------------------------
- class TSessionData : public TNamedObject
- {
- friend class TStoredSessionList;
- private:
- UnicodeString FHostName;
- int FPortNumber;
- UnicodeString FUserName;
- RawByteString FPassword;
- int FPingInterval;
- TPingType FPingType;
- bool FTryAgent;
- bool FAgentFwd;
- UnicodeString FListingCommand;
- bool FAuthTIS;
- bool FAuthKI;
- bool FAuthKIPassword;
- bool FAuthGSSAPI;
- bool FGSSAPIFwdTGT; // not supported anymore
- UnicodeString FGSSAPIServerRealm; // not supported anymore
- bool FChangeUsername;
- bool FCompression;
- TSshProt FSshProt;
- bool FSsh2DES;
- bool FSshNoUserAuth;
- TCipher FCiphers[CIPHER_COUNT];
- TKex FKex[KEX_COUNT];
- bool FClearAliases;
- TEOLType FEOLType;
- UnicodeString FPublicKeyFile;
- UnicodeString FPuttyProtocol;
- TFSProtocol FFSProtocol;
- bool FModified;
- UnicodeString FLocalDirectory;
- UnicodeString FRemoteDirectory;
- bool FLockInHome;
- bool FSpecial;
- bool FSynchronizeBrowsing;
- bool FUpdateDirectories;
- bool FCacheDirectories;
- bool FCacheDirectoryChanges;
- bool FPreserveDirectoryChanges;
- bool FSelected;
- TAutoSwitch FLookupUserGroups;
- UnicodeString FReturnVar;
- bool FScp1Compatibility;
- UnicodeString FShell;
- UnicodeString FSftpServer;
- int FTimeout;
- bool FUnsetNationalVars;
- bool FIgnoreLsWarnings;
- bool FTcpNoDelay;
- int FSendBuf;
- bool FSshSimple;
- TProxyMethod FProxyMethod;
- UnicodeString FProxyHost;
- int FProxyPort;
- UnicodeString FProxyUsername;
- RawByteString FProxyPassword;
- UnicodeString FProxyTelnetCommand;
- UnicodeString FProxyLocalCommand;
- TAutoSwitch FProxyDNS;
- bool FProxyLocalhost;
- int FFtpProxyLogonType;
- TAutoSwitch FBugs[BUG_COUNT];
- UnicodeString FCustomParam1;
- UnicodeString FCustomParam2;
- bool FResolveSymlinks;
- TDateTime FTimeDifference;
- int FSFTPDownloadQueue;
- int FSFTPUploadQueue;
- int FSFTPListingQueue;
- int FSFTPMaxVersion;
- unsigned long FSFTPMaxPacketSize;
- TDSTMode FDSTMode;
- TAutoSwitch FSFTPBugs[SFTP_BUG_COUNT];
- bool FDeleteToRecycleBin;
- bool FOverwrittenToRecycleBin;
- UnicodeString FRecycleBinPath;
- UnicodeString FPostLoginCommands;
- TAutoSwitch FSCPLsFullTime;
- TAutoSwitch FFtpListAll;
- bool FSslSessionReuse;
- TAddressFamily FAddressFamily;
- UnicodeString FRekeyData;
- unsigned int FRekeyTime;
- int FColor;
- bool FTunnel;
- UnicodeString FTunnelHostName;
- int FTunnelPortNumber;
- UnicodeString FTunnelUserName;
- RawByteString FTunnelPassword;
- UnicodeString FTunnelPublicKeyFile;
- int FTunnelLocalPortNumber;
- UnicodeString FTunnelPortFwd;
- UnicodeString FTunnelHostKey;
- bool FFtpPasvMode;
- TAutoSwitch FFtpForcePasvIp;
- TAutoSwitch FFtpUseMlsd;
- UnicodeString FFtpAccount;
- int FFtpPingInterval;
- TPingType FFtpPingType;
- TFtps FFtps;
- TTlsVersion FMinTlsVersion;
- TTlsVersion FMaxTlsVersion;
- TAutoSwitch FNotUtf;
- bool FIsWorkspace;
- UnicodeString FLink;
- UnicodeString FHostKey;
- UnicodeString FOrigHostName;
- int FOrigPortNumber;
- TProxyMethod FOrigProxyMethod;
- TSessionSource FSource;
- void __fastcall SetHostName(UnicodeString value);
- UnicodeString __fastcall GetHostNameExpanded();
- void __fastcall SetPortNumber(int value);
- void __fastcall SetUserName(UnicodeString value);
- UnicodeString __fastcall GetUserNameExpanded();
- void __fastcall SetPassword(UnicodeString value);
- UnicodeString __fastcall GetPassword() const;
- void __fastcall SetPasswordless(bool value);
- void __fastcall SetPingInterval(int value);
- void __fastcall SetTryAgent(bool value);
- void __fastcall SetAgentFwd(bool value);
- void __fastcall SetAuthTIS(bool value);
- void __fastcall SetAuthKI(bool value);
- void __fastcall SetAuthKIPassword(bool value);
- void __fastcall SetAuthGSSAPI(bool value);
- void __fastcall SetGSSAPIFwdTGT(bool value);
- void __fastcall SetGSSAPIServerRealm(UnicodeString value);
- void __fastcall SetChangeUsername(bool value);
- void __fastcall SetCompression(bool value);
- void __fastcall SetSshProt(TSshProt value);
- void __fastcall SetSsh2DES(bool value);
- void __fastcall SetSshNoUserAuth(bool value);
- void __fastcall SetCipher(int Index, TCipher value);
- TCipher __fastcall GetCipher(int Index) const;
- void __fastcall SetKex(int Index, TKex value);
- TKex __fastcall GetKex(int Index) const;
- void __fastcall SetPublicKeyFile(UnicodeString value);
- void __fastcall SetPuttyProtocol(UnicodeString value);
- bool __fastcall GetCanLogin();
- void __fastcall SetPingIntervalDT(TDateTime value);
- TDateTime __fastcall GetPingIntervalDT();
- TDateTime __fastcall GetFtpPingIntervalDT();
- void __fastcall SetTimeDifference(TDateTime value);
- void __fastcall SetPingType(TPingType value);
- UnicodeString __fastcall GetSessionName();
- bool __fastcall HasSessionName();
- UnicodeString __fastcall GetDefaultSessionName();
- UnicodeString __fastcall GetSessionUrl();
- void __fastcall SetFSProtocol(TFSProtocol value);
- UnicodeString __fastcall GetFSProtocolStr();
- void __fastcall SetLocalDirectory(UnicodeString value);
- void __fastcall SetRemoteDirectory(UnicodeString value);
- void __fastcall SetSynchronizeBrowsing(bool value);
- void __fastcall SetUpdateDirectories(bool value);
- void __fastcall SetCacheDirectories(bool value);
- void __fastcall SetCacheDirectoryChanges(bool value);
- void __fastcall SetPreserveDirectoryChanges(bool value);
- void __fastcall SetLockInHome(bool value);
- void __fastcall SetSpecial(bool value);
- UnicodeString __fastcall GetInfoTip();
- bool __fastcall GetDefaultShell();
- void __fastcall SetDetectReturnVar(bool value);
- bool __fastcall GetDetectReturnVar();
- void __fastcall SetListingCommand(UnicodeString value);
- void __fastcall SetClearAliases(bool value);
- void __fastcall SetDefaultShell(bool value);
- void __fastcall SetEOLType(TEOLType value);
- void __fastcall SetLookupUserGroups(TAutoSwitch value);
- void __fastcall SetReturnVar(UnicodeString value);
- void __fastcall SetScp1Compatibility(bool value);
- void __fastcall SetShell(UnicodeString value);
- void __fastcall SetSftpServer(UnicodeString value);
- void __fastcall SetTimeout(int value);
- void __fastcall SetUnsetNationalVars(bool value);
- void __fastcall SetIgnoreLsWarnings(bool value);
- void __fastcall SetTcpNoDelay(bool value);
- void __fastcall SetSendBuf(int value);
- void __fastcall SetSshSimple(bool value);
- UnicodeString __fastcall GetSshProtStr();
- bool __fastcall GetUsesSsh();
- void __fastcall SetCipherList(UnicodeString value);
- UnicodeString __fastcall GetCipherList() const;
- void __fastcall SetKexList(UnicodeString value);
- UnicodeString __fastcall GetKexList() const;
- void __fastcall SetProxyMethod(TProxyMethod value);
- void __fastcall SetProxyHost(UnicodeString value);
- void __fastcall SetProxyPort(int value);
- void __fastcall SetProxyUsername(UnicodeString value);
- void __fastcall SetProxyPassword(UnicodeString value);
- void __fastcall SetProxyTelnetCommand(UnicodeString value);
- void __fastcall SetProxyLocalCommand(UnicodeString value);
- void __fastcall SetProxyDNS(TAutoSwitch value);
- void __fastcall SetProxyLocalhost(bool value);
- UnicodeString __fastcall GetProxyPassword() const;
- void __fastcall SetFtpProxyLogonType(int value);
- void __fastcall SetBug(TSshBug Bug, TAutoSwitch value);
- TAutoSwitch __fastcall GetBug(TSshBug Bug) const;
- UnicodeString __fastcall GetSessionKey();
- void __fastcall SetCustomParam1(UnicodeString value);
- void __fastcall SetCustomParam2(UnicodeString value);
- void __fastcall SetResolveSymlinks(bool value);
- void __fastcall SetSFTPDownloadQueue(int value);
- void __fastcall SetSFTPUploadQueue(int value);
- void __fastcall SetSFTPListingQueue(int value);
- void __fastcall SetSFTPMaxVersion(int value);
- void __fastcall SetSFTPMaxPacketSize(unsigned long value);
- void __fastcall SetSFTPBug(TSftpBug Bug, TAutoSwitch value);
- TAutoSwitch __fastcall GetSFTPBug(TSftpBug Bug) const;
- void __fastcall SetSCPLsFullTime(TAutoSwitch value);
- void __fastcall SetFtpListAll(TAutoSwitch value);
- void __fastcall SetSslSessionReuse(bool value);
- UnicodeString __fastcall GetStorageKey();
- UnicodeString __fastcall GetInternalStorageKey();
- void __fastcall SetDSTMode(TDSTMode value);
- void __fastcall SetDeleteToRecycleBin(bool value);
- void __fastcall SetOverwrittenToRecycleBin(bool value);
- void __fastcall SetRecycleBinPath(UnicodeString value);
- void __fastcall SetPostLoginCommands(UnicodeString value);
- void __fastcall SetAddressFamily(TAddressFamily value);
- void __fastcall SetRekeyData(UnicodeString value);
- void __fastcall SetRekeyTime(unsigned int value);
- void __fastcall SetColor(int value);
- void __fastcall SetTunnel(bool value);
- void __fastcall SetTunnelHostName(UnicodeString value);
- void __fastcall SetTunnelPortNumber(int value);
- void __fastcall SetTunnelUserName(UnicodeString value);
- void __fastcall SetTunnelPassword(UnicodeString value);
- UnicodeString __fastcall GetTunnelPassword() const;
- void __fastcall SetTunnelPublicKeyFile(UnicodeString value);
- void __fastcall SetTunnelPortFwd(UnicodeString value);
- void __fastcall SetTunnelLocalPortNumber(int value);
- bool __fastcall GetTunnelAutoassignLocalPortNumber();
- void __fastcall SetTunnelHostKey(UnicodeString value);
- void __fastcall SetFtpPasvMode(bool value);
- void __fastcall SetFtpForcePasvIp(TAutoSwitch value);
- void __fastcall SetFtpUseMlsd(TAutoSwitch value);
- void __fastcall SetFtpAccount(UnicodeString value);
- void __fastcall SetFtpPingInterval(int value);
- void __fastcall SetFtpPingType(TPingType value);
- void __fastcall SetFtps(TFtps value);
- void __fastcall SetMinTlsVersion(TTlsVersion value);
- void __fastcall SetMaxTlsVersion(TTlsVersion value);
- void __fastcall SetNotUtf(TAutoSwitch value);
- void __fastcall SetIsWorkspace(bool value);
- void __fastcall SetLink(UnicodeString value);
- void __fastcall SetHostKey(UnicodeString value);
- TDateTime __fastcall GetTimeoutDT();
- void __fastcall SavePasswords(THierarchicalStorage * Storage, bool PuttyExport);
- UnicodeString __fastcall GetLocalName();
- UnicodeString __fastcall GetFolderName();
- void __fastcall Modify();
- UnicodeString __fastcall GetSource();
- void __fastcall DoLoad(THierarchicalStorage * Storage, bool & RewritePassword);
- UnicodeString __fastcall ReadXmlNode(_di_IXMLNode Node, const UnicodeString & Name, const UnicodeString & Default);
- int __fastcall ReadXmlNode(_di_IXMLNode Node, const UnicodeString & Name, int Default);
- static RawByteString __fastcall EncryptPassword(const UnicodeString & Password, UnicodeString Key);
- static UnicodeString __fastcall DecryptPassword(const RawByteString & Password, UnicodeString Key);
- static RawByteString __fastcall StronglyRecryptPassword(const RawByteString & Password, UnicodeString Key);
- __property UnicodeString InternalStorageKey = { read = GetInternalStorageKey };
- public:
- __fastcall TSessionData(UnicodeString aName);
- virtual __fastcall ~TSessionData();
- void __fastcall Default();
- void __fastcall NonPersistant();
- void __fastcall Load(THierarchicalStorage * Storage);
- void __fastcall ImportFromFilezilla(_di_IXMLNode Node, const UnicodeString & Path);
- void __fastcall Save(THierarchicalStorage * Storage, bool PuttyExport,
- const TSessionData * Default = NULL);
- void __fastcall SaveRecryptedPasswords(THierarchicalStorage * Storage);
- void __fastcall RecryptPasswords();
- bool __fastcall HasPassword();
- bool __fastcall HasAnyPassword();
- void __fastcall Remove();
- virtual void __fastcall Assign(TPersistent * Source);
- bool __fastcall ParseUrl(UnicodeString Url, TOptions * Options,
- TStoredSessionList * StoredSessions, bool & DefaultsOnly,
- UnicodeString * FileName, bool * AProtocolDefined, UnicodeString * MaskedUrl);
- bool __fastcall ParseOptions(TOptions * Options);
- void __fastcall ConfigureTunnel(int PortNumber);
- void __fastcall RollbackTunnel();
- void __fastcall ExpandEnvironmentVariables();
- bool __fastcall IsSame(const TSessionData * Default, bool AdvancedOnly);
- bool __fastcall IsInFolderOrWorkspace(UnicodeString Name);
- static void __fastcall ValidatePath(const UnicodeString Path);
- static void __fastcall ValidateName(const UnicodeString Name);
- static UnicodeString __fastcall ExtractLocalName(const UnicodeString & Name);
- static UnicodeString __fastcall ExtractFolderName(const UnicodeString & Name);
- static UnicodeString __fastcall ComposePath(const UnicodeString & Path, const UnicodeString & Name);
- __property UnicodeString HostName = { read=FHostName, write=SetHostName };
- __property UnicodeString HostNameExpanded = { read=GetHostNameExpanded };
- __property int PortNumber = { read=FPortNumber, write=SetPortNumber };
- __property UnicodeString UserName = { read=FUserName, write=SetUserName };
- __property UnicodeString UserNameExpanded = { read=GetUserNameExpanded };
- __property UnicodeString Password = { read=GetPassword, write=SetPassword };
- __property int PingInterval = { read=FPingInterval, write=SetPingInterval };
- __property bool TryAgent = { read=FTryAgent, write=SetTryAgent };
- __property bool AgentFwd = { read=FAgentFwd, write=SetAgentFwd };
- __property UnicodeString ListingCommand = { read = FListingCommand, write = SetListingCommand };
- __property bool AuthTIS = { read=FAuthTIS, write=SetAuthTIS };
- __property bool AuthKI = { read=FAuthKI, write=SetAuthKI };
- __property bool AuthKIPassword = { read=FAuthKIPassword, write=SetAuthKIPassword };
- __property bool AuthGSSAPI = { read=FAuthGSSAPI, write=SetAuthGSSAPI };
- __property bool GSSAPIFwdTGT = { read=FGSSAPIFwdTGT, write=SetGSSAPIFwdTGT };
- __property UnicodeString GSSAPIServerRealm = { read=FGSSAPIServerRealm, write=SetGSSAPIServerRealm };
- __property bool ChangeUsername = { read=FChangeUsername, write=SetChangeUsername };
- __property bool Compression = { read=FCompression, write=SetCompression };
- __property TSshProt SshProt = { read=FSshProt, write=SetSshProt };
- __property bool UsesSsh = { read = GetUsesSsh };
- __property bool Ssh2DES = { read=FSsh2DES, write=SetSsh2DES };
- __property bool SshNoUserAuth = { read=FSshNoUserAuth, write=SetSshNoUserAuth };
- __property TCipher Cipher[int Index] = { read=GetCipher, write=SetCipher };
- __property TKex Kex[int Index] = { read=GetKex, write=SetKex };
- __property UnicodeString PublicKeyFile = { read=FPublicKeyFile, write=SetPublicKeyFile };
- __property UnicodeString PuttyProtocol = { read=FPuttyProtocol, write=SetPuttyProtocol };
- __property TFSProtocol FSProtocol = { read=FFSProtocol, write=SetFSProtocol };
- __property UnicodeString FSProtocolStr = { read=GetFSProtocolStr };
- __property bool Modified = { read=FModified, write=FModified };
- __property bool CanLogin = { read=GetCanLogin };
- __property bool ClearAliases = { read = FClearAliases, write = SetClearAliases };
- __property TDateTime PingIntervalDT = { read = GetPingIntervalDT, write = SetPingIntervalDT };
- __property TDateTime TimeDifference = { read = FTimeDifference, write = SetTimeDifference };
- __property TPingType PingType = { read = FPingType, write = SetPingType };
- __property UnicodeString SessionName = { read=GetSessionName };
- __property UnicodeString DefaultSessionName = { read=GetDefaultSessionName };
- __property UnicodeString SessionUrl = { read=GetSessionUrl };
- __property UnicodeString LocalDirectory = { read=FLocalDirectory, write=SetLocalDirectory };
- __property UnicodeString RemoteDirectory = { read=FRemoteDirectory, write=SetRemoteDirectory };
- __property bool SynchronizeBrowsing = { read=FSynchronizeBrowsing, write=SetSynchronizeBrowsing };
- __property bool UpdateDirectories = { read=FUpdateDirectories, write=SetUpdateDirectories };
- __property bool CacheDirectories = { read=FCacheDirectories, write=SetCacheDirectories };
- __property bool CacheDirectoryChanges = { read=FCacheDirectoryChanges, write=SetCacheDirectoryChanges };
- __property bool PreserveDirectoryChanges = { read=FPreserveDirectoryChanges, write=SetPreserveDirectoryChanges };
- __property bool LockInHome = { read=FLockInHome, write=SetLockInHome };
- __property bool Special = { read=FSpecial, write=SetSpecial };
- __property bool Selected = { read=FSelected, write=FSelected };
- __property UnicodeString InfoTip = { read=GetInfoTip };
- __property bool DefaultShell = { read = GetDefaultShell, write = SetDefaultShell };
- __property bool DetectReturnVar = { read = GetDetectReturnVar, write = SetDetectReturnVar };
- __property TEOLType EOLType = { read = FEOLType, write = SetEOLType };
- __property TAutoSwitch LookupUserGroups = { read = FLookupUserGroups, write = SetLookupUserGroups };
- __property UnicodeString ReturnVar = { read = FReturnVar, write = SetReturnVar };
- __property bool Scp1Compatibility = { read = FScp1Compatibility, write = SetScp1Compatibility };
- __property UnicodeString Shell = { read = FShell, write = SetShell };
- __property UnicodeString SftpServer = { read = FSftpServer, write = SetSftpServer };
- __property int Timeout = { read = FTimeout, write = SetTimeout };
- __property TDateTime TimeoutDT = { read = GetTimeoutDT };
- __property bool UnsetNationalVars = { read = FUnsetNationalVars, write = SetUnsetNationalVars };
- __property bool IgnoreLsWarnings = { read=FIgnoreLsWarnings, write=SetIgnoreLsWarnings };
- __property bool TcpNoDelay = { read=FTcpNoDelay, write=SetTcpNoDelay };
- __property int SendBuf = { read=FSendBuf, write=SetSendBuf };
- __property bool SshSimple = { read=FSshSimple, write=SetSshSimple };
- __property UnicodeString SshProtStr = { read=GetSshProtStr };
- __property UnicodeString CipherList = { read=GetCipherList, write=SetCipherList };
- __property UnicodeString KexList = { read=GetKexList, write=SetKexList };
- __property TProxyMethod ProxyMethod = { read=FProxyMethod, write=SetProxyMethod };
- __property UnicodeString ProxyHost = { read=FProxyHost, write=SetProxyHost };
- __property int ProxyPort = { read=FProxyPort, write=SetProxyPort };
- __property UnicodeString ProxyUsername = { read=FProxyUsername, write=SetProxyUsername };
- __property UnicodeString ProxyPassword = { read=GetProxyPassword, write=SetProxyPassword };
- __property UnicodeString ProxyTelnetCommand = { read=FProxyTelnetCommand, write=SetProxyTelnetCommand };
- __property UnicodeString ProxyLocalCommand = { read=FProxyLocalCommand, write=SetProxyLocalCommand };
- __property TAutoSwitch ProxyDNS = { read=FProxyDNS, write=SetProxyDNS };
- __property bool ProxyLocalhost = { read=FProxyLocalhost, write=SetProxyLocalhost };
- __property int FtpProxyLogonType = { read=FFtpProxyLogonType, write=SetFtpProxyLogonType };
- __property TAutoSwitch Bug[TSshBug Bug] = { read=GetBug, write=SetBug };
- __property UnicodeString CustomParam1 = { read = FCustomParam1, write = SetCustomParam1 };
- __property UnicodeString CustomParam2 = { read = FCustomParam2, write = SetCustomParam2 };
- __property UnicodeString SessionKey = { read = GetSessionKey };
- __property bool ResolveSymlinks = { read = FResolveSymlinks, write = SetResolveSymlinks };
- __property int SFTPDownloadQueue = { read = FSFTPDownloadQueue, write = SetSFTPDownloadQueue };
- __property int SFTPUploadQueue = { read = FSFTPUploadQueue, write = SetSFTPUploadQueue };
- __property int SFTPListingQueue = { read = FSFTPListingQueue, write = SetSFTPListingQueue };
- __property int SFTPMaxVersion = { read = FSFTPMaxVersion, write = SetSFTPMaxVersion };
- __property unsigned long SFTPMaxPacketSize = { read = FSFTPMaxPacketSize, write = SetSFTPMaxPacketSize };
- __property TAutoSwitch SFTPBug[TSftpBug Bug] = { read=GetSFTPBug, write=SetSFTPBug };
- __property TAutoSwitch SCPLsFullTime = { read = FSCPLsFullTime, write = SetSCPLsFullTime };
- __property TAutoSwitch FtpListAll = { read = FFtpListAll, write = SetFtpListAll };
- __property bool SslSessionReuse = { read = FSslSessionReuse, write = SetSslSessionReuse };
- __property TDSTMode DSTMode = { read = FDSTMode, write = SetDSTMode };
- __property bool DeleteToRecycleBin = { read = FDeleteToRecycleBin, write = SetDeleteToRecycleBin };
- __property bool OverwrittenToRecycleBin = { read = FOverwrittenToRecycleBin, write = SetOverwrittenToRecycleBin };
- __property UnicodeString RecycleBinPath = { read = FRecycleBinPath, write = SetRecycleBinPath };
- __property UnicodeString PostLoginCommands = { read = FPostLoginCommands, write = SetPostLoginCommands };
- __property TAddressFamily AddressFamily = { read = FAddressFamily, write = SetAddressFamily };
- __property UnicodeString RekeyData = { read = FRekeyData, write = SetRekeyData };
- __property unsigned int RekeyTime = { read = FRekeyTime, write = SetRekeyTime };
- __property int Color = { read = FColor, write = SetColor };
- __property bool Tunnel = { read = FTunnel, write = SetTunnel };
- __property UnicodeString TunnelHostName = { read = FTunnelHostName, write = SetTunnelHostName };
- __property int TunnelPortNumber = { read = FTunnelPortNumber, write = SetTunnelPortNumber };
- __property UnicodeString TunnelUserName = { read = FTunnelUserName, write = SetTunnelUserName };
- __property UnicodeString TunnelPassword = { read = GetTunnelPassword, write = SetTunnelPassword };
- __property UnicodeString TunnelPublicKeyFile = { read = FTunnelPublicKeyFile, write = SetTunnelPublicKeyFile };
- __property bool TunnelAutoassignLocalPortNumber = { read = GetTunnelAutoassignLocalPortNumber };
- __property int TunnelLocalPortNumber = { read = FTunnelLocalPortNumber, write = SetTunnelLocalPortNumber };
- __property UnicodeString TunnelPortFwd = { read = FTunnelPortFwd, write = SetTunnelPortFwd };
- __property UnicodeString TunnelHostKey = { read = FTunnelHostKey, write = SetTunnelHostKey };
- __property bool FtpPasvMode = { read = FFtpPasvMode, write = SetFtpPasvMode };
- __property TAutoSwitch FtpForcePasvIp = { read = FFtpForcePasvIp, write = SetFtpForcePasvIp };
- __property TAutoSwitch FtpUseMlsd = { read = FFtpUseMlsd, write = SetFtpUseMlsd };
- __property UnicodeString FtpAccount = { read = FFtpAccount, write = SetFtpAccount };
- __property int FtpPingInterval = { read=FFtpPingInterval, write=SetFtpPingInterval };
- __property TDateTime FtpPingIntervalDT = { read=GetFtpPingIntervalDT };
- __property TPingType FtpPingType = { read = FFtpPingType, write = SetFtpPingType };
- __property TFtps Ftps = { read = FFtps, write = SetFtps };
- __property TTlsVersion MinTlsVersion = { read = FMinTlsVersion, write = SetMinTlsVersion };
- __property TTlsVersion MaxTlsVersion = { read = FMaxTlsVersion, write = SetMaxTlsVersion };
- __property TAutoSwitch NotUtf = { read = FNotUtf, write = SetNotUtf };
- __property bool IsWorkspace = { read = FIsWorkspace, write = SetIsWorkspace };
- __property UnicodeString Link = { read = FLink, write = SetLink };
- __property UnicodeString HostKey = { read = FHostKey, write = SetHostKey };
- __property UnicodeString StorageKey = { read = GetStorageKey };
- __property UnicodeString OrigHostName = { read = FOrigHostName };
- __property int OrigPortNumber = { read = FOrigPortNumber };
- __property UnicodeString LocalName = { read = GetLocalName };
- __property UnicodeString FolderName = { read = GetFolderName };
- __property UnicodeString Source = { read = GetSource };
- };
- //---------------------------------------------------------------------------
- class TStoredSessionList : public TNamedObjectList
- {
- public:
- __fastcall TStoredSessionList(bool aReadOnly = false);
- void __fastcall Load();
- void __fastcall Save(bool All, bool Explicit);
- void __fastcall Saved();
- void __fastcall ImportFromFilezilla(const UnicodeString FileName);
- void __fastcall Export(const UnicodeString FileName);
- void __fastcall Load(THierarchicalStorage * Storage, bool AsModified = false,
- bool UseDefaults = false);
- void __fastcall Save(THierarchicalStorage * Storage, bool All = false);
- void __fastcall SelectAll(bool Select);
- void __fastcall Import(TStoredSessionList * From, bool OnlySelected);
- void __fastcall RecryptPasswords(TStrings * RecryptPasswordErrors);
- TSessionData * __fastcall AtSession(int Index)
- { return (TSessionData*)AtObject(Index); }
- void __fastcall SelectSessionsToImport(TStoredSessionList * Dest, bool SSHOnly);
- void __fastcall Cleanup();
- void __fastcall UpdateStaticUsage();
- int __fastcall IndexOf(TSessionData * Data);
- TSessionData * __fastcall FindSame(TSessionData * Data);
- TSessionData * __fastcall NewSession(UnicodeString SessionName, TSessionData * Session);
- void __fastcall NewWorkspace(UnicodeString Name, TList * DataList);
- bool __fastcall IsFolder(const UnicodeString & Name);
- bool __fastcall IsWorkspace(const UnicodeString & Name);
- TSessionData * __fastcall ParseUrl(UnicodeString Url, TOptions * Options, bool & DefaultsOnly,
- UnicodeString * FileName = NULL, bool * ProtocolDefined = NULL, UnicodeString * MaskedUrl = NULL);
- bool __fastcall CanLogin(TSessionData * Data);
- void __fastcall GetFolderOrWorkspace(const UnicodeString & Name, TList * List);
- TStrings * __fastcall GetFolderOrWorkspaceList(const UnicodeString & Name);
- TStrings * __fastcall GetWorkspaces();
- bool __fastcall HasAnyWorkspace();
- virtual __fastcall ~TStoredSessionList();
- __property TSessionData * Sessions[int Index] = { read=AtSession };
- __property TSessionData * DefaultSettings = { read=FDefaultSettings, write=SetDefaultSettings };
- static void __fastcall ImportHostKeys(const UnicodeString TargetKey,
- const UnicodeString SourceKey, TStoredSessionList * Sessions,
- bool OnlySelected);
- private:
- TSessionData * FDefaultSettings;
- bool FReadOnly;
- void __fastcall SetDefaultSettings(TSessionData * value);
- void __fastcall DoSave(THierarchicalStorage * Storage, bool All,
- bool RecryptPasswordOnly, TStrings * RecryptPasswordErrors);
- void __fastcall DoSave(bool All, bool Explicit, bool RecryptPasswordOnly,
- TStrings * RecryptPasswordErrors);
- void __fastcall DoSave(THierarchicalStorage * Storage,
- TSessionData * Data, bool All, bool RecryptPasswordOnly,
- TSessionData * FactoryDefaults);
- TSessionData * __fastcall ResolveSessionData(TSessionData * Data);
- bool __fastcall IsFolderOrWorkspace(const UnicodeString & Name, bool Workspace);
- TSessionData * __fastcall CheckIsInFolderOrWorkspaceAndResolve(
- TSessionData * Data, const UnicodeString & Name);
- void __fastcall ImportLevelFromFilezilla(_di_IXMLNode Node, const UnicodeString & Path);
- };
- //---------------------------------------------------------------------------
- UnicodeString GetExpandedLogFileName(UnicodeString LogFileName, TSessionData * SessionData);
- bool __fastcall IsSshProtocol(TFSProtocol FSProtocol);
- //---------------------------------------------------------------------------
- #endif
|