#include #include #include #include #include #include #include #include "./socket.h" #include "./filesystem.h" #include #include "./json.h" namespace FTP { static std::string FTPBasePath = "/tmp/mist/OnDemand/"; enum Mode{ MODE_STREAM, }; //FTP::Mode enumeration enum Structure{ STRU_FILE, STRU_RECORD, }; //FTP::Structure enumeration enum Type{ TYPE_ASCII_NONPRINT, TYPE_IMAGE_NONPRINT, }; //FTP::Type enumeration enum Commands{ CMD_NOCMD, CMD_NOOP, CMD_USER, CMD_PASS, CMD_QUIT, CMD_PORT, CMD_RETR, CMD_STOR, CMD_TYPE, CMD_MODE, CMD_STRU, CMD_EPSV, CMD_PASV, CMD_LIST, CMD_PWD, CMD_CWD, CMD_CDUP, CMD_DELE, CMD_RMD, CMD_MKD, CMD_RNFR, CMD_RNTO, }; //FTP::Commands enumeration class User{ public: User(Socket::Connection NewConnection, std::map Credentials); ~User(); int ParseCommand(std::string Command); bool LoggedIn(); std::string NumToMsg(int MsgNum); Socket::Connection Conn; private: std::map AllCredentials; std::string USER; std::string PASS; Mode MODE; Structure STRU; Type TYPE; int PORT; Socket::Server Passive; int MyPassivePort; Filesystem::Directory MyDir; std::string RNFR; std::vector ActiveStreams; }; //FTP::User class }//FTP Namespace