From 2d07bbdf2cd1291ab5e2fbd634bad38c40340090 Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Tue, 16 Oct 2007 15:43:26 +0200 Subject: [PATCH] configure correctly the ipv4 layer --- samples/main-adhoc-wifi.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/samples/main-adhoc-wifi.cc b/samples/main-adhoc-wifi.cc index dada98a31..9a80cd889 100644 --- a/samples/main-adhoc-wifi.cc +++ b/samples/main-adhoc-wifi.cc @@ -30,6 +30,7 @@ #include "ns3/ipv4.h" #include "ns3/random-variable.h" #include "ns3/inet-socket-address.h" +#include "ns3/global-route-manager.h" #include @@ -50,6 +51,8 @@ CreateAdhocNode (Ptr channel, Ptr ipv4 = node->QueryInterface (Ipv4::iid); uint32_t index = ipv4->AddInterface (device); ipv4->SetAddress (index, Ipv4Address (address)); + ipv4->SetNetworkMask (index, Ipv4Mask ("255.255.0.0")); + ipv4->SetUp (index); return node; } @@ -115,6 +118,8 @@ int main (int argc, char *argv[]) app->Start (Seconds (0.5)); app->Stop (Seconds (43.0)); + GlobalRouteManager::PopulateRoutingTables (); + Simulator::Run (); Simulator::Destroy ();