# HG changeset patch # User Mitch Watrous # Date 1305315523 25200 # Node ID 6e3e0df6f63d62304eaf998f55bd31911ec001e1 # Parent b55a5876af9a29ba8f03a7644dfd22526393107c# Parent 0f12b1572bca84c1a5aab812238bca47a526e233 More edits for manual chapter about adding new modules diff -r b55a5876af9a -r 6e3e0df6f63d examples/energy/energy-model-example.cc --- a/examples/energy/energy-model-example.cc Fri May 13 12:37:28 2011 -0700 +++ b/examples/energy/energy-model-example.cc Fri May 13 12:38:43 2011 -0700 @@ -51,7 +51,7 @@ { InetSocketAddress iaddr = InetSocketAddress::ConvertFrom (from); NS_LOG_UNCOND ("--\nReceived one packet! Socket: "<< iaddr.GetIpv4 () - << " port: " << iaddr.GetPort () << " at time = " << + << " port: " << iaddr.GetPort () << " at time = " << Simulator::Now ().GetSeconds () << "\n--"); } } @@ -68,13 +68,13 @@ */ static void GenerateTraffic (Ptr socket, uint32_t pktSize, Ptr n, - uint32_t pktCount, Time pktInterval) + uint32_t pktCount, Time pktInterval) { if (pktCount > 0) { socket->Send (Create (pktSize)); Simulator::Schedule (pktInterval, &GenerateTraffic, socket, pktSize, n, - pktCount - 1, pktInterval); + pktCount - 1, pktInterval); } else { diff -r b55a5876af9a -r 6e3e0df6f63d examples/error-model/simple-error-model.cc --- a/examples/error-model/simple-error-model.cc Fri May 13 12:37:28 2011 -0700 +++ b/examples/error-model/simple-error-model.cc Fri May 13 12:38:43 2011 -0700 @@ -59,7 +59,7 @@ // Set a few attributes Config::SetDefault ("ns3::RateErrorModel::ErrorRate", DoubleValue (0.01)); Config::SetDefault ("ns3::RateErrorModel::ErrorUnit", StringValue ("EU_PKT")); - + Config::SetDefault ("ns3::OnOffApplication::PacketSize", UintegerValue (210)); Config::SetDefault ("ns3::OnOffApplication::DataRate", DataRateValue (DataRate ("448kb/s"))); @@ -93,13 +93,13 @@ p2p.SetDeviceAttribute ("DataRate", DataRateValue (DataRate (1500000))); p2p.SetChannelAttribute ("Delay", TimeValue (MilliSeconds (10))); NetDeviceContainer d3d2 = p2p.Install (n3n2); - - // Later, we add IP addresses. + + // Later, we add IP addresses. NS_LOG_INFO ("Assign IP Addresses."); Ipv4AddressHelper ipv4; ipv4.SetBase ("10.1.1.0", "255.255.255.0"); ipv4.Assign (d0d2); - + ipv4.SetBase ("10.1.2.0", "255.255.255.0"); Ipv4InterfaceContainer i1i2 = ipv4.Assign (d1d2); @@ -115,7 +115,7 @@ uint16_t port = 9; // Discard port (RFC 863) OnOffHelper onoff ("ns3::UdpSocketFactory", - Address (InetSocketAddress (i3i2.GetAddress (1), port))); + Address (InetSocketAddress (i3i2.GetAddress (1), port))); onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable(1))); onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable(0))); @@ -125,7 +125,7 @@ // Create an optional packet sink to receive these packets PacketSinkHelper sink ("ns3::UdpSocketFactory", - Address (InetSocketAddress (Ipv4Address::GetAny (), port))); + Address (InetSocketAddress (Ipv4Address::GetAny (), port))); apps = sink.Install (c.Get (2)); apps.Start (Seconds (1.0)); apps.Stop (Seconds (10.0)); @@ -150,7 +150,7 @@ // Create an ErrorModel based on the implementation (constructor) // specified by the default classId Ptr em = CreateObjectWithAttributes ("RanVar", RandomVariableValue (UniformVariable (0.0, 1.0)), - "ErrorRate", DoubleValue (0.001)); + "ErrorRate", DoubleValue (0.001)); d3d2.Get (0)->SetAttribute ("ReceiveErrorModel", PointerValue (em)); // Now, let's use the ListErrorModel and explicitly force a loss @@ -168,7 +168,7 @@ p2p.EnablePcapAll ("simple-error-model"); NS_LOG_INFO ("Run Simulation."); - Simulator::Run (); + Simulator::Run (); Simulator::Destroy (); NS_LOG_INFO ("Done."); } diff -r b55a5876af9a -r 6e3e0df6f63d examples/ipv6/fragmentation-ipv6.cc --- a/examples/ipv6/fragmentation-ipv6.cc Fri May 13 12:37:28 2011 -0700 +++ b/examples/ipv6/fragmentation-ipv6.cc Fri May 13 12:38:43 2011 -0700 @@ -82,10 +82,10 @@ { route = routing->GetRoute (i); std::cout << route.GetDest () << "\t" - << route.GetGateway () << "\t" - << route.GetInterface () << "\t" - << route.GetPrefixToUse () << "\t" - << std::endl; + << route.GetGateway () << "\t" + << route.GetInterface () << "\t" + << route.GetPrefixToUse () << "\t" + << std::endl; } } }; diff -r b55a5876af9a -r 6e3e0df6f63d examples/ipv6/icmpv6-redirect.cc --- a/examples/ipv6/icmpv6-redirect.cc Fri May 13 12:37:28 2011 -0700 +++ b/examples/ipv6/icmpv6-redirect.cc Fri May 13 12:38:43 2011 -0700 @@ -82,10 +82,10 @@ { route = routing->GetRoute (i); std::cout << route.GetDest () << "\t" - << route.GetGateway () << "\t" - << route.GetInterface () << "\t" - << route.GetPrefixToUse () << "\t" - << std::endl; + << route.GetGateway () << "\t" + << route.GetInterface () << "\t" + << route.GetPrefixToUse () << "\t" + << std::endl; } } diff -r b55a5876af9a -r 6e3e0df6f63d examples/ipv6/loose-routing-ipv6.cc --- a/examples/ipv6/loose-routing-ipv6.cc Fri May 13 12:37:28 2011 -0700 +++ b/examples/ipv6/loose-routing-ipv6.cc Fri May 13 12:38:43 2011 -0700 @@ -33,8 +33,8 @@ // // +------------+ | | | // // | Host 1 |--| | +------------+ | // // [------------] |---| Router 3 |---| -// // [------------] -// // +// // [------------] +// // // // // // - Tracing of queues and packet receptions to file "loose-routing-ipv6.tr" diff -r b55a5876af9a -r 6e3e0df6f63d examples/ipv6/ping6.cc --- a/examples/ipv6/ping6.cc Fri May 13 12:37:28 2011 -0700 +++ b/examples/ipv6/ping6.cc Fri May 13 12:38:43 2011 -0700 @@ -20,7 +20,7 @@ // Network topology // -// n0 n1 +// n0 n1 // | | // ================= // LAN diff -r b55a5876af9a -r 6e3e0df6f63d examples/ipv6/radvd-two-prefix.cc --- a/examples/ipv6/radvd-two-prefix.cc Fri May 13 12:37:28 2011 -0700 +++ b/examples/ipv6/radvd-two-prefix.cc Fri May 13 12:38:43 2011 -0700 @@ -89,10 +89,10 @@ { route = routing->GetRoute (i); std::cout << route.GetDest () << "\t" - << route.GetGateway () << "\t" - << route.GetInterface () << "\t" - << route.GetPrefixToUse () << "\t" - << std::endl; + << route.GetGateway () << "\t" + << route.GetInterface () << "\t" + << route.GetPrefixToUse () << "\t" + << std::endl; } } }; diff -r b55a5876af9a -r 6e3e0df6f63d examples/matrix-topology/matrix-topology.cc --- a/examples/matrix-topology/matrix-topology.cc Fri May 13 12:37:28 2011 -0700 +++ b/examples/matrix-topology/matrix-topology.cc Fri May 13 12:38:43 2011 -0700 @@ -278,7 +278,7 @@ bool animEnabled = false; AnimationInterface anim; if (anim.SetServerPort (9) && anim.SetOutputFile (anim_name.c_str ())) - { + { NS_LOG_INFO ("Animation Interface Enabled."); animEnabled = true; anim.StartAnimation (); diff -r b55a5876af9a -r 6e3e0df6f63d examples/realtime/realtime-udp-echo.cc --- a/examples/realtime/realtime-udp-echo.cc Fri May 13 12:37:28 2011 -0700 +++ b/examples/realtime/realtime-udp-echo.cc Fri May 13 12:38:43 2011 -0700 @@ -50,7 +50,7 @@ // that. // GlobalValue::Bind ("SimulatorImplementationType", - StringValue ("ns3::RealtimeSimulatorImpl")); + StringValue ("ns3::RealtimeSimulatorImpl")); // // Explicitly create the nodes required by the topology (shown above). diff -r b55a5876af9a -r 6e3e0df6f63d examples/routing/dynamic-global-routing.cc --- a/examples/routing/dynamic-global-routing.cc Fri May 13 12:37:28 2011 -0700 +++ b/examples/routing/dynamic-global-routing.cc Fri May 13 12:38:43 2011 -0700 @@ -50,7 +50,7 @@ // keeps the point-to-point link "up" from n1's perspective). Traffic will // flow through the path n1-n2-n5-n6 // At time 8s, bring the interface back up. Path n1-n6 is restored -// At time 10s, stop the first flow. +// At time 10s, stop the first flow. // At time 11s, start a new flow, but to n6's other IP address (the one // on the n1/n6 p2p link) // At time 12s, bring the n1 interface down between n1 and n6. Packets @@ -58,7 +58,7 @@ // At time 14s, re-enable the n1/n6 interface to up. This will change // routing back to n1-n6 since the interface up notification will cause // a new local interface route, at higher priority than global routing -// At time 16s, stop the second flow. +// At time 16s, stop the second flow. // - Tracing of queues and packet receptions to file "dynamic-global-routing.tr" @@ -122,8 +122,8 @@ csma.SetChannelAttribute ("DataRate", StringValue ("5Mbps")); csma.SetChannelAttribute ("Delay", StringValue ("2ms")); NetDeviceContainer d2345 = csma.Install (n2345); - - // Later, we add IP addresses. + + // Later, we add IP addresses. NS_LOG_INFO ("Assign IP Addresses."); Ipv4AddressHelper ipv4; ipv4.SetBase ("10.1.1.0", "255.255.255.0"); @@ -163,7 +163,7 @@ // Create a second OnOff application to send UDP datagrams of size // 210 bytes at a rate of 448 Kb/s OnOffHelper onoff2 ("ns3::UdpSocketFactory", - InetSocketAddress (i1i6.GetAddress (1), port)); + InetSocketAddress (i1i6.GetAddress (1), port)); onoff2.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1))); onoff2.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0))); onoff2.SetAttribute ("DataRate", StringValue ("2kbps")); @@ -175,13 +175,13 @@ // Create an optional packet sink to receive these packets PacketSinkHelper sink ("ns3::UdpSocketFactory", - Address (InetSocketAddress (Ipv4Address::GetAny (), port))); + Address (InetSocketAddress (Ipv4Address::GetAny (), port))); apps = sink.Install (c.Get (6)); apps.Start (Seconds (1.0)); apps.Stop (Seconds (10.0)); PacketSinkHelper sink2 ("ns3::UdpSocketFactory", - Address (InetSocketAddress (Ipv4Address::GetAny (), port))); + Address (InetSocketAddress (Ipv4Address::GetAny (), port))); apps2 = sink2.Install (c.Get (6)); apps2.Start (Seconds (11.0)); apps2.Stop (Seconds (16.0)); diff -r b55a5876af9a -r 6e3e0df6f63d examples/routing/global-injection-slash32.cc --- a/examples/routing/global-injection-slash32.cc Fri May 13 12:37:28 2011 -0700 +++ b/examples/routing/global-injection-slash32.cc Fri May 13 12:38:43 2011 -0700 @@ -79,7 +79,7 @@ NetDeviceContainer dAdB = p2p.Install (nAnB); NetDeviceContainer dBdC = p2p.Install (nBnC);; - + Ptr deviceA = CreateObject (); deviceA->SetAddress (Mac48Address::Allocate ()); nA->AddDevice (deviceA); @@ -88,7 +88,7 @@ deviceC->SetAddress (Mac48Address::Allocate ()); nC->AddDevice (deviceC); - // Later, we add IP addresses. + // Later, we add IP addresses. Ipv4AddressHelper ipv4; ipv4.SetBase ("10.1.1.0", "255.255.255.252"); Ipv4InterfaceContainer iAiB = ipv4.Assign (dAdB); @@ -99,10 +99,10 @@ Ptr ipv4A = nA->GetObject (); Ptr ipv4B = nB->GetObject (); Ptr ipv4C = nC->GetObject (); - + int32_t ifIndexA = ipv4A->AddInterface (deviceA); int32_t ifIndexC = ipv4C->AddInterface (deviceC); - + Ipv4InterfaceAddress ifInAddrA = Ipv4InterfaceAddress (Ipv4Address ("172.16.1.1"), Ipv4Mask ("255.255.255.255")); ipv4A->AddAddress (ifIndexA, ifInAddrA); ipv4A->SetMetric (ifIndexA, 1); @@ -115,7 +115,7 @@ // Create router nodes, initialize routing database and set up the routing // tables in the nodes. - + // Populate routing tables for nodes nA and nB Ipv4GlobalRoutingHelper::PopulateRoutingTables (); // Inject global routes from Node B, including transit network... @@ -123,19 +123,19 @@ globalRouterB->InjectRoute ("10.1.1.4", "255.255.255.252"); // ...and the host in network "C" globalRouterB->InjectRoute ("192.168.1.1", "255.255.255.255"); - + Ipv4GlobalRoutingHelper::RecomputeRoutingTables(); // In addition, nB needs a static route to nC so it knows what to do with stuff // going to 192.168.1.1 Ipv4StaticRoutingHelper ipv4RoutingHelper; Ptr staticRoutingB = ipv4RoutingHelper.GetStaticRouting(ipv4B); staticRoutingB->AddHostRouteTo (Ipv4Address ("192.168.1.1"), Ipv4Address ("10.1.1.6"),2); - + // Create the OnOff application to send UDP datagrams of size // 210 bytes at a rate of 448 Kb/s uint16_t port = 9; // Discard port (RFC 863) OnOffHelper onoff ("ns3::UdpSocketFactory", - Address (InetSocketAddress (ifInAddrC.GetLocal(), port))); + Address (InetSocketAddress (ifInAddrC.GetLocal(), port))); onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1))); onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0))); onoff.SetAttribute ("DataRate", DataRateValue (DataRate (6000))); @@ -145,7 +145,7 @@ // Create a packet sink to receive these packets PacketSinkHelper sink ("ns3::UdpSocketFactory", - Address (InetSocketAddress (Ipv4Address::GetAny (), port))); + Address (InetSocketAddress (Ipv4Address::GetAny (), port))); apps = sink.Install (nC); apps.Start (Seconds (1.0)); apps.Stop (Seconds (10.0)); diff -r b55a5876af9a -r 6e3e0df6f63d examples/routing/global-routing-slash32.cc --- a/examples/routing/global-routing-slash32.cc Fri May 13 12:37:28 2011 -0700 +++ b/examples/routing/global-routing-slash32.cc Fri May 13 12:38:43 2011 -0700 @@ -65,7 +65,7 @@ NetDeviceContainer dAdB = p2p.Install (nAnB); NetDeviceContainer dBdC = p2p.Install (nBnC);; - + Ptr deviceA = CreateObject (); deviceA->SetAddress (Mac48Address::Allocate ()); nA->AddDevice (deviceA); @@ -74,7 +74,7 @@ deviceC->SetAddress (Mac48Address::Allocate ()); nC->AddDevice (deviceC); - // Later, we add IP addresses. + // Later, we add IP addresses. Ipv4AddressHelper ipv4; ipv4.SetBase ("10.1.1.0", "255.255.255.252"); Ipv4InterfaceContainer iAiB = ipv4.Assign (dAdB); @@ -84,10 +84,10 @@ Ptr ipv4A = nA->GetObject (); Ptr ipv4C = nC->GetObject (); - + int32_t ifIndexA = ipv4A->AddInterface (deviceA); int32_t ifIndexC = ipv4C->AddInterface (deviceC); - + Ipv4InterfaceAddress ifInAddrA = Ipv4InterfaceAddress (Ipv4Address ("172.16.1.1"), Ipv4Mask ("255.255.255.255")); ipv4A->AddAddress (ifIndexA, ifInAddrA); ipv4A->SetMetric (ifIndexA, 1); @@ -106,7 +106,7 @@ // 210 bytes at a rate of 448 Kb/s uint16_t port = 9; // Discard port (RFC 863) OnOffHelper onoff ("ns3::UdpSocketFactory", - Address (InetSocketAddress (ifInAddrC.GetLocal(), port))); + Address (InetSocketAddress (ifInAddrC.GetLocal(), port))); onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1))); onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0))); onoff.SetAttribute ("DataRate", DataRateValue (DataRate (6000))); @@ -116,7 +116,7 @@ // Create a packet sink to receive these packets PacketSinkHelper sink ("ns3::UdpSocketFactory", - Address (InetSocketAddress (Ipv4Address::GetAny (), port))); + Address (InetSocketAddress (Ipv4Address::GetAny (), port))); apps = sink.Install (nC); apps.Start (Seconds (1.0)); apps.Stop (Seconds (10.0)); diff -r b55a5876af9a -r 6e3e0df6f63d examples/routing/mixed-global-routing.cc --- a/examples/routing/mixed-global-routing.cc Fri May 13 12:37:28 2011 -0700 +++ b/examples/routing/mixed-global-routing.cc Fri May 13 12:38:43 2011 -0700 @@ -87,8 +87,8 @@ csma.SetChannelAttribute ("DataRate", StringValue ("5Mbps")); csma.SetChannelAttribute ("Delay", StringValue ("2ms")); NetDeviceContainer d2345 = csma.Install (n2345); - - // Later, we add IP addresses. + + // Later, we add IP addresses. NS_LOG_INFO ("Assign IP Addresses."); Ipv4AddressHelper ipv4; ipv4.SetBase ("10.1.1.0", "255.255.255.0"); diff -r b55a5876af9a -r 6e3e0df6f63d examples/routing/simple-alternate-routing.cc --- a/examples/routing/simple-alternate-routing.cc Fri May 13 12:37:28 2011 -0700 +++ b/examples/routing/simple-alternate-routing.cc Fri May 13 12:38:43 2011 -0700 @@ -109,17 +109,17 @@ InternetStackHelper internet; internet.Install (c); - + // Later, we add IP addresses. The middle two octets correspond to - // the channel number. + // the channel number. NS_LOG_INFO ("Assign IP Addresses."); Ipv4AddressHelper ipv4; ipv4.SetBase ("10.0.0.0", "255.255.255.0"); ipv4.Assign (d0d2); - + ipv4.SetBase ("10.1.1.0", "255.255.255.0"); Ipv4InterfaceContainer i1i2 = ipv4.Assign (d1d2); - + ipv4.SetBase ("10.2.2.0", "255.255.255.0"); ipv4.Assign (d3d2); @@ -139,7 +139,7 @@ // Create a flow from n3 to n1, starting at time 1.1 seconds OnOffHelper onoff ("ns3::UdpSocketFactory", - Address (InetSocketAddress (i1i2.GetAddress (0), port))); + Address (InetSocketAddress (i1i2.GetAddress (0), port))); onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1))); onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0))); @@ -149,7 +149,7 @@ // Create a packet sink to receive these packets PacketSinkHelper sink ("ns3::UdpSocketFactory", - Address (InetSocketAddress (Ipv4Address::GetAny (), port))); + Address (InetSocketAddress (Ipv4Address::GetAny (), port))); apps = sink.Install (c.Get (1)); apps.Start (Seconds (1.1)); apps.Stop (Seconds (10.0)); diff -r b55a5876af9a -r 6e3e0df6f63d examples/routing/simple-global-routing.cc --- a/examples/routing/simple-global-routing.cc Fri May 13 12:37:28 2011 -0700 +++ b/examples/routing/simple-global-routing.cc Fri May 13 12:38:43 2011 -0700 @@ -64,7 +64,7 @@ Config::SetDefault ("ns3::OnOffApplication::PacketSize", UintegerValue (210)); Config::SetDefault ("ns3::OnOffApplication::DataRate", StringValue ("448kb/s")); - //DefaultValue::Bind ("DropTailQueue::m_maxPackets", 30); + //DefaultValue::Bind ("DropTailQueue::m_maxPackets", 30); // Allow the user to override any of the defaults and the above // DefaultValue::Bind ()s at run-time, via command-line arguments @@ -93,12 +93,12 @@ NetDeviceContainer d0d2 = p2p.Install (n0n2); NetDeviceContainer d1d2 = p2p.Install (n1n2); - + p2p.SetDeviceAttribute ("DataRate", StringValue ("1500kbps")); p2p.SetChannelAttribute ("Delay", StringValue ("10ms")); NetDeviceContainer d3d2 = p2p.Install (n3n2); - - // Later, we add IP addresses. + + // Later, we add IP addresses. NS_LOG_INFO ("Assign IP Addresses."); Ipv4AddressHelper ipv4; ipv4.SetBase ("10.1.1.0", "255.255.255.0"); @@ -106,7 +106,7 @@ ipv4.SetBase ("10.1.2.0", "255.255.255.0"); Ipv4InterfaceContainer i1i2 = ipv4.Assign (d1d2); - + ipv4.SetBase ("10.1.3.0", "255.255.255.0"); Ipv4InterfaceContainer i3i2 = ipv4.Assign (d3d2); @@ -119,7 +119,7 @@ NS_LOG_INFO ("Create Applications."); uint16_t port = 9; // Discard port (RFC 863) OnOffHelper onoff ("ns3::UdpSocketFactory", - Address (InetSocketAddress (i3i2.GetAddress (0), port))); + Address (InetSocketAddress (i3i2.GetAddress (0), port))); onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1))); onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0))); ApplicationContainer apps = onoff.Install (c.Get (0)); @@ -128,14 +128,14 @@ // Create a packet sink to receive these packets PacketSinkHelper sink ("ns3::UdpSocketFactory", - Address (InetSocketAddress (Ipv4Address::GetAny (), port))); + Address (InetSocketAddress (Ipv4Address::GetAny (), port))); apps = sink.Install (c.Get (3)); apps.Start (Seconds (1.0)); apps.Stop (Seconds (10.0)); // Create a similar flow from n3 to n1, starting at time 1.1 seconds onoff.SetAttribute ("Remote", - AddressValue (InetSocketAddress (i1i2.GetAddress (0), port))); + AddressValue (InetSocketAddress (i1i2.GetAddress (0), port))); apps = onoff.Install (c.Get (3)); apps.Start (Seconds (1.1)); apps.Stop (Seconds (10.0)); @@ -155,7 +155,7 @@ { FlowMonitorHelper flowmonHelper; flowmon = flowmonHelper.InstallAll (); - } + } NS_LOG_INFO ("Run Simulation."); Simulator::Stop (Seconds (11)); diff -r b55a5876af9a -r 6e3e0df6f63d examples/routing/simple-routing-ping6.cc --- a/examples/routing/simple-routing-ping6.cc Fri May 13 12:37:28 2011 -0700 +++ b/examples/routing/simple-routing-ping6.cc Fri May 13 12:38:43 2011 -0700 @@ -83,10 +83,10 @@ { route = routing->GetRoute (i); std::cout << route.GetDest () << "\t" - << route.GetGateway () << "\t" - << route.GetInterface () << "\t" - << route.GetPrefixToUse () << "\t" - << std::endl; + << route.GetGateway () << "\t" + << route.GetInterface () << "\t" + << route.GetPrefixToUse () << "\t" + << std::endl; } } }; diff -r b55a5876af9a -r 6e3e0df6f63d examples/routing/static-routing-slash32.cc --- a/examples/routing/static-routing-slash32.cc Fri May 13 12:37:28 2011 -0700 +++ b/examples/routing/static-routing-slash32.cc Fri May 13 12:38:43 2011 -0700 @@ -65,7 +65,7 @@ NetDeviceContainer dAdB = p2p.Install (nAnB); NetDeviceContainer dBdC = p2p.Install (nBnC);; - + Ptr deviceA = CreateObject (); deviceA->SetAddress (Mac48Address::Allocate ()); nA->AddDevice (deviceA); @@ -74,7 +74,7 @@ deviceC->SetAddress (Mac48Address::Allocate ()); nC->AddDevice (deviceC); - // Later, we add IP addresses. + // Later, we add IP addresses. Ipv4AddressHelper ipv4; ipv4.SetBase ("10.1.1.0", "255.255.255.252"); Ipv4InterfaceContainer iAiB = ipv4.Assign (dAdB); @@ -85,10 +85,10 @@ Ptr ipv4A = nA->GetObject (); Ptr ipv4B = nB->GetObject (); Ptr ipv4C = nC->GetObject (); - + int32_t ifIndexA = ipv4A->AddInterface (deviceA); int32_t ifIndexC = ipv4C->AddInterface (deviceC); - + Ipv4InterfaceAddress ifInAddrA = Ipv4InterfaceAddress (Ipv4Address ("172.16.1.1"), Ipv4Mask ("/32")); ipv4A->AddAddress (ifIndexA, ifInAddrA); ipv4A->SetMetric (ifIndexA, 1); @@ -111,7 +111,7 @@ // 210 bytes at a rate of 448 Kb/s uint16_t port = 9; // Discard port (RFC 863) OnOffHelper onoff ("ns3::UdpSocketFactory", - Address (InetSocketAddress (ifInAddrC.GetLocal (), port))); + Address (InetSocketAddress (ifInAddrC.GetLocal (), port))); onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1))); onoff.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0))); onoff.SetAttribute ("DataRate", DataRateValue (DataRate (6000))); @@ -121,7 +121,7 @@ // Create a packet sink to receive these packets PacketSinkHelper sink ("ns3::UdpSocketFactory", - Address (InetSocketAddress (Ipv4Address::GetAny (), port))); + Address (InetSocketAddress (Ipv4Address::GetAny (), port))); apps = sink.Install (nC); apps.Start (Seconds (1.0)); apps.Stop (Seconds (10.0)); diff -r b55a5876af9a -r 6e3e0df6f63d examples/socket/socket-bound-static-routing.cc --- a/examples/socket/socket-bound-static-routing.cc Fri May 13 12:37:28 2011 -0700 +++ b/examples/socket/socket-bound-static-routing.cc Fri May 13 12:38:43 2011 -0700 @@ -22,7 +22,7 @@ | 10.20.1.0/24 DSTRTR 10.10.1.0/24 / \ 10.10.2.0/24 - / \ + / \ Rtr1 Rtr2 10.1.1.0/24 | | 10.1.2.0/24 | / @@ -65,7 +65,7 @@ Ptr nRtr1 = CreateObject (); Ptr nRtr2 = CreateObject (); Ptr nDstRtr = CreateObject (); - + NodeContainer c = NodeContainer (nSrc, nDst, nRtr1, nRtr2, nDstRtr); InternetStackHelper internet; @@ -77,7 +77,7 @@ NodeContainer nRtr1nDstRtr = NodeContainer (nRtr1, nDstRtr); NodeContainer nRtr2nDstRtr = NodeContainer (nRtr2, nDstRtr); NodeContainer nDstRtrnDst = NodeContainer (nDstRtr, nDst); - + // We create the channels first without any IP addressing information PointToPointHelper p2p; p2p.SetDeviceAttribute ("DataRate", StringValue ("5Mbps")); @@ -87,11 +87,11 @@ NetDeviceContainer dRtr1dDstRtr = p2p.Install (nRtr1nDstRtr); NetDeviceContainer dRtr2dDstRtr = p2p.Install (nRtr2nDstRtr); NetDeviceContainer dDstRtrdDst = p2p.Install (nDstRtrnDst); - + Ptr SrcToRtr1=dSrcdRtr1.Get (0); Ptr SrcToRtr2=dSrcdRtr2.Get (0); - - // Later, we add IP addresses. + + // Later, we add IP addresses. Ipv4AddressHelper ipv4; ipv4.SetBase ("10.1.1.0", "255.255.255.0"); Ipv4InterfaceContainer iSrciRtr1 = ipv4.Assign (dSrcdRtr1); @@ -109,7 +109,7 @@ Ptr ipv4Rtr2 = nRtr2->GetObject (); Ptr ipv4DstRtr = nDstRtr->GetObject (); Ptr ipv4Dst = nDst->GetObject (); - + Ipv4StaticRoutingHelper ipv4RoutingHelper; Ptr staticRoutingSrc = ipv4RoutingHelper.GetStaticRouting (ipv4Src); Ptr staticRoutingRtr1 = ipv4RoutingHelper.GetStaticRouting (ipv4Rtr1); @@ -120,33 +120,33 @@ // Create static routes from Src to Dst staticRoutingRtr1->AddHostRouteTo (Ipv4Address ("10.20.1.2"), Ipv4Address ("10.10.1.2"), 2); staticRoutingRtr2->AddHostRouteTo (Ipv4Address ("10.20.1.2"), Ipv4Address ("10.10.2.2"), 2); - + // Two routes to same destination - setting separate metrics. // You can switch these to see how traffic gets diverted via different routes staticRoutingSrc->AddHostRouteTo (Ipv4Address ("10.20.1.2"), Ipv4Address ("10.1.1.2"), 1,5); staticRoutingSrc->AddHostRouteTo (Ipv4Address ("10.20.1.2"), Ipv4Address ("10.1.2.2"), 2,10); - + // Creating static routes from DST to Source pointing to Rtr1 VIA Rtr2(!) staticRoutingDst->AddHostRouteTo (Ipv4Address ("10.1.1.1"), Ipv4Address ("10.20.1.1"), 1); staticRoutingDstRtr->AddHostRouteTo (Ipv4Address ("10.1.1.1"), Ipv4Address ("10.10.2.1"), 2); staticRoutingRtr2->AddHostRouteTo (Ipv4Address ("10.1.1.1"), Ipv4Address ("10.1.2.1"), 1); - + Ipv4InterfaceAddress ifInAddrSrc=ipv4Src->GetAddress (1,0); - + // There are no apps that can utilize the Socket Option so doing the work directly.. // Taken from tcp-large-transfer example Ptr srcSocket = Socket::CreateSocket (nSrc, TypeId::LookupByName ("ns3::UdpSocketFactory")); srcSocket->Bind (); srcSocket->SetRecvCallback (MakeCallback (&srcSocketRecv)); - + Ptr dstSocket = Socket::CreateSocket (nDst, TypeId::LookupByName ("ns3::UdpSocketFactory")); uint16_t dstport = 12345; Ipv4Address dstaddr ("10.20.1.2"); InetSocketAddress dst = InetSocketAddress (dstaddr, dstport); dstSocket->Bind (dst); dstSocket->SetRecvCallback (MakeCallback (&dstSocketRecv)); - + AsciiTraceHelper ascii; p2p.EnableAsciiAll (ascii.CreateFileStream ("socket-bound-static-routing.tr")); p2p.EnablePcapAll ("socket-bound-static-routing"); @@ -201,7 +201,7 @@ { NS_LOG_INFO ("Socket was bound"); } - else + else { NS_LOG_INFO ("Socket was not bound"); } diff -r b55a5876af9a -r 6e3e0df6f63d examples/socket/socket-bound-tcp-static-routing.cc --- a/examples/socket/socket-bound-tcp-static-routing.cc Fri May 13 12:37:28 2011 -0700 +++ b/examples/socket/socket-bound-tcp-static-routing.cc Fri May 13 12:38:43 2011 -0700 @@ -22,7 +22,7 @@ | 10.20.1.0/24 DSTRTR 10.10.1.0/24 / \ 10.10.2.0/24 - / \ + / \ Rtr1 Rtr2 10.1.1.0/24 | | 10.1.2.0/24 | / @@ -75,7 +75,7 @@ Ptr nRtr1 = CreateObject (); Ptr nRtr2 = CreateObject (); Ptr nDstRtr = CreateObject (); - + NodeContainer c = NodeContainer (nSrc, nDst, nRtr1, nRtr2, nDstRtr); InternetStackHelper internet; @@ -87,7 +87,7 @@ NodeContainer nRtr1nDstRtr = NodeContainer (nRtr1, nDstRtr); NodeContainer nRtr2nDstRtr = NodeContainer (nRtr2, nDstRtr); NodeContainer nDstRtrnDst = NodeContainer (nDstRtr, nDst); - + // We create the channels first without any IP addressing information PointToPointHelper p2p; p2p.SetDeviceAttribute ("DataRate", StringValue ("5Mbps")); @@ -97,11 +97,11 @@ NetDeviceContainer dRtr1dDstRtr = p2p.Install (nRtr1nDstRtr); NetDeviceContainer dRtr2dDstRtr = p2p.Install (nRtr2nDstRtr); NetDeviceContainer dDstRtrdDst = p2p.Install (nDstRtrnDst); - + Ptr SrcToRtr1=dSrcdRtr1.Get (0); Ptr SrcToRtr2=dSrcdRtr2.Get (0); - - // Later, we add IP addresses. + + // Later, we add IP addresses. Ipv4AddressHelper ipv4; ipv4.SetBase ("10.1.1.0", "255.255.255.0"); Ipv4InterfaceContainer iSrciRtr1 = ipv4.Assign (dSrcdRtr1); @@ -119,7 +119,7 @@ Ptr ipv4Rtr2 = nRtr2->GetObject (); Ptr ipv4DstRtr = nDstRtr->GetObject (); Ptr ipv4Dst = nDst->GetObject (); - + Ipv4StaticRoutingHelper ipv4RoutingHelper; Ptr staticRoutingSrc = ipv4RoutingHelper.GetStaticRouting (ipv4Src); Ptr staticRoutingRtr1 = ipv4RoutingHelper.GetStaticRouting (ipv4Rtr1); @@ -130,23 +130,23 @@ // Create static routes from Src to Dst staticRoutingRtr1->AddHostRouteTo (Ipv4Address ("10.20.1.2"), Ipv4Address ("10.10.1.2"), 2); staticRoutingRtr2->AddHostRouteTo (Ipv4Address ("10.20.1.2"), Ipv4Address ("10.10.2.2"), 2); - + // Two routes to same destination - setting separate metrics. // You can switch these to see how traffic gets diverted via different routes staticRoutingSrc->AddHostRouteTo (Ipv4Address ("10.20.1.2"), Ipv4Address ("10.1.1.2"), 1,5); staticRoutingSrc->AddHostRouteTo (Ipv4Address ("10.20.1.2"), Ipv4Address ("10.1.2.2"), 2,10); - + // Creating static routes from DST to Source pointing to Rtr1 VIA Rtr2(!) staticRoutingDst->AddHostRouteTo (Ipv4Address ("10.1.1.1"), Ipv4Address ("10.20.1.1"), 1); staticRoutingDstRtr->AddHostRouteTo (Ipv4Address ("10.1.1.1"), Ipv4Address ("10.10.2.1"), 2); staticRoutingRtr2->AddHostRouteTo (Ipv4Address ("10.1.1.1"), Ipv4Address ("10.1.2.1"), 1); - + staticRoutingDst->AddHostRouteTo (Ipv4Address ("10.1.2.1"), Ipv4Address ("10.20.1.1"), 1); staticRoutingDstRtr->AddHostRouteTo (Ipv4Address ("10.1.2.1"), Ipv4Address ("10.10.2.1"), 2); staticRoutingRtr2->AddHostRouteTo (Ipv4Address ("10.1.2.1"), Ipv4Address ("10.1.2.1"), 1); Ipv4InterfaceAddress ifInAddrSrc=ipv4Src->GetAddress (1,0); - + // There are no apps that can utilize the Socket Option so doing the work directly.. // Taken from tcp-large-transfer example @@ -155,15 +155,15 @@ Ptr srcSocket3 = Socket::CreateSocket (nSrc, TypeId::LookupByName ("ns3::TcpSocketFactory")); Ptr srcSocket4 = Socket::CreateSocket (nSrc, TypeId::LookupByName ("ns3::TcpSocketFactory")); - + uint16_t dstport = 12345; Ipv4Address dstaddr ("10.20.1.2"); - + PacketSinkHelper sink ("ns3::TcpSocketFactory", InetSocketAddress (Ipv4Address::GetAny(), dstport)); ApplicationContainer apps = sink.Install (nDst); apps.Start (Seconds (0.0)); apps.Stop (Seconds (10.0)); - + AsciiTraceHelper ascii; p2p.EnableAsciiAll (ascii.CreateFileStream ("socket-bound-tcp-static-routing.tr")); p2p.EnablePcapAll ("socket-bound-tcp-static-routing"); @@ -204,7 +204,7 @@ NS_LOG_INFO ("Starting flow at time " << Simulator::Now ().GetSeconds ()); currentTxBytes = 0; localSocket->Bind (); - localSocket->Connect (InetSocketAddress (servAddress, servPort));//connect + localSocket->Connect (InetSocketAddress (servAddress, servPort)); //connect // tell the tcp implementation to call WriteUntilBufferFull again // if we blocked and new tx buffer space becomes available diff -r b55a5876af9a -r 6e3e0df6f63d examples/stats/wifi-example-apps.cc --- a/examples/stats/wifi-example-apps.cc Fri May 13 12:37:28 2011 -0700 +++ b/examples/stats/wifi-example-apps.cc Fri May 13 12:38:43 2011 -0700 @@ -67,7 +67,7 @@ MakeRandomVariableChecker()) .AddTraceSource ("Tx", "A new packet is created and is sent", MakeTraceSourceAccessor (&Sender::m_txTrace)) - ; + ; return tid; } @@ -99,10 +99,10 @@ if (m_socket == 0) { Ptr socketFactory = GetNode()->GetObject - (UdpSocketFactory::GetTypeId()); + (UdpSocketFactory::GetTypeId()); m_socket = socketFactory->CreateSocket (); m_socket->Bind (); - } + } m_count = 0; @@ -118,7 +118,7 @@ Simulator::Cancel(m_sendEvent); // end Sender::StopApplication } - + void Sender::SendPacket() { // NS_LOG_FUNCTION_NOARGS (); @@ -139,9 +139,9 @@ m_txTrace(packet); if (++m_count < m_numPkts) { - m_sendEvent = Simulator::Schedule(Seconds(m_interval.GetValue()), - &Sender::SendPacket, this); - } + m_sendEvent = Simulator::Schedule(Seconds(m_interval.GetValue()), + &Sender::SendPacket, this); + } // end Sender::SendPacket } @@ -162,7 +162,7 @@ UintegerValue(1603), MakeUintegerAccessor(&Receiver::m_port), MakeUintegerChecker()) - ; + ; return tid; } @@ -196,12 +196,12 @@ if (m_socket == 0) { Ptr socketFactory = GetNode()->GetObject - (UdpSocketFactory::GetTypeId()); + (UdpSocketFactory::GetTypeId()); m_socket = socketFactory->CreateSocket(); InetSocketAddress local = InetSocketAddress(Ipv4Address::GetAny(), m_port); m_socket->Bind(local); - } + } m_socket->SetRecvCallback(MakeCallback(&Receiver::Receive, this)); @@ -215,7 +215,7 @@ if (m_socket != 0) { m_socket->SetRecvCallback(MakeNullCallback > ()); - } + } // end Receiver::StopApplication } @@ -241,30 +241,30 @@ Ptr packet; Address from; while (packet = socket->RecvFrom(from)) { - if (InetSocketAddress::IsMatchingType (from)) { - InetSocketAddress address = InetSocketAddress::ConvertFrom (from); - NS_LOG_INFO ("Received " << packet->GetSize() << " bytes from " << - address.GetIpv4()); - } + if (InetSocketAddress::IsMatchingType (from)) { + InetSocketAddress address = InetSocketAddress::ConvertFrom (from); + NS_LOG_INFO ("Received " << packet->GetSize() << " bytes from " << + address.GetIpv4()); + } - TimestampTag timestamp; - // Should never not be found since the sender is adding it, but - // you never know. - if (packet->FindFirstMatchingByteTag(timestamp)) { - Time tx = timestamp.GetTimestamp(); + TimestampTag timestamp; + // Should never not be found since the sender is adding it, but + // you never know. + if (packet->FindFirstMatchingByteTag(timestamp)) { + Time tx = timestamp.GetTimestamp(); - if (m_delay != 0) { - m_delay->Update(Simulator::Now() - tx); - } - } + if (m_delay != 0) { + m_delay->Update(Simulator::Now() - tx); + } + } - if (m_calc != 0) { - m_calc->Update(); + if (m_calc != 0) { + m_calc->Update(); + } + + // end receiving packets } - // end receiving packets - } - // end Receiver::Receive } @@ -285,7 +285,7 @@ EmptyAttributeValue(), MakeTimeAccessor(&TimestampTag::GetTimestamp), MakeTimeChecker()) - ; + ; return tid; } TypeId diff -r b55a5876af9a -r 6e3e0df6f63d examples/stats/wifi-example-apps.h --- a/examples/stats/wifi-example-apps.h Fri May 13 12:37:28 2011 -0700 +++ b/examples/stats/wifi-example-apps.h Fri May 13 12:38:43 2011 -0700 @@ -37,7 +37,7 @@ //---------------------------------------------------------------------- //------------------------------------------------------ -class Sender: public Application { +class Sender : public Application { public: static TypeId GetTypeId(void); Sender(); @@ -72,7 +72,7 @@ //------------------------------------------------------ -class Receiver: public Application { +class Receiver : public Application { public: static TypeId GetTypeId(void); Receiver(); @@ -112,7 +112,7 @@ virtual uint32_t GetSerializedSize (void) const; virtual void Serialize (TagBuffer i) const; virtual void Deserialize (TagBuffer i); - + // these are our accessors to our tag structure void SetTimestamp(Time time); Time GetTimestamp(void) const; diff -r b55a5876af9a -r 6e3e0df6f63d examples/stats/wifi-example-sim.cc --- a/examples/stats/wifi-example-sim.cc Fri May 13 12:37:28 2011 -0700 +++ b/examples/stats/wifi-example-sim.cc Fri May 13 12:38:43 2011 -0700 @@ -99,21 +99,21 @@ cmd.Parse (argc, argv); if (format != "omnet" && format != "db") { - NS_LOG_ERROR("Unknown output format '" << format << "'"); - return -1; - } + NS_LOG_ERROR("Unknown output format '" << format << "'"); + return -1; + } #ifndef STATS_HAS_SQLITE3 if (format == "db") { NS_LOG_ERROR("sqlite support not compiled in."); return -1; - } + } #endif { - stringstream sstr(""); - sstr << distance; - input = sstr.str(); + stringstream sstr(""); + sstr << distance; + input = sstr.str(); } @@ -163,12 +163,12 @@ //-- Create a custom traffic source and sink //-------------------------------------------- NS_LOG_INFO ("Create traffic source & sink."); - Ptr appSource = NodeList::GetNode(0); + Ptr appSource = NodeList::GetNode(0); Ptr sender = CreateObject(); appSource->AddApplication(sender); sender->SetStartTime(Seconds(1)); - Ptr appSink = NodeList::GetNode(1); + Ptr appSink = NodeList::GetNode(1); Ptr receiver = CreateObject(); appSink->AddApplication(receiver); receiver->SetStartTime(Seconds(0)); @@ -231,7 +231,7 @@ appTx->SetContext("node[0]"); Config::Connect("/NodeList/0/ApplicationList/*/$Sender/Tx", MakeCallback(&PacketCounterCalculator::PacketUpdate, - appTx)); + appTx)); data.AddDataCalculator(appTx); // Here a counter for received packets is directly manipulated by @@ -271,8 +271,8 @@ appTxPkts->SetContext("node[0]"); Config::Connect("/NodeList/0/ApplicationList/*/$Sender/Tx", MakeCallback - (&PacketSizeMinMaxAvgTotalCalculator::PacketUpdate, - appTxPkts)); + (&PacketSizeMinMaxAvgTotalCalculator::PacketUpdate, + appTxPkts)); data.AddDataCalculator(appTxPkts); @@ -294,7 +294,7 @@ //-- Run the simulation //-------------------------------------------- NS_LOG_INFO("Run Simulation."); - Simulator::Run(); + Simulator::Run(); Simulator::Destroy(); @@ -307,16 +307,16 @@ // Pick an output writer based in the requested format. Ptr output = 0; if (format == "omnet") { - NS_LOG_INFO("Creating omnet formatted data output."); - output = CreateObject(); - } else if (format == "db") { + NS_LOG_INFO("Creating omnet formatted data output."); + output = CreateObject(); + } else if (format == "db") { #ifdef STATS_HAS_SQLITE3 NS_LOG_INFO("Creating sqlite formatted data output."); output = CreateObject(); #endif - } else { - NS_LOG_ERROR("Unknown output format " << format); - } + } else { + NS_LOG_ERROR("Unknown output format " << format); + } // Finally, have that writer interrogate the DataCollector and save // the results. diff -r b55a5876af9a -r 6e3e0df6f63d examples/tcp/star.cc --- a/examples/tcp/star.cc Fri May 13 12:37:28 2011 -0700 +++ b/examples/tcp/star.cc Fri May 13 12:38:43 2011 -0700 @@ -75,7 +75,7 @@ NS_LOG_INFO ("Create applications."); // - // Create a packet sink on the star "hub" to receive packets. + // Create a packet sink on the star "hub" to receive packets. // uint16_t port = 50000; Address hubLocalAddress (InetSocketAddress (Ipv4Address::GetAny (), port)); @@ -98,7 +98,7 @@ AddressValue remoteAddress (InetSocketAddress (star.GetHubIpv4Address (i), port)); onOffHelper.SetAttribute ("Remote", remoteAddress); spokeApps.Add (onOffHelper.Install (star.GetSpokeNode (i))); - } + } spokeApps.Start (Seconds (1.0)); spokeApps.Stop (Seconds (10.0)); diff -r b55a5876af9a -r 6e3e0df6f63d examples/tcp/tcp-large-transfer.cc --- a/examples/tcp/tcp-large-transfer.cc Fri May 13 12:37:28 2011 -0700 +++ b/examples/tcp/tcp-large-transfer.cc Fri May 13 12:38:43 2011 -0700 @@ -152,7 +152,7 @@ // Create and bind the socket... Ptr localSocket = - Socket::CreateSocket (n0n1.Get (0), TcpSocketFactory::GetTypeId ()); + Socket::CreateSocket (n0n1.Get (0), TcpSocketFactory::GetTypeId ()); localSocket->Bind (); // Trace changes to the congestion window @@ -191,7 +191,7 @@ uint16_t servPort) { NS_LOG_LOGIC("Starting flow at time " << Simulator::Now ().GetSeconds ()); - localSocket->Connect (InetSocketAddress (servAddress, servPort));//connect + localSocket->Connect (InetSocketAddress (servAddress, servPort)); //connect // tell the tcp implementation to call WriteUntilBufferFull again // if we blocked and new tx buffer space becomes available diff -r b55a5876af9a -r 6e3e0df6f63d examples/tcp/tcp-nsc-lfn.cc --- a/examples/tcp/tcp-nsc-lfn.cc Fri May 13 12:37:28 2011 -0700 +++ b/examples/tcp/tcp-nsc-lfn.cc Fri May 13 12:38:43 2011 -0700 @@ -103,9 +103,9 @@ DoubleValue rate(errRate); RandomVariableValue u01(UniformVariable (0.0, 1.0)); Ptr em1 = - CreateObjectWithAttributes ("RanVar", u01, "ErrorRate", rate); + CreateObjectWithAttributes ("RanVar", u01, "ErrorRate", rate); Ptr em2 = - CreateObjectWithAttributes ("RanVar", u01, "ErrorRate", rate); + CreateObjectWithAttributes ("RanVar", u01, "ErrorRate", rate); // This enables the specified errRate on both link endpoints. p2pInterfaces.Get(0)->SetAttribute("ReceiveErrorModel", PointerValue (em1)); @@ -122,7 +122,7 @@ // This sets up two TCP flows, one from A -> B, one from B -> A. for (int i = 0, j = 1; i < 2; j--, i++) - { + { Address remoteAddress(InetSocketAddress(ipv4Interfaces.GetAddress (i), servPort)); OnOffHelper clientHelper ("ns3::TcpSocketFactory", remoteAddress); clientHelper.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1))); diff -r b55a5876af9a -r 6e3e0df6f63d examples/tcp/tcp-nsc-zoo.cc --- a/examples/tcp/tcp-nsc-zoo.cc Fri May 13 12:37:28 2011 -0700 +++ b/examples/tcp/tcp-nsc-zoo.cc Fri May 13 12:38:43 2011 -0700 @@ -57,8 +57,8 @@ if (MaxNodes < 2) { - std::cerr << "--nodes: must be >= 2" << std::endl; - return 1; + std::cerr << "--nodes: must be >= 2" << std::endl; + return 1; } csma.SetChannelAttribute ("DataRate", DataRateValue (DataRate(100 * 1000 * 1000))); csma.SetChannelAttribute ("Delay", TimeValue (MicroSeconds (200))); @@ -115,24 +115,24 @@ sinkApp.Stop (Seconds (30.0)); // This tells every node on the network to start a flow to all other nodes on the network ... - for (unsigned int i = 0 ; i < MaxNodes;i++) + for (unsigned int i = 0 ; i < MaxNodes; i++) { - for (unsigned int j = 0 ; j < MaxNodes;j++) + for (unsigned int j = 0 ; j < MaxNodes; j++) { if (i == j) { // ...but we don't want a node to talk to itself. - continue; + continue; } Address remoteAddress(InetSocketAddress(ipv4Interfaces.GetAddress (j), servPort)); OnOffHelper clientHelper ("ns3::TcpSocketFactory", remoteAddress); clientHelper.SetAttribute - ("OnTime", RandomVariableValue (ConstantVariable (1))); + ("OnTime", RandomVariableValue (ConstantVariable (1))); clientHelper.SetAttribute - ("OffTime", RandomVariableValue (ConstantVariable (0))); + ("OffTime", RandomVariableValue (ConstantVariable (0))); ApplicationContainer clientApp = clientHelper.Install(n.Get(i)); clientApp.Start (Seconds (j)); /* delay startup depending on node number */ clientApp.Stop (Seconds (j + runtime)); - } + } } csma.EnablePcapAll ("tcp-nsc-zoo", false); diff -r b55a5876af9a -r 6e3e0df6f63d examples/tcp/tcp-star-server.cc --- a/examples/tcp/tcp-star-server.cc Fri May 13 12:37:28 2011 -0700 +++ b/examples/tcp/tcp-star-server.cc Fri May 13 12:38:43 2011 -0700 @@ -22,7 +22,7 @@ \ | / \|/ n1---n0---n5 - /|\ + /| \ / | \ n8 n7 n6 */ @@ -96,9 +96,9 @@ //Collect an adjacency list of nodes for the p2p topology std::vector nodeAdjacencyList(N-1); for(uint32_t i=0; i deviceAdjacencyList(N-1); for(uint32_t i=0; i interfaceAdjacencyList(N-1); for(uint32_t i=0; i socket, Address address, uint32_t packetSize, uint32_t nPackets, DataRate dataRate); private: - virtual void StartApplication (void); + virtual void StartApplication (void); virtual void StopApplication (void); void ScheduleTx (void); @@ -186,8 +186,8 @@ devices = pointToPoint.Install (nodes); Ptr em = CreateObjectWithAttributes ( - "RanVar", RandomVariableValue (UniformVariable (0., 1.)), - "ErrorRate", DoubleValue (0.00001)); + "RanVar", RandomVariableValue (UniformVariable (0., 1.)), + "ErrorRate", DoubleValue (0.00001)); devices.Get (1)->SetAttribute ("ReceiveErrorModel", PointerValue (em)); InternetStackHelper stack; diff -r b55a5876af9a -r 6e3e0df6f63d examples/tutorial/first.cc --- a/examples/tutorial/first.cc Fri May 13 12:37:28 2011 -0700 +++ b/examples/tutorial/first.cc Fri May 13 12:38:43 2011 -0700 @@ -24,7 +24,7 @@ NS_LOG_COMPONENT_DEFINE ("FirstScriptExample"); - int +int main (int argc, char *argv[]) { LogComponentEnable("UdpEchoClientApplication", LOG_LEVEL_INFO); diff -r b55a5876af9a -r 6e3e0df6f63d examples/tutorial/fourth.cc --- a/examples/tutorial/fourth.cc Fri May 13 12:37:28 2011 -0700 +++ b/examples/tutorial/fourth.cc Fri May 13 12:38:43 2011 -0700 @@ -20,7 +20,7 @@ #include "ns3/trace-source-accessor.h" #include - + using namespace ns3; class MyObject : public Object @@ -34,10 +34,10 @@ .AddTraceSource ("MyInteger", "An integer value to trace.", MakeTraceSourceAccessor (&MyObject::m_myInt)) - ; + ; return tid; } - + MyObject () {} TracedValue m_myInt; }; diff -r b55a5876af9a -r 6e3e0df6f63d examples/tutorial/hello-simulator.cc --- a/examples/tutorial/hello-simulator.cc Fri May 13 12:37:28 2011 -0700 +++ b/examples/tutorial/hello-simulator.cc Fri May 13 12:38:43 2011 -0700 @@ -20,7 +20,7 @@ using namespace ns3; - int +int main (int argc, char *argv[]) { NS_LOG_UNCOND ("Hello Simulator"); diff -r b55a5876af9a -r 6e3e0df6f63d examples/tutorial/sixth.cc --- a/examples/tutorial/sixth.cc Fri May 13 12:37:28 2011 -0700 +++ b/examples/tutorial/sixth.cc Fri May 13 12:38:43 2011 -0700 @@ -69,7 +69,7 @@ void Setup (Ptr socket, Address address, uint32_t packetSize, uint32_t nPackets, DataRate dataRate); private: - virtual void StartApplication (void); + virtual void StartApplication (void); virtual void StopApplication (void); void ScheduleTx (void); @@ -188,8 +188,8 @@ devices = pointToPoint.Install (nodes); Ptr em = CreateObjectWithAttributes ( - "RanVar", RandomVariableValue (UniformVariable (0., 1.)), - "ErrorRate", DoubleValue (0.00001)); + "RanVar", RandomVariableValue (UniformVariable (0., 1.)), + "ErrorRate", DoubleValue (0.00001)); devices.Get (1)->SetAttribute ("ReceiveErrorModel", PointerValue (em)); InternetStackHelper stack; diff -r b55a5876af9a -r 6e3e0df6f63d examples/udp/udp-echo.cc --- a/examples/udp/udp-echo.cc Fri May 13 12:37:28 2011 -0700 +++ b/examples/udp/udp-echo.cc Fri May 13 12:38:43 2011 -0700 @@ -115,7 +115,7 @@ client.SetFill(apps.Get (0), 0xa5, 1024); - uint8_t fill[] = {0, 1, 2, 3, 4, 5, 6}; + uint8_t fill[] = { 0, 1, 2, 3, 4, 5, 6}; client.SetFill(apps.Get (0), fill, sizeof(fill), 1024); #endif diff -r b55a5876af9a -r 6e3e0df6f63d examples/wireless/ofdm-validation.cc --- a/examples/wireless/ofdm-validation.cc Fri May 13 12:37:28 2011 -0700 +++ b/examples/wireless/ofdm-validation.cc Fri May 13 12:38:43 2011 -0700 @@ -84,7 +84,7 @@ set style line 6 linewidth 5\n\ set style line 7 linewidth 5\n\ set style line 8 linewidth 5\n\ -set style increment user"); +set style increment user" ); yansplot.GenerateOutput (yansfile); yansfile.close (); @@ -100,7 +100,7 @@ set style line 6 linewidth 5\n\ set style line 7 linewidth 5\n\ set style line 8 linewidth 5\n\ -set style increment user"); +set style increment user" ); nistplot.GenerateOutput (nistfile); nistfile.close (); diff -r b55a5876af9a -r 6e3e0df6f63d examples/wireless/wifi-adhoc.cc --- a/examples/wireless/wifi-adhoc.cc Fri May 13 12:37:28 2011 -0700 +++ b/examples/wireless/wifi-adhoc.cc Fri May 13 12:38:43 2011 -0700 @@ -50,7 +50,8 @@ }; Experiment::Experiment () -{} +{ +} Experiment::Experiment (std::string name) : m_output (name) diff -r b55a5876af9a -r 6e3e0df6f63d examples/wireless/wifi-clear-channel-cmu.cc --- a/examples/wireless/wifi-clear-channel-cmu.cc Fri May 13 12:37:28 2011 -0700 +++ b/examples/wireless/wifi-clear-channel-cmu.cc Fri May 13 12:38:43 2011 -0700 @@ -47,14 +47,15 @@ Vector GetPosition (Ptr node); Ptr SetupPacketReceive (Ptr node); void GenerateTraffic (Ptr socket, uint32_t pktSize, - uint32_t pktCount, Time pktInterval ); + uint32_t pktCount, Time pktInterval ); uint32_t m_pktsTotal; Gnuplot2dDataset m_output; }; Experiment::Experiment () -{} +{ +} Experiment::Experiment (std::string name) : m_output (name) @@ -82,7 +83,7 @@ Ptr packet; while (packet = socket->Recv ()) { - m_pktsTotal ++; + m_pktsTotal++; } } @@ -179,46 +180,46 @@ cmd.Parse (argc, argv); Gnuplot gnuplot = Gnuplot ("clear-channel.eps"); - + for (uint32_t i = 0; i < modes.size(); i++) - { - std::cout << modes[i] << std::endl; - Gnuplot2dDataset dataset (modes[i]); + { + std::cout << modes[i] << std::endl; + Gnuplot2dDataset dataset (modes[i]); - for (double rss = -102.0; rss <= -80.0; rss += 0.5) - { - Experiment experiment; - dataset.SetStyle (Gnuplot2dDataset::LINES); + for (double rss = -102.0; rss <= -80.0; rss += 0.5) + { + Experiment experiment; + dataset.SetStyle (Gnuplot2dDataset::LINES); - WifiHelper wifi; - wifi.SetStandard (WIFI_PHY_STANDARD_80211b); - NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default (); - Config::SetDefault ("ns3::WifiRemoteStationManager::NonUnicastMode", - StringValue (modes[i])); - wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", - "DataMode",StringValue(modes[i]), - "ControlMode",StringValue(modes[i])); - wifiMac.SetType ("ns3::AdhocWifiMac"); + WifiHelper wifi; + wifi.SetStandard (WIFI_PHY_STANDARD_80211b); + NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default (); + Config::SetDefault ("ns3::WifiRemoteStationManager::NonUnicastMode", + StringValue (modes[i])); + wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", + "DataMode",StringValue(modes[i]), + "ControlMode",StringValue(modes[i])); + wifiMac.SetType ("ns3::AdhocWifiMac"); - YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default (); - YansWifiChannelHelper wifiChannel ; - wifiChannel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel"); - wifiChannel.AddPropagationLoss ("ns3::FixedRssLossModel","Rss",DoubleValue(rss)); + YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default (); + YansWifiChannelHelper wifiChannel ; + wifiChannel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel"); + wifiChannel.AddPropagationLoss ("ns3::FixedRssLossModel","Rss",DoubleValue(rss)); - NS_LOG_DEBUG (modes[i]); - experiment = Experiment (modes[i]); - wifiPhy.Set ("EnergyDetectionThreshold", DoubleValue (-110.0) ); - wifiPhy.Set ("CcaMode1Threshold", DoubleValue (-110.0) ); - wifiPhy.Set ("TxPowerStart", DoubleValue (15.0) ); - wifiPhy.Set ("RxGain", DoubleValue (0) ); - wifiPhy.Set ("RxNoiseFigure", DoubleValue (7) ); - uint32_t pktsRecvd = experiment.Run (wifi, wifiPhy, wifiMac, wifiChannel); - dataset.Add (rss, pktsRecvd); - } + NS_LOG_DEBUG (modes[i]); + experiment = Experiment (modes[i]); + wifiPhy.Set ("EnergyDetectionThreshold", DoubleValue (-110.0) ); + wifiPhy.Set ("CcaMode1Threshold", DoubleValue (-110.0) ); + wifiPhy.Set ("TxPowerStart", DoubleValue (15.0) ); + wifiPhy.Set ("RxGain", DoubleValue (0) ); + wifiPhy.Set ("RxNoiseFigure", DoubleValue (7) ); + uint32_t pktsRecvd = experiment.Run (wifi, wifiPhy, wifiMac, wifiChannel); + dataset.Add (rss, pktsRecvd); + } - gnuplot.AddDataset (dataset); - } + gnuplot.AddDataset (dataset); + } gnuplot.SetTerminal ("postscript eps color enh \"Times-BoldItalic\""); gnuplot.SetLegend ("RSS(dBm)", "Number of packets received"); gnuplot.SetExtra ("set xrange [-102:-83]"); diff -r b55a5876af9a -r 6e3e0df6f63d examples/wireless/wifi-hidden-terminal.cc --- a/examples/wireless/wifi-hidden-terminal.cc Fri May 13 12:37:28 2011 -0700 +++ b/examples/wireless/wifi-hidden-terminal.cc Fri May 13 12:38:43 2011 -0700 @@ -46,17 +46,17 @@ // 0. Enable or disable CTS/RTS UintegerValue ctsThr = (enableCtsRts ? UintegerValue (100) : UintegerValue (2200)); Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", ctsThr); - + // 1. Create 3 nodes NodeContainer nodes; nodes.Create (3); - + // 2. Place nodes somehow, this is required by every wireless simulation for (size_t i = 0; i < 3; ++i) { nodes.Get(i)->AggregateObject (CreateObject ()); } - + // 3. Create propagation loss matrix Ptr lossModel = CreateObject (); lossModel->SetDefaultLoss (200); // set default loss to 200 dB (no link) @@ -67,7 +67,7 @@ Ptr wifiChannel = CreateObject (); wifiChannel->SetPropagationLossModel (lossModel); wifiChannel->SetPropagationDelayModel (CreateObject ()); - + // 5. Install wireless devices WifiHelper wifi; wifi.SetStandard (WIFI_PHY_STANDARD_80211b); @@ -94,7 +94,7 @@ Ipv4AddressHelper ipv4; ipv4.SetBase ("10.0.0.0", "255.0.0.0"); ipv4.Assign (devices); - + // 7. Install applications: two CBR streams each saturating the channel ApplicationContainer cbrApps; uint16_t cbrPort = 12345; @@ -120,7 +120,7 @@ // we also use separate UDP applications that will send a single // packet before the CBR flows start. // This is a workround for the lack of perfect ARP, see Bug 187 - // http://www.nsnam.org/bugzilla/show_bug.cgi?id=187 + // http://www.nsnam.org/bugzilla/show_bug.cgi?id=187 uint16_t echoPort = 9; UdpEchoClientHelper echoClientHelper (Ipv4Address ("10.0.0.2"), echoPort); @@ -128,24 +128,24 @@ echoClientHelper.SetAttribute ("Interval", TimeValue (Seconds (0.1))); echoClientHelper.SetAttribute ("PacketSize", UintegerValue (10)); ApplicationContainer pingApps; - + // again using different start times to workaround Bug 388 and Bug 912 echoClientHelper.SetAttribute ("StartTime", TimeValue (Seconds (0.001))); pingApps.Add (echoClientHelper.Install (nodes.Get (0))); echoClientHelper.SetAttribute ("StartTime", TimeValue (Seconds (0.006))); - pingApps.Add (echoClientHelper.Install (nodes.Get (2))); + pingApps.Add (echoClientHelper.Install (nodes.Get (2))); + - // 8. Install FlowMonitor on all nodes FlowMonitorHelper flowmon; Ptr monitor = flowmon.InstallAll(); - + // 9. Run simulation for 10 seconds Simulator::Stop (Seconds (10)); Simulator::Run (); - + // 10. Print per flow statistics monitor->CheckForLostPackets (); Ptr classifier = DynamicCast (flowmon.GetClassifier ()); @@ -161,7 +161,7 @@ std::cout << " Throughput: " << i->second.rxBytes * 8.0 / 10.0 / 1024 / 1024 << " Mbps\n"; } } - + // 11. Cleanup Simulator::Destroy (); } @@ -173,6 +173,6 @@ std::cout << "------------------------------------------------\n"; std::cout << "Hidden station experiment with RTS/CTS enabled:\n"; experiment (true); - + return 0; } diff -r b55a5876af9a -r 6e3e0df6f63d examples/wireless/wifi-simple-adhoc-grid.cc --- a/examples/wireless/wifi-simple-adhoc-grid.cc Fri May 13 12:37:28 2011 -0700 +++ b/examples/wireless/wifi-simple-adhoc-grid.cc Fri May 13 12:38:43 2011 -0700 @@ -21,7 +21,7 @@ // This program configures a grid (default 5x5) of nodes on an // 802.11b physical layer, with // 802.11b NICs in adhoc mode, and by default, sends one packet of 1000 -// (application) bytes to node 1. +// (application) bytes to node 1. // // The default layout is like this, on a 2-D grid. // @@ -134,7 +134,7 @@ cmd.AddValue ("numNodes", "number of nodes", numNodes); cmd.AddValue ("sinkNode", "Receiver node number", sinkNode); cmd.AddValue ("sourceNode", "Sender node number", sourceNode); - + cmd.Parse (argc, argv); // Convert to time object Time interPacketInterval = Seconds (interval); @@ -173,19 +173,19 @@ wifi.SetStandard (WIFI_PHY_STANDARD_80211b); wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode",StringValue(phyMode), - "ControlMode",StringValue(phyMode)); + "ControlMode",StringValue(phyMode)); // Set it to adhoc mode wifiMac.SetType ("ns3::AdhocWifiMac"); NetDeviceContainer devices = wifi.Install (wifiPhy, wifiMac, c); MobilityHelper mobility; mobility.SetPositionAllocator ("ns3::GridPositionAllocator", - "MinX", DoubleValue (0.0), - "MinY", DoubleValue (0.0), - "DeltaX", DoubleValue (distance), - "DeltaY", DoubleValue (distance), - "GridWidth", UintegerValue (5), - "LayoutType", StringValue ("RowFirst")); + "MinX", DoubleValue (0.0), + "MinY", DoubleValue (0.0), + "DeltaX", DoubleValue (distance), + "DeltaY", DoubleValue (distance), + "GridWidth", UintegerValue (5), + "LayoutType", StringValue ("RowFirst")); mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel"); mobility.Install (c); @@ -227,7 +227,7 @@ // To do-- enable an IP-level trace that shows forwarding events only } - + // Give OLSR time to converge-- 30 seconds perhaps Simulator::Schedule (Seconds (30.0), &GenerateTraffic, source, packetSize, numPackets, interPacketInterval); diff -r b55a5876af9a -r 6e3e0df6f63d examples/wireless/wifi-simple-adhoc.cc --- a/examples/wireless/wifi-simple-adhoc.cc Fri May 13 12:37:28 2011 -0700 +++ b/examples/wireless/wifi-simple-adhoc.cc Fri May 13 12:38:43 2011 -0700 @@ -79,7 +79,7 @@ { socket->Send (Create (pktSize)); Simulator::Schedule (pktInterval, &GenerateTraffic, - socket, pktSize,pktCount-1, pktInterval); + socket, pktSize,pktCount-1, pktInterval); } else { @@ -105,7 +105,7 @@ cmd.AddValue ("numPackets", "number of packets generated", numPackets); cmd.AddValue ("interval", "interval (seconds) between packets", interval); cmd.AddValue ("verbose", "turn on all WifiNetDevice log components", verbose); - + cmd.Parse (argc, argv); // Convert to time object Time interPacketInterval = Seconds (interval); @@ -147,7 +147,7 @@ NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default (); wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode",StringValue(phyMode), - "ControlMode",StringValue(phyMode)); + "ControlMode",StringValue(phyMode)); // Set it to adhoc mode wifiMac.SetType ("ns3::AdhocWifiMac"); NetDeviceContainer devices = wifi.Install (wifiPhy, wifiMac, c); diff -r b55a5876af9a -r 6e3e0df6f63d examples/wireless/wifi-simple-interference.cc --- a/examples/wireless/wifi-simple-interference.cc Fri May 13 12:37:28 2011 -0700 +++ b/examples/wireless/wifi-simple-interference.cc Fri May 13 12:38:43 2011 -0700 @@ -149,7 +149,7 @@ cmd.AddValue ("PpacketSize", "size of application packet sent", PpacketSize); cmd.AddValue ("IpacketSize", "size of interfering packet sent", IpacketSize); cmd.AddValue ("verbose", "turn on all WifiNetDevice log components", verbose); - + cmd.Parse (argc, argv); // Convert to time object Time interPacketInterval = Seconds (interval); @@ -190,7 +190,7 @@ NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default (); wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode",StringValue(phyMode), - "ControlMode",StringValue(phyMode)); + "ControlMode",StringValue(phyMode)); // Set it to adhoc mode wifiMac.SetType ("ns3::AdhocWifiMac"); NetDeviceContainer devices = wifi.Install (wifiPhy, wifiMac, c.Get (0)); @@ -241,7 +241,7 @@ // Tracing wifiPhy.EnablePcap ("wifi-simple-interference", devices.Get (0)); - + // Output what we are doing NS_LOG_UNCOND ("Primary packet RSS=" << Prss << " dBm and interferer RSS=" << Irss << " dBm at time offset=" << delta << " ms");