00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef _TinyFTPD_h_DEFINED
00013 #define _TinyFTPD_h_DEFINED
00014
00015 #include <OPENR/OObject.h>
00016 #include <OPENR/OSubject.h>
00017 #include <OPENR/OObserver.h>
00018 #include <OPENR/OList.h>
00019 #include "FtpConfig.h"
00020 #include "FtpPI.h"
00021 #include "def.h"
00022
00023 class TinyFTPD : public OObject
00024 {
00025 public:
00026 TinyFTPD();
00027 virtual ~TinyFTPD() {}
00028
00029 OSubject* subject[numOfSubject];
00030 OObserver* observer[numOfObserver];
00031
00032 virtual OStatus DoInit (const OSystemEvent& event);
00033 virtual OStatus DoStart (const OSystemEvent& event);
00034 virtual OStatus DoStop (const OSystemEvent& event);
00035 virtual OStatus DoDestroy(const OSystemEvent& event);
00036
00037 void ListenContforPI (ANTENVMSG msg);
00038 void SendContforPI (ANTENVMSG msg);
00039 void ReceiveContforPI (ANTENVMSG msg);
00040 void CloseContforPI (ANTENVMSG msg);
00041 void ListenContforDTP (ANTENVMSG msg);
00042 void ConnectContforDTP(ANTENVMSG msg);
00043 void SendContforDTP (ANTENVMSG msg);
00044 void ReceiveContforDTP(ANTENVMSG msg);
00045 void CloseContforDTP (ANTENVMSG msg);
00046
00047 private:
00048 OStatus LoadPasswd();
00049 OStatus Load(char* path, byte** data, size_t* size);
00050
00051 antStackRef ipstackRef;
00052 FtpPI ftpPI[FTP_CONNECTION_MAX];
00053
00054 OList<Passwd, MAX_LOGIN> passwd;
00055 };
00056
00057 #endif