OverSim
InetUnderlayConfigurator.h
Go to the documentation of this file.
1 //
2 // This program is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU General Public License
4 // as published by the Free Software Foundation; either version 2
5 // of the License, or (at your option) any later version.
6 //
7 // This program is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 // GNU General Public License for more details.
11 //
12 // You should have received a copy of the GNU General Public License
13 // along with this program; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15 //
16 
22 #ifndef __IPV4UNDERLAYCONFIGURATOR_H__
23 #define __IPV4UNDERLAYCONFIGURATOR_H__
24 
25 #include <vector>
26 #include <deque>
27 #include <set>
28 
29 #include <omnetpp.h>
30 
31 #include <UnderlayConfigurator.h>
32 
33 class IPvXAddress;
34 
42 {
43 public:
51 
58  void preKillNode(NodeType type, TransportAddress* addr=NULL);
59 
66  void migrateNode(NodeType type, TransportAddress* addr=NULL);
67 
68 private:
69  // parameters
74 protected:
75 
83  void initializeUnderlay(int stage);
84 
85  void setUpIPv4(cTopology &topo);
86  void setUpIPv6(cTopology &topo);
87 
93  void handleTimerEvent(cMessage* msg);
94 
98  void finishUnderlay();
99 
103  void setDisplayString();
104  std::vector<cModule*> accessNode;
105  std::deque<IPvXAddress> killList;
106  std::set<int> scheduledID;
107 
108  // statistics
110  int numKilled;
111 };
112 
122 double uniform2(double start, double end, double index, double new_calc);
123 
133 double intuniform2(double start, double end, double index, double new_calc);
134 
135 
136 #endif