00001 // 00002 // This program is free software; you can redistribute it and/or 00003 // modify it under the terms of the GNU General Public License 00004 // as published by the Free Software Foundation; either version 2 00005 // of the License, or (at your option) any later version. 00006 // 00007 // This program is distributed in the hope that it will be useful, 00008 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00009 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00010 // GNU General Public License for more details. 00011 // 00012 // You should have received a copy of the GNU General Public License 00013 // along with this program; if not, write to the Free Software 00014 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00015 // 00016 00022 #ifndef __IPV4UNDERLAYCONFIGURATOR_H__ 00023 #define __IPV4UNDERLAYCONFIGURATOR_H__ 00024 00025 #include <vector> 00026 #include <deque> 00027 #include <set> 00028 00029 #include <omnetpp.h> 00030 00031 #include <UnderlayConfigurator.h> 00032 00033 class IPvXAddress; 00034 00041 class InetUnderlayConfigurator : public UnderlayConfigurator 00042 { 00043 public: 00050 TransportAddress* createNode(NodeType type, bool initialize=false); 00051 00058 void preKillNode(NodeType type, TransportAddress* addr=NULL); 00059 00066 void migrateNode(NodeType type, TransportAddress* addr=NULL); 00067 00068 private: 00069 // parameters 00070 int accessRouterNum; 00071 int overlayAccessRouterNum; 00072 int overlayTerminalNum; 00074 protected: 00075 00083 void initializeUnderlay(int stage); 00084 00085 void setUpIPv4(cTopology &topo); 00086 void setUpIPv6(cTopology &topo); 00087 00093 void handleTimerEvent(cMessage* msg); 00094 00098 void finishUnderlay(); 00099 00103 void setDisplayString(); 00104 std::vector<cModule*> accessNode; 00105 std::deque<IPvXAddress> killList; 00106 std::set<int> scheduledID; 00107 00108 // statistics 00109 int numCreated; 00110 int numKilled; 00111 }; 00112 00122 double uniform2(double start, double end, double index, double new_calc); 00123 00133 double intuniform2(double start, double end, double index, double new_calc); 00134 00135 00136 #endif