User Manual, Developers Guide and API Documentation

Email.hpp

Go to the documentation of this file.
00001 /*******************************************************************************
00002  * This file is part of openWNS (open Wireless Network Simulator)
00003  * _____________________________________________________________________________
00004  *
00005  * Copyright (C) 2004-2007
00006  * Chair of Communication Networks (ComNets)
00007  * Kopernikusstr. 5, D-52074 Aachen, Germany
00008  * phone: ++49-241-80-27910,
00009  * fax: ++49-241-80-22242
00010  * email: info@openwns.org
00011  * www: http://www.openwns.org
00012  * _____________________________________________________________________________
00013  *
00014  * openWNS is free software; you can redistribute it and/or modify it under the
00015  * terms of the GNU Lesser General Public License version 2 as published by the
00016  * Free Software Foundation;
00017  *
00018  * openWNS is distributed in the hope that it will be useful, but WITHOUT ANY
00019  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
00020  * A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00021  * details.
00022  *
00023  * You should have received a copy of the GNU Lesser General Public License
00024  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00025  *
00026  ******************************************************************************/
00027 
00028 #ifndef APPLICATIONS_SESSION_SERVER_EMAIL_HPP
00029 #define APPLICATIONS_SESSION_SERVER_EMAIL_HPP
00030 
00031 #include <APPLICATIONS/session/server/Session.hpp>
00032 
00033 namespace applications { namespace session { namespace server {
00034 
00035       /* EmailStates are used to see Sessionphase */
00036       enum ServerEmailState
00037     {
00038       sendpop3ok = 1,
00039       sendusernameok = 2,
00040       sendpasswordok = 3,
00041       sendemail = 4,
00042       sendsmtpok = 5
00043     };
00044 
00045       class Email :
00046     public applications::session::server::Session
00047       {
00048       public:
00049     Email(const wns::pyconfig::View& _pyco);
00050     ~Email();
00051 
00052     void
00053     onData(const wns::osi::PDUPtr& _pdu);
00054 
00055     void
00056     onTimeout(const Timeout& _t);
00057 
00058       private:
00059     /* According to "IEEE 802.16m Evaluation Methodology Document(2009), Page 121-122,
00060        section 10.7" the Mean number of received emails every day is 30. */
00061     wns::distribution::Distribution* numberOfEmailsDistribution;
00062     int numberOfEmails;
00063 
00064     /* emailChoice is used to decide between large or small emailsize.
00065        Therefor a random value between 0.0 and 1.0 is Uniform distributed.*/
00066     wns::distribution::Distribution* emailSizeChoiceDistribution;
00067 
00068     /* 80% of all emails have an average size of 22.7KB because they have no attachments.
00069        The values are Cauchy distributed. This is according to "IEEE 802.16m Evaluation
00070        Methodology Document(2009), Page 121-122, section 10.7". */
00071     wns::distribution::Distribution* smallEmailSizeDistribution;
00072     /* 20% of all emails have attachments and so an avreage size of 227KB. The values
00073        are also Cauchy distributed. This is according to "IEEE 802.16m Evaluation
00074        Methodology Document(2009), Page 121-122, section 10.7". */
00075     wns::distribution::Distribution* largeEmailSizeDistribution;
00076 
00077 
00078     applications::session::server::ServerEmailState emailState;
00079     bool lastEmailSent;
00080     bool request;
00081       };
00082     } // namespace server
00083   } // namespace session
00084 } // namespace applications
00085 
00086 #endif //APPLICATIONS_SESSION_SERVER_EMAIL_HPP

Generated on Sun May 27 03:32:15 2012 for openWNS by  doxygen 1.5.5