Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

BFTPServer Class Reference

FTP server class. More...

#include <BFTPServer.h>

Inheritance diagram for BFTPServer:

BTCPConnection List of all members.

Public Member Functions

 BFTPServer ()
 Create a non-bound FTP server.

 BFTPServer (short port)
 Create a FTP server bound to the given port.

virtual void handle ()
 Handle any incoming or outgoing traffic. Call this periodically.

int numActiveConnections ()
 Return the number of currently active connections.

void connectionDidClose (BFTPControlConn *conn)
 Called after a control connection was closed. Don't call directly.

void setScreenSaverTimeout (int to)
 obsolete. will go away.

int screenSaverTimeout ()
 obsolete. will go away.

BFTPUser getUserWithName (const std::string &name)
int getNumberOfUsers ()
Server configuration
void addUser (const std::string &name, const std::string &pass, const std::string &home="/", const std::string &root="/", bool writePermission=true, bool bootPermission=true)
 Add a new user. At least one must be present, or else no-one can login.

bool anonymousLoginOK ()
 Return true if a user named "anonymous" exists.

void setMOTDFile (const std::string &motdFile)
 Set the path to the Message of the Day file (printed upon login).

const std::string & getMOTDFile ()
 Get the path to the Message of the Day file.

void setMasqueradeAsHost (const std::string &host)
 Tell the server to masquerade as the given host.

const std::string & getMasqueradeAsHost ()
 Return the masquerading host, or the empty string if none.

void setInactivityTimeout (int timeout)
 Set the inactivity timeout in seconds.

int getInactivityTimeout ()
 Get the inactivity timeout.

void setPortRangeStart (int portRangeStart)
 Set the start of the port range for passive-mode data connections.

int getPortRangeStart ()
 Get the start of the port range for passive-mode data connections.

void setPortRangeEnd (int portRangeEnd)
 Set the end of the port range for passive-mode data connections.

int getPortRangeEnd ()
 Get the end of the port range for passive-mode data connections.

Delegate handling
void setDelegate (Delegate *deleg)
Delegate * delegate ()

Protected Member Functions

virtual bool handleAccept ()
 Called by handle() if not connected. Accept in here.


Detailed Description

FTP server class.

This class implements a full-fledged FTP server. All you need to do is create one (after Wifi is setup and inited and everything), add a user (or configure via file) and periodically call handle().


Constructor & Destructor Documentation

BFTPServer::BFTPServer  
 

Create a non-bound FTP server.

This is useful for building servers that will be configured via config file, because BFTPConfigurator will call bind() with the configured port during the configure process.


Member Function Documentation

void BFTPServer::setInactivityTimeout int    timeout
 

Set the inactivity timeout in seconds.

After receiving no commands after this many seconds, the connection will be closed.

void BFTPServer::setMasqueradeAsHost const std::string &    host
 

Tell the server to masquerade as the given host.

Useful for NATed servers that have their ports forwarded from the NAT router. The name must be resolvable. Its address will be returned as reply to passive-mode requests (PASV, EPSV). If you don't know what this means, don't use it.


The documentation for this class was generated from the following file:
Generated on Tue May 1 11:00:41 2007 for libDSFTP by doxygen1.3-rc3