|
119 |
int totlinks = inFile->LinksSize (); |
119 |
int totlinks = inFile->LinksSize (); |
120 |
|
120 |
|
121 |
NS_LOG_INFO ("creating node containers"); |
121 |
NS_LOG_INFO ("creating node containers"); |
122 |
NodeContainer nc[totlinks]; |
122 |
NodeContainer* nc = new NodeContainer[totlinks]; |
123 |
TopologyReader::ConstLinksIterator iter; |
123 |
TopologyReader::ConstLinksIterator iter; |
124 |
int i = 0; |
124 |
int i = 0; |
125 |
for ( iter = inFile->LinksBegin (); iter != inFile->LinksEnd (); iter++, i++ ) |
125 |
for ( iter = inFile->LinksBegin (); iter != inFile->LinksEnd (); iter++, i++ ) |
|
128 |
} |
128 |
} |
129 |
|
129 |
|
130 |
NS_LOG_INFO ("creating net device containers"); |
130 |
NS_LOG_INFO ("creating net device containers"); |
131 |
NetDeviceContainer ndc[totlinks]; |
131 |
NetDeviceContainer* ndc = new NetDeviceContainer[totlinks]; |
132 |
PointToPointHelper p2p; |
132 |
PointToPointHelper p2p; |
133 |
for (int i = 0; i < totlinks; i++) |
133 |
for (int i = 0; i < totlinks; i++) |
134 |
{ |
134 |
{ |
|
140 |
|
140 |
|
141 |
// it crates little subnets, one for each couple of nodes. |
141 |
// it crates little subnets, one for each couple of nodes. |
142 |
NS_LOG_INFO ("creating ipv4 interfaces"); |
142 |
NS_LOG_INFO ("creating ipv4 interfaces"); |
143 |
Ipv4InterfaceContainer ipic[totlinks]; |
143 |
Ipv4InterfaceContainer* ipic = new Ipv4InterfaceContainer[totlinks]; |
144 |
for (int i = 0; i < totlinks; i++) |
144 |
for (int i = 0; i < totlinks; i++) |
145 |
{ |
145 |
{ |
146 |
ipic[i] = address.Assign (ndc[i]); |
146 |
ipic[i] = address.Assign (ndc[i]); |
|
200 |
Simulator::Run (); |
200 |
Simulator::Run (); |
201 |
Simulator::Destroy (); |
201 |
Simulator::Destroy (); |
202 |
|
202 |
|
|
|
203 |
delete[] ipic; |
204 |
delete[] ndc; |
205 |
delete[] nc; |
206 |
|
203 |
NS_LOG_INFO ("Done."); |
207 |
NS_LOG_INFO ("Done."); |
204 |
|
208 |
|
205 |
return 0; |
209 |
return 0; |