#include <ftp.h>
Inheritance diagram for PFTPServer:
Public Types | |
MaxIllegalPasswords = 3 | |
enum | { MaxIllegalPasswords = 3 } |
Public Member Functions | |
PFTPServer () | |
declare a server socket | |
PFTPServer (const PString &readyString) | |
~PFTPServer () | |
Delete the server, cleaning up passive sockets. | |
virtual PString | GetHelloString (const PString &user) const |
virtual PString | GetGoodbyeString (const PString &user) const |
return the string printed just before exiting | |
virtual PString | GetSystemTypeString () const |
return the string to be returned by the SYST command | |
PBoolean | GetAllowThirdPartyPort () const |
return the thirdPartyPort flag, allowing 3 host put and get. | |
void | SetAllowThirdPartyPort (PBoolean state) |
Set the thirdPartyPort flag. | |
PBoolean | ProcessCommand () |
virtual PBoolean | DispatchCommand (PINDEX code, const PString &args) |
virtual PBoolean | CheckLoginRequired (PINDEX cmd) |
virtual PBoolean | AuthoriseUser (const PString &user, const PString &password, PBoolean &replied) |
virtual PBoolean | OnUnknown (const PCaselessString &command) |
virtual void | OnError (PINDEX errorCode, PINDEX cmdNum, const char *msg) |
virtual void | OnSyntaxError (PINDEX cmdNum) |
Called for syntax errors in commands. | |
virtual void | OnNotImplemented (PINDEX cmdNum) |
Called for unimplemented commands. | |
virtual void | OnCommandSuccessful (PINDEX cmdNum) |
Called for successful commands. | |
virtual PBoolean | OnUSER (const PCaselessString &args) |
virtual PBoolean | OnPASS (const PCaselessString &args) |
virtual PBoolean | OnQUIT (const PCaselessString &args) |
virtual PBoolean | OnPORT (const PCaselessString &args) |
virtual PBoolean | OnSTRU (const PCaselessString &args) |
virtual PBoolean | OnMODE (const PCaselessString &args) |
virtual PBoolean | OnTYPE (const PCaselessString &args) |
virtual PBoolean | OnNOOP (const PCaselessString &args) |
virtual PBoolean | OnSYST (const PCaselessString &args) |
virtual PBoolean | OnSTAT (const PCaselessString &args) |
virtual PBoolean | OnRETR (const PCaselessString &args) |
virtual PBoolean | OnSTOR (const PCaselessString &args) |
virtual PBoolean | OnACCT (const PCaselessString &args) |
virtual PBoolean | OnAPPE (const PCaselessString &args) |
virtual PBoolean | OnRNFR (const PCaselessString &args) |
virtual PBoolean | OnRNTO (const PCaselessString &args) |
virtual PBoolean | OnDELE (const PCaselessString &args) |
virtual PBoolean | OnCWD (const PCaselessString &args) |
virtual PBoolean | OnCDUP (const PCaselessString &args) |
virtual PBoolean | OnRMD (const PCaselessString &args) |
virtual PBoolean | OnMKD (const PCaselessString &args) |
virtual PBoolean | OnPWD (const PCaselessString &args) |
virtual PBoolean | OnLIST (const PCaselessString &args) |
virtual PBoolean | OnNLST (const PCaselessString &args) |
virtual PBoolean | OnPASV (const PCaselessString &args) |
virtual PBoolean | OnHELP (const PCaselessString &args) |
virtual PBoolean | OnSITE (const PCaselessString &args) |
virtual PBoolean | OnABOR (const PCaselessString &args) |
virtual PBoolean | OnSMNT (const PCaselessString &args) |
virtual PBoolean | OnREIN (const PCaselessString &args) |
virtual PBoolean | OnSTOU (const PCaselessString &args) |
virtual PBoolean | OnALLO (const PCaselessString &args) |
virtual PBoolean | OnREST (const PCaselessString &args) |
void | SendToClient (const PFilePath &filename) |
Send the specified file to the client. | |
Protected Types | |
NotConnected | |
NeedUser | |
NeedPassword | |
Connected | |
ClientConnect | |
enum | { NotConnected, NeedUser, NeedPassword, Connected, ClientConnect } |
Protected Member Functions | |
PBoolean | OnOpen () |
Call back to verify open succeeded in an PInternetProtocol class. | |
void | Construct () |
Protected Attributes | |
PString | readyString |
PBoolean | thirdPartyPort |
enum PFTPServer:: { ... } | state |
PIPSocket::Address | remoteHost |
WORD | remotePort |
PTCPSocket * | passiveSocket |
char | type |
char | structure |
char | mode |
PString | userName |
int | illegalPasswordCount |
PFTPServer::PFTPServer | ( | ) |
declare a server socket
PFTPServer::PFTPServer | ( | const PString & | readyString | ) |
readyString | Sign on string on connection ready. |
PFTPServer::~PFTPServer | ( | ) |
Delete the server, cleaning up passive sockets.
virtual PBoolean PFTPServer::AuthoriseUser | ( | const PString & | user, | |
const PString & | password, | |||
PBoolean & | replied | |||
) | [virtual] |
Validate the user name and password for access. After three invalid attempts, the socket will close and PFalse is returned.
Default implementation returns PTrue for all strings.
user | User name to authorise. |
password | Password supplied for the user. |
replied | Indication that a reply was sent to client. |
virtual PBoolean PFTPServer::CheckLoginRequired | ( | PINDEX | cmd | ) | [virtual] |
Check to see if the command requires the server to be logged in before it may be processed.
cmd | Command to check if log in required. |
void PFTPServer::Construct | ( | ) | [protected] |
Reimplemented from PChannel.
Dispatching to the appropriate virtual function. This is used when the socket is acting as a server.
code | Parsed command code. |
args | Arguments to command. |
PBoolean PFTPServer::GetAllowThirdPartyPort | ( | ) | const [inline] |
return the thirdPartyPort flag, allowing 3 host put and get.
return the string printed just before exiting
Get the string printed when a user logs in default value is a string giving the user name
virtual PString PFTPServer::GetSystemTypeString | ( | ) | const [virtual] |
return the string to be returned by the SYST command
virtual PBoolean PFTPServer::OnABOR | ( | const PCaselessString & | args | ) | [virtual] |
virtual PBoolean PFTPServer::OnACCT | ( | const PCaselessString & | args | ) | [virtual] |
virtual PBoolean PFTPServer::OnALLO | ( | const PCaselessString & | args | ) | [virtual] |
virtual PBoolean PFTPServer::OnAPPE | ( | const PCaselessString & | args | ) | [virtual] |
virtual PBoolean PFTPServer::OnCDUP | ( | const PCaselessString & | args | ) | [virtual] |
virtual void PFTPServer::OnCommandSuccessful | ( | PINDEX | cmdNum | ) | [virtual] |
Called for successful commands.
cmdNum | Command that had was successful. |
virtual PBoolean PFTPServer::OnCWD | ( | const PCaselessString & | args | ) | [virtual] |
virtual PBoolean PFTPServer::OnDELE | ( | const PCaselessString & | args | ) | [virtual] |
virtual void PFTPServer::OnError | ( | PINDEX | errorCode, | |
PINDEX | cmdNum, | |||
const char * | msg | |||
) | [virtual] |
Handle an error in command.
errorCode | Error code to use |
cmdNum | Command that had the error. |
msg | Error message. |
virtual PBoolean PFTPServer::OnHELP | ( | const PCaselessString & | args | ) | [virtual] |
virtual PBoolean PFTPServer::OnLIST | ( | const PCaselessString & | args | ) | [virtual] |
virtual PBoolean PFTPServer::OnMKD | ( | const PCaselessString & | args | ) | [virtual] |
virtual PBoolean PFTPServer::OnMODE | ( | const PCaselessString & | args | ) | [virtual] |
virtual PBoolean PFTPServer::OnNLST | ( | const PCaselessString & | args | ) | [virtual] |
virtual PBoolean PFTPServer::OnNOOP | ( | const PCaselessString & | args | ) | [virtual] |
virtual void PFTPServer::OnNotImplemented | ( | PINDEX | cmdNum | ) | [virtual] |
Called for unimplemented commands.
cmdNum | Command that was not implemented. |
PBoolean PFTPServer::OnOpen | ( | ) | [protected, virtual] |
Call back to verify open succeeded in an PInternetProtocol class.
Reimplemented from PIndirectChannel.
virtual PBoolean PFTPServer::OnPASS | ( | const PCaselessString & | args | ) | [virtual] |
virtual PBoolean PFTPServer::OnPASV | ( | const PCaselessString & | args | ) | [virtual] |
virtual PBoolean PFTPServer::OnPORT | ( | const PCaselessString & | args | ) | [virtual] |
virtual PBoolean PFTPServer::OnPWD | ( | const PCaselessString & | args | ) | [virtual] |
virtual PBoolean PFTPServer::OnQUIT | ( | const PCaselessString & | args | ) | [virtual] |
virtual PBoolean PFTPServer::OnREIN | ( | const PCaselessString & | args | ) | [virtual] |
virtual PBoolean PFTPServer::OnREST | ( | const PCaselessString & | args | ) | [virtual] |
virtual PBoolean PFTPServer::OnRETR | ( | const PCaselessString & | args | ) | [virtual] |
virtual PBoolean PFTPServer::OnRMD | ( | const PCaselessString & | args | ) | [virtual] |
virtual PBoolean PFTPServer::OnRNFR | ( | const PCaselessString & | args | ) | [virtual] |
virtual PBoolean PFTPServer::OnRNTO | ( | const PCaselessString & | args | ) | [virtual] |
virtual PBoolean PFTPServer::OnSITE | ( | const PCaselessString & | args | ) | [virtual] |
virtual PBoolean PFTPServer::OnSMNT | ( | const PCaselessString & | args | ) | [virtual] |
virtual PBoolean PFTPServer::OnSTAT | ( | const PCaselessString & | args | ) | [virtual] |
virtual PBoolean PFTPServer::OnSTOR | ( | const PCaselessString & | args | ) | [virtual] |
virtual PBoolean PFTPServer::OnSTOU | ( | const PCaselessString & | args | ) | [virtual] |
virtual PBoolean PFTPServer::OnSTRU | ( | const PCaselessString & | args | ) | [virtual] |
virtual void PFTPServer::OnSyntaxError | ( | PINDEX | cmdNum | ) | [virtual] |
Called for syntax errors in commands.
cmdNum | Command that had the syntax error. |
virtual PBoolean PFTPServer::OnSYST | ( | const PCaselessString & | args | ) | [virtual] |
virtual PBoolean PFTPServer::OnTYPE | ( | const PCaselessString & | args | ) | [virtual] |
virtual PBoolean PFTPServer::OnUnknown | ( | const PCaselessString & | command | ) | [virtual] |
Handle an unknown command.
command | Complete command line received. |
virtual PBoolean PFTPServer::OnUSER | ( | const PCaselessString & | args | ) | [virtual] |
PBoolean PFTPServer::ProcessCommand | ( | ) |
Process commands, dispatching to the appropriate virtual function. This is used when the socket is acting as a server.
void PFTPServer::SendToClient | ( | const PFilePath & | filename | ) |
Send the specified file to the client.
filename | File name to send. |
void PFTPServer::SetAllowThirdPartyPort | ( | PBoolean | state | ) | [inline] |
Set the thirdPartyPort flag.
int PFTPServer::illegalPasswordCount [protected] |
char PFTPServer::mode [protected] |
PTCPSocket* PFTPServer::passiveSocket [protected] |
PString PFTPServer::readyString [protected] |
PIPSocket::Address PFTPServer::remoteHost [protected] |
WORD PFTPServer::remotePort [protected] |
enum { ... } PFTPServer::state [protected] |
char PFTPServer::structure [protected] |
PBoolean PFTPServer::thirdPartyPort [protected] |
char PFTPServer::type [protected] |
PString PFTPServer::userName [protected] |