commit 1751d431c93693d6a3b28d391754bbc7c811b19d Author: Brad Arant Date: Wed Jul 10 20:13:12 2019 -0700 Initial repository load. diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2afd6d5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +Debug +Release +*.o +*~ +*.mk +libBMAMail.a diff --git a/BMAIMAPServer.h b/BMAIMAPServer.h new file mode 100644 index 0000000..8248a59 --- /dev/null +++ b/BMAIMAPServer.h @@ -0,0 +1,25 @@ +#ifndef BMAIMAPServer_h__ +#define BMAIMAPServer_h__ + +#include "includes" +#include "BMATCPServerSocket.h" +#include "BMACommand.h" +class BMATCPSocket; + +class BMAIMAPServer : public BMATCPServerSocket { + + public: + BMAIMAPServer(BMAEPoll &ePoll, std::string url, short int port); + ~BMAIMAPServer(); + + BMASession * getSocketAccept(); + + void registerCommand(BMACommand &command); + + int processCommand(BMASession *session) override; /// commands; + +}; + +#endif diff --git a/BMAIMAPSession.h b/BMAIMAPSession.h new file mode 100644 index 0000000..2b50952 --- /dev/null +++ b/BMAIMAPSession.h @@ -0,0 +1,34 @@ +#ifndef __BMAIMAPSession_h__ +#define __BMAIMAPSession_h__ + +#include "BMASession.h" +#include "BMAIMAPServer.h" + +/// +/// BMAIMAPSession +/// +/// Extends the session parameters for this BMATCPSocket derived object. +/// Extend the protocol() method in order to define the behavior and +/// protocol interaction for this socket which is an IMAP session. +/// + +class BMAIMAPSession : public BMASession { + + public: + BMAIMAPSession(BMAEPoll &ePoll, BMAConsoleServer &server); + ~BMAIMAPSession(); + + virtual void output(std::stringstream &out); + + protected: + void protocol(char *data, int length) override; + +private: + BMAConsoleServer &server; + enum Status {WELCOME, PROMPT, INPUT, PROCESS, DONE}; + Status status = WELCOME; + void doCommand(std::string request); + +}; + +#endif diff --git a/BMAMail.project b/BMAMail.project new file mode 100644 index 0000000..86b7586 --- /dev/null +++ b/BMAMail.project @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + None + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BMAMail.txt b/BMAMail.txt new file mode 100644 index 0000000..6716386 --- /dev/null +++ b/BMAMail.txt @@ -0,0 +1 @@ +./Debug/main.cpp.o diff --git a/BMAPOP3Server.h b/BMAPOP3Server.h new file mode 100644 index 0000000..287393d --- /dev/null +++ b/BMAPOP3Server.h @@ -0,0 +1,25 @@ +#ifndef BMAPOP3Server_h__ +#define BMAPOP3Server_h__ + +#include "includes" +#include "BMATCPServerSocket.h" +#include "BMACommand.h" +class BMATCPSocket; + +class BMAPOP3Server : public BMATCPServerSocket { + + public: + BMAPOP3Server(BMAEPoll &ePoll, std::string url, short int port); + ~BMAPOP3Server(); + + BMASession * getSocketAccept(); + + void registerCommand(BMACommand &command); + + int processCommand(BMASession *session) override; /// commands; + +}; + +#endif diff --git a/BMAPOP3Session.h b/BMAPOP3Session.h new file mode 100644 index 0000000..dde6a7c --- /dev/null +++ b/BMAPOP3Session.h @@ -0,0 +1,34 @@ +#ifndef __BMAPOP3Session_h__ +#define __BMAPOP3Session_h__ + +#include "BMASession.h" +#include "BMAPOP3Server.h" + +/// +/// BMAPOP3Session +/// +/// Extends the session parameters for this BMATCPSocket derived object. +/// Extend the protocol() method in order to define the behavior and +/// protocol interaction for this socket which is a console session. +/// + +class BMAPOP3Session : public BMASession { + + public: + BMAPOP3Session(BMAEPoll &ePoll, BMAPOP3Server &server); + ~BMAPop3Session(); + + virtual void output(std::stringstream &out); + + protected: + void protocol(char *data, int length) override; + +private: + BMAConsoleServer &server; + enum Status {WELCOME, PROMPT, INPUT, PROCESS, DONE}; + Status status = WELCOME; + void doCommand(std::string request); + +}; + +#endif diff --git a/BMASMTPServer.h b/BMASMTPServer.h new file mode 100644 index 0000000..e65cc4e --- /dev/null +++ b/BMASMTPServer.h @@ -0,0 +1,31 @@ +#ifndef BMAConsoleServer_h__ +#define BMAConsoleServer_h__ + +#include "includes" +#include "BMATCPServerSocket.h" +#include "BMACommand.h" +class BMATCPSocket; + +/// +/// BMASMTPServer +/// +/// Use this object to create a fully supported SMTP server. +/// + +class BMASMTPServer : public BMATCPServerSocket { + + public: + BMASMTPServer(BMAEPoll &ePoll, std::string url, short int port); + ~BMASMTPServer(); + + BMASession * getSocketAccept() override; + + void registerCommand(BMACommand &command); + + int processCommand(BMASession *session) override; /// commands; + +}; + +#endif diff --git a/BMASMTPSession.h b/BMASMTPSession.h new file mode 100644 index 0000000..9095e9c --- /dev/null +++ b/BMASMTPSession.h @@ -0,0 +1,33 @@ +#ifndef __BMASMTPSession_h__ +#define __BMASMTPSession_h__ + +#include "BMASession.h" + +/// +/// BMAConsoleSession +/// +/// Extends the session parameters for this BMATCPSocket derived object. +/// Extend the protocol() method in order to define the behavior and +/// protocol interaction for this socket which is a console session. +/// + +class BMASMTPSession : public BMASession { + + public: + BMAConsoleSession(BMAEPoll &ePoll, BMAConsoleServer &server); + ~BMAConsoleSession(); + + virtual void output(std::stringstream &out); + + protected: + void protocol(char *data, int length) override; + +private: + BMAConsoleServer &server; + enum Status {WELCOME, PROMPT, INPUT, PROCESS, DONE}; + Status status = WELCOME; + void doCommand(std::string request); + +}; + +#endif diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..82bd805 --- /dev/null +++ b/main.cpp @@ -0,0 +1,7 @@ +#include + +int main(int argc, char **argv) +{ + printf("hello world\n"); + return 0; +}