FtpDTP Class Reference

#include <FtpDTP.h>

List of all members.

Public Member Functions

 FtpDTP ()
virtual ~FtpDTP ()
OStatus Initialize (const OID &myoid, const antStackRef &ipstack, void *index)
bool ListenCont (TCPEndpointListenMsg *listenMsg)
bool ConnectCont (TCPEndpointConnectMsg *connectMsg)
bool SendCont (TCPEndpointSendMsg *sendMsg)
bool ReceiveCont (TCPEndpointReceiveMsg *receiveMsg)
void CloseCont (TCPEndpointCloseMsg *closeMsg)
OStatus Close ()
void SetType (FTPDataType type)
void SetUser (char *user)
void SetHome (char *home)
ConnectionState GetState ()
FTPDataType GetType ()
char * GetFilename ()
char * GetDirectry ()
size_t GetFileSize (char *name)
char * GetUser ()
Port SetIP (IPAddress ip)
bool SetPort (char *ipport)
bool Retrieve (char *filename)
bool Store (char *filename)
bool ChangeDir (char *dir)
bool MakeDir (char *dir)
bool RemoveDir (char *dir)
bool Delete (char *filename)
bool List (char *dir)
bool RenameFrom (char *file)
bool RenameTo (char *file)
void ResetFilename ()

Private Member Functions

OStatus Listen ()
OStatus Connect ()
OStatus Send ()
OStatus Receive ()
void Save (byte *data, int length, bool end=true)
void DirNorm (char *dir)
bool RetrieveSend ()
bool ListSend ()

Private Attributes

OID myOID
antStackRef ipstackRef
IPAddress connectIP
Port connectPort
FTPMethod method
bool passive
FTPDataType dataType
char ftpUser [MAX_STRING_LENGTH]
char ftpHome [MAX_STRING_LENGTH]
char ftpDir [MAX_STRING_LENGTH]
char ftpFile [MAX_STRING_LENGTH]
bool listLong
bool total
FILE * fp
DIR * dirp
void * continuation
TCPConnection connection


Detailed Description

Definition at line 25 of file FtpDTP.h.


Constructor & Destructor Documentation

FtpDTP::FtpDTP (  ) 

Definition at line 16 of file FtpDTP.cc.

virtual FtpDTP::~FtpDTP (  )  [inline, virtual]

Definition at line 29 of file FtpDTP.h.


Member Function Documentation

bool FtpDTP::ChangeDir ( char *  dir  ) 

Definition at line 359 of file FtpMethod.cc.

References DirNorm(), ftpDir, ftpHome, and MAX_STRING_LENGTH.

Referenced by FtpPI::RequestProcess().

OStatus FtpDTP::Close (  ) 

Definition at line 351 of file FtpDTP.cc.

References connection, CONNECTION_CLOSED, CONNECTION_CLOSING, connectPort, continuation, dataType, TCPConnection::endpoint, FTP_DATA_A, FTP_DATA_PORT, FTP_METHOD_NOOP, ipstackRef, method, myOID, passive, ResetFilename(), and TCPConnection::state.

Referenced by FtpPI::Close(), ConnectCont(), List(), ListenCont(), ReceiveCont(), and SendCont().

void FtpDTP::CloseCont ( TCPEndpointCloseMsg *  closeMsg  ) 

Definition at line 375 of file FtpDTP.cc.

References connection, CONNECTION_CLOSED, and TCPConnection::state.

Referenced by FtpPI::CloseContforDTP().

OStatus FtpDTP::Connect (  )  [private]

Definition at line 119 of file FtpDTP.cc.

References connection, CONNECTION_CLOSED, CONNECTION_CONNECTING, connectIP, connectPort, continuation, TCPConnection::endpoint, FTP_BUFFER_SIZE, FTP_DATA_PORT, ipstackRef, myOID, and TCPConnection::state.

Referenced by List(), Retrieve(), and Store().

bool FtpDTP::ConnectCont ( TCPEndpointConnectMsg *  connectMsg  ) 

Definition at line 201 of file FtpDTP.cc.

References Close(), connection, CONNECTION_CONNECTED, FTP_METHOD_LIST, FTP_METHOD_RETR, FTP_METHOD_STOR, ListSend(), method, Receive(), TCPConnection::recvSize, RetrieveSend(), and TCPConnection::state.

Referenced by FtpPI::ConnectContforDTP().

bool FtpDTP::Delete ( char *  filename  ) 

Definition at line 428 of file FtpMethod.cc.

