![]() |
User Manual, Developers Guide and API Documentation |
![]() |
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_CLIENT_EMAIL_HPP 00029 #define APPLICATIONS_SESSION_CLIENT_EMAIL_HPP 00030 00031 #include <APPLICATIONS/session/client/Session.hpp> 00032 00033 namespace applications { namespace session { namespace client { 00034 00035 /* EmailStates are used to see Sessionphase */ 00036 enum ClientEmailState 00037 { 00038 reading = 1, 00039 receiving = 2, 00040 requestpop3ok = 3, 00041 waitforpop3ok = 4, 00042 waitforusernameok = 5, 00043 waitforpasswordok = 6, 00044 writing = 7, 00045 sending = 8, 00046 requestsmtpok = 9, 00047 waitforsmtpok = 10, 00048 readlastemail = 11 00049 }; 00050 00051 class Email : 00052 public applications::session::client::Session 00053 { 00054 public: 00055 Email(const wns::pyconfig::View& _pyco); 00056 ~Email(); 00057 00058 void 00059 onData(const wns::osi::PDUPtr& _pdu); 00060 00061 void 00062 onTimeout(const Timeout& _t); 00063 00064 private: 00065 /* According to "IEEE 802.16m Evaluation Methodology Document(2009), Page 121-122, 00066 section 10.7" the mean number of sent emails every day is 14. */ 00067 wns::distribution::Distribution* numberOfEmailsDistribution; 00068 int numberOfEmails; 00069 00070 /* emailChoice is used to decide between large or small emailsize. 00071 Therefor a random value between 0.0 and 1.0 is Uniform distributed.*/ 00072 wns::distribution::Distribution* emailSizeChoiceDistribution; 00073 00074 /* 80% of all emails have an average size of 22.7KB because they have no attachments. 00075 The values are Cauchy distributed. This is according to "IEEE 802.16m Evaluation 00076 Methodology Document(2009), Page 121-122, section 10.7". */ 00077 wns::distribution::Distribution* smallEmailSizeDistribution; 00078 /* 20% of all emails have attachments and so an avreage size of 227KB. The values 00079 are also Cauchy distributed. This is according to "IEEE 802.16m Evaluation 00080 Methodology Document(2009), Page 121-122, section 10.7". */ 00081 wns::distribution::Distribution* largeEmailSizeDistribution; 00082 00083 00084 /* According to "IEEE 802.16m Evaluation Methodology Document(2009), 00085 Page 121-122, section 10.7", the mean readingtime of one received 00086 email is 60sek.. The values are Pareto distributed. */ 00087 wns::distribution::Distribution* emailReadingTimeDistribution; 00088 00089 /* According to "IEEE 802.16m Evaluation Methodology Document(2009), 00090 Page 121-122, section 10.7", the mean writingtime for one email 00091 is 120sek.. The values are Pareto distributed. */ 00092 wns::distribution::Distribution* emailWritingTimeDistribution; 00093 00094 /* emailState1: used for receiving emails */ 00095 applications::session::client::ClientEmailState emailState1; 00096 /* emailState2: used for sending emails */ 00097 applications::session::client::ClientEmailState emailState2; 00098 00099 bool lastEmailSent; 00100 00101 }; 00102 } // nmaespace client 00103 } // namespace session 00104 } // namespace applications 00105 00106 #endif //APPLICATIONS_SESSION_CLIENT_EMAIL_HPP
1.5.5