equal
deleted
inserted
replaced
35 |
35 |
36 int |
36 int |
37 main (int argc, char *argv[]) |
37 main (int argc, char *argv[]) |
38 { |
38 { |
39 bool verbose = true; |
39 bool verbose = true; |
|
40 uint32_t nCsma = 3; |
40 |
41 |
41 uint32_t nCsma = 3; |
|
42 CommandLine cmd; |
42 CommandLine cmd; |
43 cmd.AddValue ("nCsma", "Number of \"extra\" CSMA nodes/devices", nCsma); |
43 cmd.AddValue ("nCsma", "Number of \"extra\" CSMA nodes/devices", nCsma); |
44 cmd.AddValue ("verbose", "Tell echo applications to log if true", verbose); |
44 cmd.AddValue ("verbose", "Tell echo applications to log if true", verbose); |
45 |
45 |
46 cmd.Parse (argc,argv); |
46 cmd.Parse (argc,argv); |
48 if (verbose) |
48 if (verbose) |
49 { |
49 { |
50 LogComponentEnable("UdpEchoClientApplication", LOG_LEVEL_INFO); |
50 LogComponentEnable("UdpEchoClientApplication", LOG_LEVEL_INFO); |
51 LogComponentEnable("UdpEchoServerApplication", LOG_LEVEL_INFO); |
51 LogComponentEnable("UdpEchoServerApplication", LOG_LEVEL_INFO); |
52 } |
52 } |
|
53 |
|
54 nCsma = nCsma == 0 ? 1 : nCsma; |
53 |
55 |
54 NodeContainer p2pNodes; |
56 NodeContainer p2pNodes; |
55 p2pNodes.Create (2); |
57 p2pNodes.Create (2); |
56 |
58 |
57 NodeContainer csmaNodes; |
59 NodeContainer csmaNodes; |
100 clientApps.Start (Seconds (2.0)); |
102 clientApps.Start (Seconds (2.0)); |
101 clientApps.Stop (Seconds (10.0)); |
103 clientApps.Stop (Seconds (10.0)); |
102 |
104 |
103 GlobalRouteManager::PopulateRoutingTables (); |
105 GlobalRouteManager::PopulateRoutingTables (); |
104 |
106 |
105 PointToPointHelper::EnablePcap ("second", p2pDevices.Get (1)); |
107 PointToPointHelper::EnablePcapAll ("second"); |
106 CsmaHelper::EnablePcap ("second", csmaDevices.Get (0), true); |
108 CsmaHelper::EnablePcap ("second", csmaDevices.Get (1), true); |
107 |
109 |
108 Simulator::Run (); |
110 Simulator::Run (); |
109 Simulator::Destroy (); |
111 Simulator::Destroy (); |
110 return 0; |
112 return 0; |
111 } |
113 } |