References DirNorm(), ftpDir, ftpHome, and MAX_STRING_LENGTH.

Referenced by FtpPI::RequestProcess().

void FtpDTP::DirNorm ( char *  dir  )  [private]

Definition at line 494 of file FtpMethod.cc.

References MAX_STRING_LENGTH, and toupper().

Referenced by ChangeDir(), Delete(), List(), ListSend(), MakeDir(), RemoveDir(), RenameFrom(), RenameTo(), Retrieve(), SetHome(), and Store().

char* FtpDTP::GetDirectry (  )  [inline]

Definition at line 50 of file FtpDTP.h.

References ftpDir.

Referenced by FtpPI::RequestProcess().

char* FtpDTP::GetFilename (  )  [inline]

Definition at line 49 of file FtpDTP.h.

References ftpFile.

Referenced by FtpPI::ConnectContforDTP(), FtpPI::ListenContforDTP(), and FtpPI::RequestProcess().

size_t FtpDTP::GetFileSize ( char *  name  ) 

Definition at line 461 of file FtpMethod.cc.

ConnectionState FtpDTP::GetState (  )  [inline]

Definition at line 47 of file FtpDTP.h.

References connection, and TCPConnection::state.

Referenced by FtpPI::ReceiveContforDTP(), and FtpPI::SendContforDTP().

FTPDataType FtpDTP::GetType (  )  [inline]

Definition at line 48 of file FtpDTP.h.

References dataType.

Referenced by FtpPI::ConnectContforDTP(), and FtpPI::ListenContforDTP().

char* FtpDTP::GetUser (  )  [inline]

Definition at line 52 of file FtpDTP.h.

References ftpUser.

Referenced by FtpPI::RequestProcess().

OStatus FtpDTP::Initialize ( const OID &  myoid,
const antStackRef &  ipstack,
void *  index 
)

Definition at line 21 of file FtpDTP.cc.

References connection, CONNECTION_CLOSED, connectPort, continuation, dataType, FTP_BUFFER_SIZE, FTP_DATA_A, FTP_DATA_PORT, FTP_METHOD_NOOP, ftpDir, ipstackRef, method, myOID, passive, TCPConnection::recvBuffer, TCPConnection::recvData, ResetFilename(), TCPConnection::sendBuffer, TCPConnection::sendData, and TCPConnection::state.

Referenced by FtpPI::Initialize().

bool FtpDTP::List ( char *  dir  ) 

Definition at line 253 of file FtpMethod.cc.

References Close(), Connect(), connection, CONNECTION_CONNECTED, DirNorm(), dirp, FTP_METHOD_LIST, ftpDir, ftpFile, ftpHome, listLong, ListSend(), MAX_STRING_LENGTH, method, passive, TCPConnection::state, and total.

Referenced by FtpPI::RequestProcess().

OStatus FtpDTP::Listen (  )  [private]

Definition at line 81 of file FtpDTP.cc.

References connection, CONNECTION_CLOSED, CONNECTION_LISTENING, connectPort, continuation, TCPConnection::endpoint, FTP_BUFFER_SIZE, ipstackRef, myOID, and TCPConnection::state.

Referenced by SetIP().

bool FtpDTP::ListenCont ( TCPEndpointListenMsg *  listenMsg  ) 

Definition at line 158 of file FtpDTP.cc.

References Close(), connection, CONNECTION_CONNECTED, FTP_METHOD_LIST, FTP_METHOD_RETR, FTP_METHOD_STOR, ListSend(), method, Receive(), TCPConnection::recvSize, RetrieveSend(), and TCPConnection::state.

Referenced by FtpPI::ListenContforDTP().

bool FtpDTP::ListSend (  )  [private]

Definition at line 293 of file FtpMethod.cc.

References connection, DirNorm(), dirp, FTP_METHOD_NOOP, ftpFile, listLong, MAX_STRING_LENGTH, method, Send(), TCPConnection::sendData, TCPConnection::sendSize, and total.

Referenced by ConnectCont(), List(), ListenCont(), and SendCont().

bool FtpDTP::MakeDir ( char *  dir  ) 

Definition at line 384 of file FtpMethod.cc.

References DirNorm(), ftpDir, ftpHome, and MAX_STRING_LENGTH.

Referenced by FtpPI::RequestProcess().

OStatus FtpDTP::Receive (  )  [private]

Definition at line 301 of file FtpDTP.cc.

