53 USER,
PASS,
ACCT,
CWD,
CDUP,
SMNT,
QUIT,
REIN,
PORT,
PASV,
TYPE,
54 STRU,
MODE,
RETR,
STOR,
STOU,
APPE,
ALLO,
REST,
RNFR,
RNTO,
ABOR,
55 DELE,
RMD,
MKD,
PWD,
LIST,
NLST,
SITE,
SYST,
STATcmd,
HELP,
NOOP,
479 #endif // PTLIB_FTP_H
void SetAllowThirdPartyPort(PBoolean state)
Set the thirdPartyPort flag.
Definition: ftp.h:310
virtual PBoolean OnSITE(const PCaselessString &args)
virtual PBoolean OnHELP(const PCaselessString &args)
PTCPSocket * NormalClientTransfer(Commands cmd, const PString &args)
virtual PBoolean OnPASV(const PCaselessString &args)
virtual PString GetSystemTypeString() const
return the string to be returned by the SYST command
virtual PBoolean OnRNFR(const PCaselessString &args)
PTCPSocket * m_passiveSocket
Definition: ftp.h:467
WORD remotePort
Port number on remote system.
Definition: ftp.h:270
PBoolean SetType(RepresentationType type)
Set the transfer type.
~PFTPClient()
Delete and close the socket.
char m_structure
Definition: ftp.h:470
virtual PBoolean OnCWD(const PCaselessString &args)
virtual PBoolean OnUSER(const PCaselessString &args)
virtual void OnNotImplemented(PINDEX cmdNum)
Called for unimplemented commands.
File Transfer Protocol client channel class.
Definition: ftp.h:100
~PFTPServer()
Delete the server, cleaning up passive sockets.
PFTP()
Construct an ineternal File Transfer Protocol channel.
This class describes a full description for a file on the particular platform.
Definition: filepath.h:61
virtual PBoolean OnCDUP(const PCaselessString &args)
virtual PBoolean OnNOOP(const PCaselessString &args)
This class is a variation of a string that ignores case.
Definition: pstring.h:2012
virtual PBoolean CheckLoginRequired(PINDEX cmd)
Check to see if the command requires the server to be logged in before it may be processed.
virtual PBoolean OnTYPE(const PCaselessString &args)
NameTypes
Listing types.
Definition: ftp.h:73
virtual PBoolean OnNLST(const PCaselessString &args)
PString GetFileStatus(const PString &path, DataChannelType channel=Passive)
Get status information for the file path specified.
This is an array collection class of PString objects.
Definition: pstring.h:2365
virtual PBoolean OnALLO(const PCaselessString &args)
File Transfer Protocol server channel class.
Definition: ftp.h:277
char m_mode
Definition: ftp.h:471
virtual PBoolean OnRMD(const PCaselessString &args)
File Transfer Protocol base class.
Definition: ftp.h:47
virtual PBoolean OnSTOU(const PCaselessString &args)
virtual void OnSyntaxError(PINDEX cmdNum)
Called for syntax errors in commands.
virtual PString GetHelloString(const PString &user) const
Get the string printed when a user logs in default value is a string giving the user name...
PIPSocket::Address m_remoteHost
Definition: ftp.h:464
bool OpenHost(const PString &host, WORD port=DefaultPort)
Open host using TCP.
A TCP/IP socket for process/application layer high level protocols.
Definition: inetprot.h:61
bool m_thirdPartyPort
Definition: ftp.h:454
virtual PBoolean OnPWD(const PCaselessString &args)
PTCPSocket * GetFile(const PString &filename, DataChannelType channel=Passive)
Begin retreiving a file from the remote FTP server.
virtual PBoolean OnREIN(const PCaselessString &args)
WORD m_remotePort
Definition: ftp.h:465
virtual PBoolean OnDELE(const PCaselessString &args)
virtual PBoolean OnSTOR(const PCaselessString &args)
virtual PBoolean OnAPPE(const PCaselessString &args)
PTCPSocket * PutFile(const PString &filename, DataChannelType channel=Passive)
Begin storing a file to the remote FTP server.
PTCPSocket * GetURL(const PURL &url, RepresentationType type, DataChannelType channel=Passive)
Begin retreiving a file from the remote FTP server.
Commands
FTP commands.
Definition: ftp.h:52
PString m_readyString
Definition: ftp.h:453
char m_type
Definition: ftp.h:469
PBoolean CreateDirectory(const PString &path)
Create a directory on the remote FTP host.
virtual PBoolean OnSTAT(const PCaselessString &args)
virtual PBoolean OnRETR(const PCaselessString &args)
virtual PBoolean Close()
Close the socket, and if connected as a client, QUITs from server.
PStringArray GetDirectoryNames(NameTypes type=ShortNames, DataChannelType channel=Passive)
Get a list of files from the current working directory on the remote FTP host.
PString GetCurrentDirectory()
Get the current working directory on the remote FTP host.
PTCPSocket * PassiveClientTransfer(Commands cmd, const PString &args)
virtual PBoolean OnQUIT(const PCaselessString &args)
bool PBoolean
Definition: object.h:174
RepresentationType
Types for file transfer.
Definition: ftp.h:60
The character string class.
Definition: pstring.h:108
A socket that uses the TCP transport on the Internet Protocol.
Definition: tcpsock.h:40
virtual PBoolean OnREST(const PCaselessString &args)
PFTPClient()
Declare an FTP client socket.
virtual PBoolean OnSYST(const PCaselessString &args)
PBoolean SendPORT(const PIPSocket::Address &addr, WORD port)
Send the PORT command for a transfer.
enum PFTPServer::@19 m_state
int m_illegalPasswordCount
Definition: ftp.h:473
PString m_userName
Definition: ftp.h:472
virtual void OnError(PINDEX errorCode, PINDEX cmdNum, const char *msg)
Handle an error in command.
A class describing an IP address.
Definition: ipsock.h:59
PBoolean ChangeDirectory(const PString &dirPath)
Change the current directory on the remote FTP host.
virtual PBoolean DispatchCommand(PINDEX code, const PString &args)
Dispatching to the appropriate virtual function.
PBoolean GetAllowThirdPartyPort() const
return the thirdPartyPort flag, allowing 3 host put and get.
Definition: ftp.h:307
virtual PBoolean OnRNTO(const PCaselessString &args)
virtual PBoolean OnLIST(const PCaselessString &args)
PFTPServer()
declare a server socket
void SendToClient(const PFilePath &filename)
Send the specified file to the client.
virtual PBoolean OnABOR(const PCaselessString &args)
virtual void OnCommandSuccessful(PINDEX cmdNum)
Called for successful commands.
virtual PBoolean OnSMNT(const PCaselessString &args)
PBoolean LogIn(const PString &username, const PString &password)
Log in to the remote host for FTP.
virtual PString GetGoodbyeString(const PString &user) const
return the string printed just before exiting
DataChannelType
File transfer mode on data channel.
Definition: ftp.h:67
PBoolean ProcessCommand()
Process commands, dispatching to the appropriate virtual function.
PBoolean OnOpen()
Call back to verify open succeeded in an PInternetProtocol class.
virtual PBoolean OnSTRU(const PCaselessString &args)
virtual PBoolean OnMODE(const PCaselessString &args)
This class describes a Universal Resource Locator.
Definition: url.h:56
virtual PBoolean OnPORT(const PCaselessString &args)
virtual PBoolean AuthoriseUser(const PString &user, const PString &password, PBoolean &replied)
Validate the user name and password for access.
virtual PBoolean OnACCT(const PCaselessString &args)
PString GetSystemType()
Get the type of the remote FTP server system, eg Unix, WindowsNT etc.
virtual PBoolean OnMKD(const PCaselessString &args)
virtual PBoolean OnOpen()
Call back to verify open succeeded in an PInternetProtocol class.
virtual PBoolean OnPASS(const PCaselessString &args)
virtual PBoolean OnUnknown(const PCaselessString &command)
Handle an unknown command.