00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef _FtpPI_h_DEFINED
00013 #define _FtpPI_h_DEFINED
00014
00015 #include <OPENR/OList.h>
00016 #include "TCPConnection.h"
00017 #include "FtpConfig.h"
00018 #include "FtpDTP.h"
00019 #include "def.h"
00020 #include "entry.h"
00021
00022 class FtpPI
00023 {
00024 public:
00025 FtpPI();
00026 virtual ~FtpPI() {}
00027
00028 OStatus Initialize(const OID& myoid, const antStackRef& ipstack,
00029 void* index, OList<Passwd, MAX_LOGIN> *pass);
00030
00031 void ListenCont (TCPEndpointListenMsg* listenMsg);
00032 void SendCont (TCPEndpointSendMsg* sendMsg);
00033 void ReceiveCont (TCPEndpointReceiveMsg* receiveMsg);
00034 void CloseCont (TCPEndpointCloseMsg* closeMsg);
00035
00036 void ListenContforDTP (TCPEndpointListenMsg* listenMsg);
00037 void ConnectContforDTP(TCPEndpointConnectMsg* connectMsg);
00038 void SendContforDTP (TCPEndpointSendMsg* sendMsg);
00039 void ReceiveContforDTP(TCPEndpointReceiveMsg* receiveMsg);
00040 void CloseContforDTP (TCPEndpointCloseMsg* closeMsg);
00041
00042 OStatus Close ();
00043
00044 private:
00045 OStatus Listen ();
00046 OStatus Send (FTPReplyCode, char *format, ...);
00047 OStatus Receive();
00048
00049 bool RequestComplete();
00050 bool RequestProcess ();
00051 bool CommandParser (char **cmd, char **param);
00052
00053 OID myOID;
00054 antStackRef ipstackRef;
00055 void* continuation;
00056 TCPConnection connection;
00057 FTPLoginState state;
00058 FtpDTP ftpDTP;
00059 IPAddress ipaddr;
00060
00061 OList<Passwd, MAX_LOGIN> *passwd;
00062 };
00063 #endif
00064