References connection, CONNECTION_CONNECTED, CONNECTION_RECEIVING, CONNECTION_SENDING, continuation, TCPConnection::endpoint, FTP_BUFFER_SIZE, ipstackRef, myOID, TCPConnection::recvData, and TCPConnection::state.

Referenced by ConnectCont(), ListenCont(), ReceiveCont(), and Store().

bool FtpDTP::ReceiveCont ( TCPEndpointReceiveMsg *  receiveMsg  ) 

Definition at line 322 of file FtpDTP.cc.

References Close(), connection, CONNECTION_CONNECTED, Receive(), TCPConnection::recvData, TCPConnection::recvSize, Save(), and TCPConnection::state.

Referenced by FtpPI::ReceiveContforDTP().

bool FtpDTP::RemoveDir ( char *  dir  ) 

Definition at line 406 of file FtpMethod.cc.

References DirNorm(), ftpDir, ftpHome, and MAX_STRING_LENGTH.

Referenced by FtpPI::RequestProcess().

bool FtpDTP::RenameFrom ( char *  file  ) 

Definition at line 203 of file FtpMethod.cc.

References DirNorm(), fp, ftpDir, ftpFile, ftpHome, and MAX_STRING_LENGTH.

Referenced by FtpPI::RequestProcess().

bool FtpDTP::RenameTo ( char *  file  ) 

Definition at line 228 of file FtpMethod.cc.

References DirNorm(), ftpDir, ftpFile, ftpHome, and MAX_STRING_LENGTH.

Referenced by FtpPI::RequestProcess().

void FtpDTP::ResetFilename (  ) 

Definition at line 473 of file FtpMethod.cc.

References ftpFile.

Referenced by Close(), Initialize(), and FtpPI::RequestProcess().

bool FtpDTP::Retrieve ( char *  filename  ) 

Definition at line 111 of file FtpMethod.cc.

References Connect(), connection, CONNECTION_CONNECTED, DirNorm(), fp, FTP_METHOD_RETR, ftpDir, ftpFile, ftpHome, MAX_STRING_LENGTH, method, passive, RetrieveSend(), and TCPConnection::state.

Referenced by FtpPI::RequestProcess().

bool FtpDTP::RetrieveSend (  )  [private]

Definition at line 146 of file FtpMethod.cc.

References connection, CR, dataType, fp, FTP_BUFFER_SIZE, FTP_DATA_A, FTP_METHOD_NOOP, LF, method, TCPConnection::recvData, TCPConnection::recvSize, Send(), TCPConnection::sendData, and TCPConnection::sendSize.

Referenced by ConnectCont(), ListenCont(), Retrieve(), and SendCont().

void FtpDTP::Save ( byte *  data,
int  length,
bool  end = true 
) [private]

Definition at line 450 of file FtpMethod.cc.

References fp, and ftpFile.

Referenced by ReceiveCont().

OStatus FtpDTP::Send (  )  [private]

Definition at line 235 of file FtpDTP.cc.

References connection, CONNECTION_CONNECTED, CONNECTION_SENDING, continuation, TCPConnection::endpoint, ipstackRef, myOID, TCPConnection::sendData, TCPConnection::sendSize, and TCPConnection::state.

Referenced by ListSend(), and RetrieveSend().

bool FtpDTP::SendCont ( TCPEndpointSendMsg *  sendMsg  ) 

Definition at line 258 of file FtpDTP.cc.

References Close(), connection, CONNECTION_CONNECTED, FTP_METHOD_LIST, FTP_METHOD_NOOP, FTP_METHOD_RETR, ListSend(), method, RetrieveSend(), and TCPConnection::state.

Referenced by FtpPI::SendContforDTP().

void FtpDTP::SetHome ( char *  home  ) 

Definition at line 485 of file FtpMethod.cc.

References DirNorm(), ftpDir, and ftpHome.

Referenced by FtpPI::RequestProcess().

Port FtpDTP::SetIP ( IPAddress  ip  ) 

Definition at line 22 of file FtpMethod.cc.

References connectIP, connectPort, continuation, FTP_PASV_DATA_PORT, int(), Listen(), and passive.

Referenced by FtpPI::RequestProcess().

bool FtpDTP::SetPort ( char *  ipport  ) 

Definition at line 32 of file FtpMethod.cc.

References connectIP, connectPort, and passive.

Referenced by FtpPI::RequestProcess().

void FtpDTP::SetType ( FTPDataType  type  )  [inline]

Definition at line 42 of file FtpDTP.h.

References dataType.

