1 #ifndef __DFTPD__SESSION_HPP__
2 #define __DFTPD__SESSION_HPP__
8 #include "Filesystem.hpp"
9 #include "ServerPtr.hpp"
10 #include "SessionControllerPtr.hpp"
11 #include "SessionPtr.hpp"
14 #include "TelnetPtr.hpp"
34 static SessionPtr
Create( int controlSock
, const SessionControllerPtr
& sessionController
, const AuthPtr
& auth
, const std::string
& ip
, const ServerWPtr
& server
);
39 void DataConnectionFinished();
40 void DataConnectionError();
43 std::list
<int> GetFds() const;
46 Session( int controlSock
, const SessionControllerPtr
& sessionController
, const AuthPtr
& auth
, const std::string
& ip
, const ServerWPtr
& server
);
51 void SendSyntaxError();
52 void SendNotLoggedIn();
53 void SendDataConnectionBusy();
57 PassState
AwaitPassword();
60 void HandleMode( const Command
& cmd
);
61 void HandleType( const Command
& cmd
);
62 void HandleStru( const Command
& cmd
);
63 void HandlePort( const Command
& cmd
);
64 void HandleRetr( const Command
& cmd
);
65 void HandleStor( const Command
& cmd
);
67 void HandleList( const Command
& cmd
);
68 void HandlePasv( const Command
& cmd
);
69 void HandleDele( const Command
& cmd
);
70 void HandleMkd( const Command
& cmd
);
71 void HandleRmd( const Command
& cmd
);
73 void PrintDirectory();
74 void ChangeDirectory( const Command
& cmd
);
75 void ChangeDirectory( const std::string
& cmd
);
77 void Upload( const Command
& cmd
);
78 void Download( const Command
& cmd
);
80 bool OpenDataConnection();
82 Command
GetCommand() { return ParseCommand( m_control
->GetBuf() ); }
90 std::string m_dataAddress
;
98 SessionControllerWPtr m_sessionController
;
101 FilesystemPtr m_filesystem
;