use Ipv4InterfaceContainer to avoid hardcoding ip addresses.
This commit is contained in:
@@ -149,7 +149,7 @@ int main (int argc, char *argv[])
|
||||
ipv4.SetBase ("10.1.3.0", "255.255.255.0");
|
||||
ipv4.Allocate (dev0);
|
||||
ipv4.SetBase ("10.1.2.0", "255.255.255.0");
|
||||
ipv4.Allocate (dev1);
|
||||
Ipv4InterfaceContainer ipInterfs = ipv4.Allocate (dev1);
|
||||
|
||||
// and setup ip routing tables to get total ip-level connectivity.
|
||||
GlobalRouteManager::PopulateRoutingTables ();
|
||||
@@ -177,7 +177,7 @@ int main (int argc, char *argv[])
|
||||
Ptr<Socket> localSocket = socketFactory->CreateSocket ();
|
||||
localSocket->Bind ();
|
||||
Simulator::ScheduleNow (&StartFlow, localSocket, nBytes,
|
||||
Ipv4Address ("10.1.2.2"), servPort);
|
||||
ipInterfs.GetAddress (1), servPort);
|
||||
|
||||
// Configure tracing of all enqueue, dequeue, and NetDevice receive events
|
||||
// Trace output will be sent to the simple-examples.tr file
|
||||
|
||||
Reference in New Issue
Block a user