Referenced by FtpPI::RequestProcess().

void FtpDTP::SetUser ( char *  user  ) 

Definition at line 479 of file FtpMethod.cc.

References ftpUser, and MAX_STRING_LENGTH.

Referenced by FtpPI::RequestProcess().

bool FtpDTP::Store ( char *  filename  ) 

Definition at line 75 of file FtpMethod.cc.

References Connect(), connection, CONNECTION_CONNECTED, DirNorm(), fp, FTP_METHOD_STOR, ftpDir, ftpFile, ftpHome, MAX_STRING_LENGTH, method, passive, Receive(), TCPConnection::recvSize, and TCPConnection::state.

Referenced by FtpPI::RequestProcess().


Member Data Documentation

TCPConnection FtpDTP::connection [private]

Definition at line 100 of file FtpDTP.h.

Referenced by Close(), CloseCont(), Connect(), ConnectCont(), GetState(), Initialize(), List(), Listen(), ListenCont(), ListSend(), Receive(), ReceiveCont(), Retrieve(), RetrieveSend(), Send(), SendCont(), and Store().

IPAddress FtpDTP::connectIP [private]

Definition at line 83 of file FtpDTP.h.

Referenced by Connect(), SetIP(), and SetPort().

Port FtpDTP::connectPort [private]

Definition at line 84 of file FtpDTP.h.

Referenced by Close(), Connect(), Initialize(), Listen(), SetIP(), and SetPort().

void* FtpDTP::continuation [private]

Definition at line 99 of file FtpDTP.h.

Referenced by Close(), Connect(), Initialize(), Listen(), Receive(), Send(), and SetIP().

FTPDataType FtpDTP::dataType [private]

Definition at line 89 of file FtpDTP.h.

Referenced by Close(), GetType(), Initialize(), RetrieveSend(), and SetType().

DIR* FtpDTP::dirp [private]

Definition at line 97 of file FtpDTP.h.

Referenced by List(), and ListSend().

FILE* FtpDTP::fp [private]

Definition at line 96 of file FtpDTP.h.

Referenced by RenameFrom(), Retrieve(), RetrieveSend(), Save(), and Store().

char FtpDTP::ftpDir[MAX_STRING_LENGTH] [private]

Definition at line 92 of file FtpDTP.h.

Referenced by ChangeDir(), Delete(), GetDirectry(), Initialize(), List(), MakeDir(), RemoveDir(), RenameFrom(), RenameTo(), Retrieve(), SetHome(), and Store().

char FtpDTP::ftpFile[MAX_STRING_LENGTH] [private]

Definition at line 93 of file FtpDTP.h.

Referenced by GetFilename(), List(), ListSend(), RenameFrom(), RenameTo(), ResetFilename(), Retrieve(), Save(), and Store().

char FtpDTP::ftpHome[MAX_STRING_LENGTH] [private]

Definition at line 91 of file FtpDTP.h.

Referenced by ChangeDir(), Delete(), List(), MakeDir(), RemoveDir(), RenameFrom(), RenameTo(), Retrieve(), SetHome(), and Store().

char FtpDTP::ftpUser[MAX_STRING_LENGTH] [private]

Definition at line 90 of file FtpDTP.h.

Referenced by GetUser(), and SetUser().

antStackRef FtpDTP::ipstackRef [private]

Definition at line 80 of file FtpDTP.h.

Referenced by Close(), Connect(), Initialize(), Listen(), Receive(), and Send().

bool FtpDTP::listLong [private]

Definition at line 94 of file FtpDTP.h.

Referenced by List(), and ListSend().

FTPMethod FtpDTP::method [private]

Definition at line 85 of file FtpDTP.h.

Referenced by Close(), ConnectCont(), Initialize(), List(), ListenCont(), ListSend(), Retrieve(), RetrieveSend(), SendCont(), and Store().

OID FtpDTP::myOID [private]

Definition at line 79 of file FtpDTP.h.

Referenced by Close(), Connect(), Initialize(), Listen(), Receive(), and Send().

bool FtpDTP::passive [private]

Definition at line 86 of file FtpDTP.h.

Referenced by Close(), Initialize(), List(), Retrieve(), SetIP(), SetPort(), and Store().

bool FtpDTP::total [private]

Definition at line 95 of file FtpDTP.h.

Referenced by List(), and ListSend().


The documentation for this class was generated from the following files:
Generated on Thu Dec 7 01:31:56 2006 for DT2005.panorama by  doxygen 1.4.7