From 0f79de44fe74a30a4ec6fb1325eb237e11a196c0 Mon Sep 17 00:00:00 2001 From: Dean Armstrong Date: Wed, 1 Dec 2010 22:13:26 +0000 Subject: [PATCH] Bug 978: Run check-style.py on files touched in the reorganisation Cosmetic changes only in this one (hence the reason I wanted them kept separate from the the previous changeset). --- examples/mpi/third-distributed.cc | 22 ++--- examples/tap/tap-wifi-dumbbell.cc | 16 ++-- examples/tutorial/third.cc | 18 ++-- examples/wireless/mixed-wireless.cc | 36 +++---- examples/wireless/multirate.cc | 93 ++++++++++--------- .../wireless/simple-wifi-frame-aggregation.cc | 36 +++---- examples/wireless/wifi-ap.cc | 4 +- examples/wireless/wifi-blockack.cc | 26 +++--- examples/wireless/wifi-simple-infra.cc | 6 +- examples/wireless/wifi-wired-bridging.cc | 28 +++--- src/devices/mesh/dot11s/airtime-metric.cc | 30 +++--- src/devices/mesh/mesh-wifi-interface-mac.cc | 62 ++++++------- src/devices/wifi/adhoc-wifi-mac.cc | 2 +- src/devices/wifi/ap-wifi-mac.cc | 2 +- src/devices/wifi/ap-wifi-mac.h | 18 ++-- src/devices/wifi/edca-txop-n.h | 16 ++-- src/devices/wifi/mac-low.h | 2 +- src/devices/wifi/regular-wifi-mac.cc | 6 +- src/devices/wifi/regular-wifi-mac.h | 14 +-- src/devices/wifi/sta-wifi-mac.cc | 80 ++++++++-------- src/devices/wifi/wifi-test.cc | 30 +++--- src/helper/nqos-wifi-mac-helper.cc | 6 +- src/helper/qos-wifi-mac-helper.cc | 10 +- src/helper/wifi-helper.cc | 9 +- src/routing/olsr/test/tc-regression-test.cc | 26 +++--- 25 files changed, 304 insertions(+), 294 deletions(-) diff --git a/examples/mpi/third-distributed.cc b/examples/mpi/third-distributed.cc index 631a82d03..6e292631c 100644 --- a/examples/mpi/third-distributed.cc +++ b/examples/mpi/third-distributed.cc @@ -32,7 +32,7 @@ // Number of wifi or csma nodes can be increased up to 250 // // Wifi 10.1.3.0 -// AP +// AP // * * * * // | | | | 10.1.1.0 // n5 n6 n7 n0 -------------- n1 n2 n3 n4 @@ -54,7 +54,7 @@ main (int argc, char *argv[]) // Distributed simulation setup MpiInterface::Enable (&argc, &argv); GlobalValue::Bind ("SimulatorImplementationType", - StringValue ("ns3::DistributedSimulatorImpl")); + StringValue ("ns3::DistributedSimulatorImpl")); uint32_t systemId = MpiInterface::GetSystemId (); uint32_t systemCount = MpiInterface::GetSize (); @@ -109,7 +109,7 @@ main (int argc, char *argv[]) NodeContainer csmaNodes; csmaNodes.Add (p2pNodes.Get (1)); - csmaNodes.Create (nCsma , 1); // Create csma nodes with rank 1 + csmaNodes.Create (nCsma, 1); // Create csma nodes with rank 1 CsmaHelper csma; csma.SetChannelAttribute ("DataRate", StringValue ("100Mbps")); @@ -130,7 +130,7 @@ main (int argc, char *argv[]) wifi.SetRemoteStationManager ("ns3::AarfWifiManager"); NqosWifiMacHelper mac = NqosWifiMacHelper::Default (); - + Ssid ssid = Ssid ("ns-3-ssid"); mac.SetType ("ns3::StaWifiMac", "Ssid", SsidValue (ssid), @@ -148,15 +148,15 @@ main (int argc, char *argv[]) MobilityHelper mobility; mobility.SetPositionAllocator ("ns3::GridPositionAllocator", - "MinX", DoubleValue (0.0), - "MinY", DoubleValue (0.0), - "DeltaX", DoubleValue (5.0), - "DeltaY", DoubleValue (5.0), - "GridWidth", UintegerValue (10), - "LayoutType", StringValue ("RowFirst")); + "MinX", DoubleValue (0.0), + "MinY", DoubleValue (0.0), + "DeltaX", DoubleValue (5.0), + "DeltaY", DoubleValue (5.0), + "GridWidth", UintegerValue (10), + "LayoutType", StringValue ("RowFirst")); mobility.SetMobilityModel ("ns3::RandomWalk2dMobilityModel", - "Bounds", RectangleValue (Rectangle (-250, 250, -250, 250))); + "Bounds", RectangleValue (Rectangle (-250, 250, -250, 250))); mobility.Install (wifiStaNodes); mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel"); diff --git a/examples/tap/tap-wifi-dumbbell.cc b/examples/tap/tap-wifi-dumbbell.cc index d73e242a2..3a4680069 100644 --- a/examples/tap/tap-wifi-dumbbell.cc +++ b/examples/tap/tap-wifi-dumbbell.cc @@ -16,13 +16,13 @@ // Network topology // -// +----------+ -// | external | -// | Linux | -// | Host | +// +----------+ +// | external | +// | Linux | +// | Host | // | | -// | "mytap" | -// +----------+ +// | "mytap" | +// +----------+ // | n0 n3 n4 // | +--------+ +------------+ +------------+ // +-------| tap | | | | | @@ -31,8 +31,8 @@ // | Wifi | | Wifi | P2P |-----| P2P | CSMA | // +--------+ +------+-----+ +-----+------+ // | | ^ | -// ((*)) ((*)) | | -// P2P 10.1.2 | +// ((*)) ((*)) | | +// P2P 10.1.2 | // ((*)) ((*)) | n5 n6 n7 // | | | | | | // n1 n2 ================ diff --git a/examples/tutorial/third.cc b/examples/tutorial/third.cc index 982bb8f36..5b31a84f8 100644 --- a/examples/tutorial/third.cc +++ b/examples/tutorial/third.cc @@ -25,7 +25,7 @@ // Default Network Topology // // Wifi 10.1.3.0 -// AP +// AP // * * * * // | | | | 10.1.1.0 // n5 n6 n7 n0 -------------- n1 n2 n3 n4 @@ -90,7 +90,7 @@ main (int argc, char *argv[]) wifi.SetRemoteStationManager ("ns3::AarfWifiManager"); NqosWifiMacHelper mac = NqosWifiMacHelper::Default (); - + Ssid ssid = Ssid ("ns-3-ssid"); mac.SetType ("ns3::StaWifiMac", "Ssid", SsidValue (ssid), @@ -108,15 +108,15 @@ main (int argc, char *argv[]) MobilityHelper mobility; mobility.SetPositionAllocator ("ns3::GridPositionAllocator", - "MinX", DoubleValue (0.0), - "MinY", DoubleValue (0.0), - "DeltaX", DoubleValue (5.0), - "DeltaY", DoubleValue (10.0), - "GridWidth", UintegerValue (3), - "LayoutType", StringValue ("RowFirst")); + "MinX", DoubleValue (0.0), + "MinY", DoubleValue (0.0), + "DeltaX", DoubleValue (5.0), + "DeltaY", DoubleValue (10.0), + "GridWidth", UintegerValue (3), + "LayoutType", StringValue ("RowFirst")); mobility.SetMobilityModel ("ns3::RandomWalk2dMobilityModel", - "Bounds", RectangleValue (Rectangle (-50, 50, -50, 50))); + "Bounds", RectangleValue (Rectangle (-50, 50, -50, 50))); mobility.Install (wifiStaNodes); mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel"); diff --git a/examples/wireless/mixed-wireless.cc b/examples/wireless/mixed-wireless.cc index 2519ddfeb..e15d63e44 100644 --- a/examples/wireless/mixed-wireless.cc +++ b/examples/wireless/mixed-wireless.cc @@ -17,7 +17,7 @@ // // This ns-3 example demonstrates the use of helper functions to ease -// the construction of simulation scenarios. +// the construction of simulation scenarios. // // The simulation topology consists of a mixed wired and wireless // scenario in which a hierarchical mobility model is used. @@ -27,7 +27,7 @@ // Each backbone router also has a local 802.11 network and is connected // to a local LAN. An additional set of (K-1) nodes are connected to // this backbone. Finally, a local LAN is connected to each router -// on the backbone, with L-1 additional hosts. +// on the backbone, with L-1 additional hosts. // // The nodes are populated with TCP/IP stacks, and OLSR unicast routing // on the backbone. An example UDP transfer is shown. The simulator @@ -178,7 +178,7 @@ main (int argc, char *argv[]) // // The ad-hoc network nodes need a mobility model so we aggregate one to - // each of the nodes we just finished building. + // each of the nodes we just finished building. // MobilityHelper mobility; Ptr positionAlloc = @@ -225,7 +225,7 @@ main (int argc, char *argv[]) // CsmaHelper csma; csma.SetChannelAttribute ("DataRate", - DataRateValue (DataRate (5000000))); + DataRateValue (DataRate (5000000))); csma.SetChannelAttribute ("Delay", TimeValue (MilliSeconds (2))); NetDeviceContainer lanDevices = csma.Install (lan); // @@ -330,7 +330,7 @@ main (int argc, char *argv[]) // The below global routing does not take into account wireless effects. // However, it is useful for setting default routes for all of the nodes - // such as the LAN nodes. + // such as the LAN nodes. NS_LOG_INFO ("Enabling global routing on all nodes"); Ipv4GlobalRoutingHelper::PopulateRoutingTables (); @@ -354,10 +354,10 @@ main (int argc, char *argv[]) NS_ASSERT (lanNodes > 1 && infraNodes > 1); // We want the source to be the first node created outside of the backbone // Conveniently, the variable "backboneNodes" holds this node index value - Ptr appSource = NodeList::GetNode (backboneNodes); - // We want the sink to be the last node created in the topology. + Ptr appSource = NodeList::GetNode (backboneNodes); + // We want the sink to be the last node created in the topology. uint32_t lastNodeIndex = backboneNodes + backboneNodes*(lanNodes - 1) + backboneNodes*(infraNodes - 1) - 1; - Ptr appSink = NodeList::GetNode (lastNodeIndex); + Ptr appSink = NodeList::GetNode (lastNodeIndex); // Let's fetch the IP address of the last node, which is on Ipv4Interface 1 Ipv4Address remoteAddr = appSink->GetObject ()->GetAddress(1, 0).GetLocal (); @@ -383,17 +383,17 @@ main (int argc, char *argv[]) NS_LOG_INFO ("Configure Tracing."); if (enableTracing == true) - { + { CsmaHelper csma; - // - // Let's set up some ns-2-like ascii traces, using another helper class - // - AsciiTraceHelper ascii; - Ptr stream = ascii.CreateFileStream ("mixed-wireless.tr"); - wifiPhy.EnableAsciiAll (stream); - csma.EnableAsciiAll (stream); - internet.EnableAsciiIpv4All (stream); + // + // Let's set up some ns-2-like ascii traces, using another helper class + // + AsciiTraceHelper ascii; + Ptr stream = ascii.CreateFileStream ("mixed-wireless.tr"); + wifiPhy.EnableAsciiAll (stream); + csma.EnableAsciiAll (stream); + internet.EnableAsciiIpv4All (stream); // Let's do a pcap trace on the application source and sink, ifIndex 0 // Csma captures in non-promiscuous mode @@ -420,6 +420,6 @@ main (int argc, char *argv[]) NS_LOG_INFO ("Run Simulation."); Simulator::Stop (Seconds (stopTime)); - Simulator::Run (); + Simulator::Run (); Simulator::Destroy (); } diff --git a/examples/wireless/multirate.cc b/examples/wireless/multirate.cc index 892685ae1..4a1e3ebd8 100644 --- a/examples/wireless/multirate.cc +++ b/examples/wireless/multirate.cc @@ -78,15 +78,15 @@ public: const NqosWifiMacHelper &wifiMac, const YansWifiChannelHelper &wifiChannel, const MobilityHelper &mobility); bool CommandSetup (int argc, char **argv); - bool IsRouting () { return (enableRouting == 1) ? 1:0; } - bool IsMobility () { return (enableMobility == 1) ? 1:0; } + bool IsRouting () { return (enableRouting == 1) ? 1 : 0; } + bool IsMobility () { return (enableMobility == 1) ? 1 : 0; } - uint32_t GetScenario () {return scenario; } + uint32_t GetScenario () { return scenario; } std::string GetRtsThreshold () { return rtsThreshold; } std::string GetOutputFileName () { return outputFileName; } std::string GetRateManager () { return rateManager; } - + private: Vector GetPosition (Ptr node); @@ -123,19 +123,20 @@ private: }; Experiment::Experiment () -{} +{ +} -Experiment::Experiment (std::string name) : +Experiment::Experiment (std::string name) : m_output (name), - totalTime (0.3), + totalTime (0.3), expMean (0.1), //flows being exponentially distributed bytesTotal(0), packetSize (2000), gridSize (10), //10x10 grid for a total of 100 nodes nodeDistance (30), port (5000), - scenario (4), - enablePcap (false), + scenario (4), + enablePcap (false), enableTracing (true), enableFlowMon (false), enableRouting (false), @@ -164,9 +165,9 @@ Experiment::ReceivePacket (Ptr socket) { Ptr packet; while (packet = socket->Recv ()) - { - bytesTotal += packet->GetSize(); - } + { + bytesTotal += packet->GetSize(); + } } void @@ -202,31 +203,31 @@ Experiment::AssignNeighbors (NodeContainer c) if ( (i % gridSize) <= (gridSize/2 - 1)) { //lower left quadrant - if ( i < totalNodes/2 ) - { - containerA.Add(c.Get(i)); + if ( i < totalNodes/2 ) + { + containerA.Add(c.Get(i)); } - + //upper left quadrant if ( i >= (uint32_t)(4*totalNodes)/10 ) - { - containerC.Add(c.Get(i)); + { + containerC.Add(c.Get(i)); } - } + } if ( (i % gridSize) >= (gridSize/2 - 1)) { //lower right quadrant - if ( i < totalNodes/2 ) - { - containerB.Add(c.Get(i)); + if ( i < totalNodes/2 ) + { + containerB.Add(c.Get(i)); } //upper right quadrant if ( i >= (uint32_t)(4*totalNodes)/10 ) - { - containerD.Add(c.Get(i)); + { + containerD.Add(c.Get(i)); } - } + } } } @@ -238,7 +239,7 @@ NodeContainer Experiment::GenerateNeighbors (NodeContainer c, uint32_t senderId) { NodeContainer nc; - uint32_t limit = senderId + 2; + uint32_t limit = senderId + 2; for (uint32_t i= senderId - 2; i <= limit; i++) { //must ensure the boundaries for other topologies @@ -265,7 +266,7 @@ Experiment::SelectSrcDest (NodeContainer c) for (uint32_t i=0; i < totalNodes/3; i++) { - ApplicationSetup (c.Get(uvSrc.RandomVariable::GetInteger()), c.Get(uvDest.RandomVariable::GetInteger()) , 0, totalTime); + ApplicationSetup (c.Get(uvSrc.RandomVariable::GetInteger()), c.Get(uvDest.RandomVariable::GetInteger()), 0, totalTime); } } @@ -295,9 +296,9 @@ Experiment::SendMultiDestinations(Ptr sender, NodeContainer c) do { destIndex = (uint32_t) uv.GetValue(); - } while ( (c.Get(destIndex))->GetId () == sender->GetId ()); - - ApplicationSetup (sender, c.Get(destIndex) , start, stop); + } while ( (c.Get(destIndex))->GetId () == sender->GetId ()); + + ApplicationSetup (sender, c.Get(destIndex), start, stop); start = stop; @@ -325,15 +326,15 @@ Experiment::ApplicationSetup (Ptr client, Ptr server, double start, Ipv4Address ipv4AddrClient = iaddrClient.GetLocal (); NS_LOG_DEBUG("Set up Server Device " << (server->GetDevice(0))->GetAddress () - << " with ip " << ipv4AddrServer - << " position (" << serverPos.x << "," << serverPos.y << "," << serverPos.z << ")"); + << " with ip " << ipv4AddrServer + << " position (" << serverPos.x << "," << serverPos.y << "," << serverPos.z << ")"); NS_LOG_DEBUG("Set up Client Device " << (client->GetDevice(0))->GetAddress () - << " with ip " << ipv4AddrClient - << " position (" << clientPos.x << "," << clientPos.y << "," << clientPos.z << ")" - << "\n"); + << " with ip " << ipv4AddrClient + << " position (" << clientPos.x << "," << clientPos.y << "," << clientPos.z << ")" + << "\n"); + - // Equipping the source node with OnOff Application used for sending OnOffHelper onoff ("ns3::UdpSocketFactory", Address(InetSocketAddress(Ipv4Address("10.0.0.1"), port))); onoff.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1))); @@ -371,7 +372,7 @@ Experiment::Run (const WifiHelper &wifi, const YansWifiPhyHelper &wifiPhy, Ipv4StaticRoutingHelper staticRouting; Ipv4ListRoutingHelper list; - + if (enableRouting) { list.Add (staticRouting, 0); @@ -392,15 +393,15 @@ Experiment::Run (const WifiHelper &wifi, const YansWifiPhyHelper &wifiPhy, Ipv4InterfaceContainer ipInterfaces; ipInterfaces = address.Assign(devices); - + MobilityHelper mobil= mobility; mobil.SetPositionAllocator ("ns3::GridPositionAllocator", - "MinX", DoubleValue (0.0), - "MinY", DoubleValue (0.0), - "DeltaX", DoubleValue (nodeDistance), - "DeltaY", DoubleValue (nodeDistance), - "GridWidth", UintegerValue (gridSize), - "LayoutType", StringValue ("RowFirst")); + "MinX", DoubleValue (0.0), + "MinY", DoubleValue (0.0), + "DeltaX", DoubleValue (nodeDistance), + "DeltaY", DoubleValue (nodeDistance), + "GridWidth", UintegerValue (gridSize), + "LayoutType", StringValue ("RowFirst")); mobil.SetMobilityModel ("ns3::ConstantPositionMobilityModel"); @@ -506,7 +507,7 @@ Experiment::Run (const WifiHelper &wifi, const YansWifiPhyHelper &wifiPhy, } Simulator::Destroy (); - + return m_output; } @@ -552,7 +553,7 @@ int main (int argc, char *argv[]) YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default (); YansWifiChannelHelper wifiChannel = YansWifiChannelHelper::Default (); Ssid ssid = Ssid ("Testbed"); - + wifiMac.SetType ("ns3::AdhocWifiMac", "Ssid", SsidValue(ssid)); wifi.SetStandard (WIFI_PHY_STANDARD_holland); diff --git a/examples/wireless/simple-wifi-frame-aggregation.cc b/examples/wireless/simple-wifi-frame-aggregation.cc index b9d9b1d38..b70b77aa7 100644 --- a/examples/wireless/simple-wifi-frame-aggregation.cc +++ b/examples/wireless/simple-wifi-frame-aggregation.cc @@ -49,7 +49,7 @@ int main (int argc, char *argv[]) LogComponentEnable ("MsduAggregator", LOG_LEVEL_INFO); LogComponentEnable ("UdpEchoClientApplication", LOG_LEVEL_INFO); LogComponentEnable ("UdpEchoServerApplication", LOG_LEVEL_INFO); - + uint32_t nWifi = 1; CommandLine cmd; cmd.AddValue ("nWifi", "Number of wifi STA devices", nWifi); @@ -73,15 +73,15 @@ int main (int argc, char *argv[]) "Ssid", SsidValue (ssid), "ActiveProbing", BooleanValue (false)); mac.SetMsduAggregatorForAc (AC_BE, "ns3::MsduStandardAggregator", - "MaxAmsduSize", UintegerValue (3839)); - + "MaxAmsduSize", UintegerValue (3839)); + NetDeviceContainer staDevices; staDevices = wifi.Install (phy, mac, wifiNodes); - + mac.SetType ("ns3::ApWifiMac", "Ssid", SsidValue (ssid)); mac.SetMsduAggregatorForAc (AC_BE, "ns3::MsduStandardAggregator", - "MaxAmsduSize", UintegerValue (7935)); + "MaxAmsduSize", UintegerValue (7935)); NetDeviceContainer apDevice; apDevice = wifi.Install (phy, mac, wifiApNode); @@ -90,20 +90,20 @@ int main (int argc, char *argv[]) MobilityHelper mobility; mobility.SetPositionAllocator ("ns3::GridPositionAllocator", - "MinX", DoubleValue (0.0), - "MinY", DoubleValue (0.0), - "DeltaX", DoubleValue (5.0), - "DeltaY", DoubleValue (10.0), - "GridWidth", UintegerValue (3), - "LayoutType", StringValue ("RowFirst")); + "MinX", DoubleValue (0.0), + "MinY", DoubleValue (0.0), + "DeltaX", DoubleValue (5.0), + "DeltaY", DoubleValue (10.0), + "GridWidth", UintegerValue (3), + "LayoutType", StringValue ("RowFirst")); mobility.SetMobilityModel ("ns3::RandomWalk2dMobilityModel", - "Bounds", RectangleValue (Rectangle (-50, 50, -50, 50))); + "Bounds", RectangleValue (Rectangle (-50, 50, -50, 50))); mobility.Install (wifiNodes); mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel"); mobility.Install (wifiApNode); - + /* Internet stack*/ InternetStackHelper stack; stack.Install (wifiApNode); @@ -114,10 +114,10 @@ int main (int argc, char *argv[]) address.SetBase ("192.168.1.0", "255.255.255.0"); Ipv4InterfaceContainer wifiNodesInterfaces; Ipv4InterfaceContainer apNodeInterface; - + wifiNodesInterfaces = address.Assign (staDevices); apNodeInterface = address.Assign (apDevice); - + /* Setting applications */ UdpEchoServerHelper echoServer (9); @@ -138,12 +138,12 @@ int main (int argc, char *argv[]) Ipv4GlobalRoutingHelper::PopulateRoutingTables (); Simulator::Stop (Seconds (10.0)); - + phy.EnablePcap ("test-802.11n", - wifiNodes.Get (nWifi - 1)->GetId (), 0); + wifiNodes.Get (nWifi - 1)->GetId (), 0); Simulator::Run (); Simulator::Destroy (); - + return 0; } diff --git a/examples/wireless/wifi-ap.cc b/examples/wireless/wifi-ap.cc index 18d39155a..593d240cf 100644 --- a/examples/wireless/wifi-ap.cc +++ b/examples/wireless/wifi-ap.cc @@ -121,7 +121,7 @@ int main (int argc, char *argv[]) cmd.AddValue ("verbose", "Print trace information if true", g_verbose); cmd.Parse (argc, argv); - + Packet::EnablePrinting (); // enable rts cts all the time. @@ -186,7 +186,7 @@ int main (int argc, char *argv[]) Config::Connect ("/NodeList/*/DeviceList/*/Phy/State/RxError", MakeCallback (&PhyRxErrorTrace)); Config::Connect ("/NodeList/*/DeviceList/*/Phy/State/Tx", MakeCallback (&PhyTxTrace)); Config::Connect ("/NodeList/*/DeviceList/*/Phy/State/State", MakeCallback (&PhyStateTrace)); - + AthstatsHelper athstats; athstats.EnableAthstats("athstats-sta", stas); athstats.EnableAthstats("athstats-ap", ap); diff --git a/examples/wireless/wifi-blockack.cc b/examples/wireless/wifi-blockack.cc index 90ce9bd64..8b9f64020 100644 --- a/examples/wireless/wifi-blockack.cc +++ b/examples/wireless/wifi-blockack.cc @@ -58,7 +58,7 @@ int main (int argc, char const* argv[]) Ptr sta = CreateObject (); Ptr ap = CreateObject (); - + YansWifiChannelHelper channel = YansWifiChannelHelper::Default (); YansWifiPhyHelper phy = YansWifiPhyHelper::Default (); phy.SetChannel (channel.Create ()); @@ -69,9 +69,9 @@ int main (int argc, char const* argv[]) wifi.SetRemoteStationManager ("ns3::AarfWifiManager", "FragmentationThreshold", UintegerValue (2500)); Ssid ssid ("My-network"); - + mac.SetType ("ns3::StaWifiMac", - "Ssid" , SsidValue (ssid), + "Ssid", SsidValue (ssid), "ActiveProbing", BooleanValue (false)); /* setting blockack threshold for sta's BE queue */ mac.SetBlockAckThresholdForAc (AC_BE, 2); @@ -83,20 +83,20 @@ int main (int argc, char const* argv[]) "Ssid", SsidValue (ssid)); mac.SetBlockAckThresholdForAc (AC_BE, 0); NetDeviceContainer apDevice = wifi.Install (phy, mac, ap); - + /* Setting mobility model */ MobilityHelper mobility; mobility.SetPositionAllocator ("ns3::GridPositionAllocator", - "MinX", DoubleValue (0.0), - "MinY", DoubleValue (0.0), - "DeltaX", DoubleValue (5.0), - "DeltaY", DoubleValue (10.0), - "GridWidth", UintegerValue (3), - "LayoutType", StringValue ("RowFirst")); + "MinX", DoubleValue (0.0), + "MinY", DoubleValue (0.0), + "DeltaX", DoubleValue (5.0), + "DeltaY", DoubleValue (10.0), + "GridWidth", UintegerValue (3), + "LayoutType", StringValue ("RowFirst")); mobility.SetMobilityModel ("ns3::RandomWalk2dMobilityModel", - "Bounds", RectangleValue (Rectangle (-50, 50, -50, 50))); + "Bounds", RectangleValue (Rectangle (-50, 50, -50, 50))); mobility.Install (sta); mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel"); @@ -106,7 +106,7 @@ int main (int argc, char const* argv[]) InternetStackHelper stack; stack.Install (sta); stack.Install (ap); - + Ipv4AddressHelper address; address.SetBase ("192.168.1.0", "255.255.255.0"); @@ -116,7 +116,7 @@ int main (int argc, char const* argv[]) apIf = address.Assign (apDevice); /* Setting applications */ - + uint16_t port = 9; DataRate dataRate ("1Mb/s"); diff --git a/examples/wireless/wifi-simple-infra.cc b/examples/wireless/wifi-simple-infra.cc index 38a421b16..28d682cf9 100644 --- a/examples/wireless/wifi-simple-infra.cc +++ b/examples/wireless/wifi-simple-infra.cc @@ -107,7 +107,7 @@ int main (int argc, char *argv[]) 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); @@ -149,7 +149,7 @@ int main (int argc, char *argv[]) NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default (); wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode",StringValue(phyMode), - "ControlMode",StringValue(phyMode)); + "ControlMode",StringValue(phyMode)); // Setup the rest of the upper mac Ssid ssid = Ssid ("wifi-default"); @@ -196,7 +196,7 @@ int main (int argc, char *argv[]) // Tracing wifiPhy.EnablePcap ("wifi-simple-infra", devices); - + // Output what we are doing NS_LOG_UNCOND ("Testing " << numPackets << " packets sent with receiver rss " << rss ); diff --git a/examples/wireless/wifi-wired-bridging.cc b/examples/wireless/wifi-wired-bridging.cc index a624e4bf8..b236356f5 100644 --- a/examples/wireless/wifi-wired-bridging.cc +++ b/examples/wireless/wifi-wired-bridging.cc @@ -29,7 +29,7 @@ // WIFI STA WIFI STA WIFI STA WIFI STA // -------- -------- -------- -------- // ((*)) ((*)) | ((*)) ((*)) -// | +// | // ((*)) | ((*)) // ------- ------- // WIFI AP CSMA ========= CSMA WIFI AP @@ -38,9 +38,9 @@ // BRIDGE BRIDGE // ############## ############## // 192.168.0.1 192.168.0.2 -// +---------+ +---------+ +// +---------+ +---------+ // | AP Node | | AP Node | -// +---------+ +---------+ +// +---------+ +---------+ // #include "ns3/core-module.h" @@ -116,12 +116,12 @@ int main (int argc, char *argv[]) sta.Create (nStas); mobility.SetPositionAllocator ("ns3::GridPositionAllocator", - "MinX", DoubleValue (wifiX), - "MinY", DoubleValue (0.0), - "DeltaX", DoubleValue (5.0), - "DeltaY", DoubleValue (5.0), - "GridWidth", UintegerValue (1), - "LayoutType", StringValue ("RowFirst")); + "MinX", DoubleValue (wifiX), + "MinY", DoubleValue (0.0), + "DeltaX", DoubleValue (5.0), + "DeltaY", DoubleValue (5.0), + "GridWidth", UintegerValue (1), + "LayoutType", StringValue ("RowFirst")); // setup the AP. @@ -140,10 +140,10 @@ int main (int argc, char *argv[]) // setup the STAs stack.Install (sta); mobility.SetMobilityModel ("ns3::RandomWalk2dMobilityModel", - "Mode", StringValue ("Time"), - "Time", StringValue ("2s"), - "Speed", StringValue ("Constant:1.0"), - "Bounds", RectangleValue (Rectangle (wifiX, wifiX+5.0,0.0, (nStas+1)*5.0))); + "Mode", StringValue ("Time"), + "Time", StringValue ("2s"), + "Speed", StringValue ("Constant:1.0"), + "Bounds", RectangleValue (Rectangle (wifiX, wifiX+5.0,0.0, (nStas+1)*5.0))); mobility.Install (sta); wifiMac.SetType ("ns3::StaWifiMac", "Ssid", SsidValue (ssid), @@ -184,7 +184,7 @@ int main (int argc, char *argv[]) ApplicationContainer apps = onoff.Install (staNodes[0].Get (0)); apps.Start (Seconds (0.5)); apps.Stop (Seconds (3.0)); - + wifiPhy.EnablePcap ("wifi-wired-bridging", apDevices[0]); wifiPhy.EnablePcap ("wifi-wired-bridging", apDevices[1]); diff --git a/src/devices/mesh/dot11s/airtime-metric.cc b/src/devices/mesh/dot11s/airtime-metric.cc index 1ec4ba29e..86e81833d 100644 --- a/src/devices/mesh/dot11s/airtime-metric.cc +++ b/src/devices/mesh/dot11s/airtime-metric.cc @@ -32,26 +32,26 @@ AirtimeLinkMetricCalculator::GetTypeId () .AddConstructor () .AddAttribute ( "TestLength", "Rate should be estimated using test length.", - UintegerValue (1024), - MakeUintegerAccessor ( - &AirtimeLinkMetricCalculator::SetTestLength), - MakeUintegerChecker (1) - ) + UintegerValue (1024), + MakeUintegerAccessor ( + &AirtimeLinkMetricCalculator::SetTestLength), + MakeUintegerChecker (1) + ) .AddAttribute ( "Dot11MetricTid", "TID used to calculate metric (data rate)", UintegerValue (0), MakeUintegerAccessor ( - &AirtimeLinkMetricCalculator::SetHeaderTid), + &AirtimeLinkMetricCalculator::SetHeaderTid), MakeUintegerChecker (0) - ) + ) .AddAttribute ( "Dot11sMeshHeaderLength", "Length of the mesh header", UintegerValue (6), MakeUintegerAccessor ( - &AirtimeLinkMetricCalculator::m_meshHeaderLength), + &AirtimeLinkMetricCalculator::m_meshHeaderLength), MakeUintegerChecker (0) - ) - ; + ) + ; return tid; } AirtimeLinkMetricCalculator::AirtimeLinkMetricCalculator () : @@ -69,7 +69,7 @@ AirtimeLinkMetricCalculator::SetHeaderTid (uint8_t tid) void AirtimeLinkMetricCalculator::SetTestLength (uint16_t testLength) { - m_testFrame = Create (testLength + 6 /*Mesh header*/ + 36/*802.11 header*/); + m_testFrame = Create (testLength + 6 /*Mesh header*/ + 36 /*802.11 header*/); } uint32_t AirtimeLinkMetricCalculator::CalculateMetric (Mac48Address peerAddress, Ptr mac) @@ -91,10 +91,10 @@ AirtimeLinkMetricCalculator::CalculateMetric (Mac48Address peerAddress, PtrGetWifiRemoteStationManager ()->GetInfo (peerAddress).GetFrameErrorRate (); NS_ASSERT (failAvg < 1.0); //calculate metric - uint32_t metric = (uint32_t)((double)(/*Overhead + payload*/ - mac->GetPifs () + mac->GetSlot () + mac->GetEifsNoDifs () + //DIFS + SIFS + AckTxTime = PIFS + SLOT + EifsNoDifs - mac->GetWifiPhy () ->CalculateTxDuration (m_testFrame->GetSize (), mode, WIFI_PREAMBLE_LONG) - ).GetMicroSeconds () / (10.24 * (1.0 - failAvg))); + uint32_t metric = (uint32_t)((double)( /*Overhead + payload*/ + mac->GetPifs () + mac->GetSlot () + mac->GetEifsNoDifs () + //DIFS + SIFS + AckTxTime = PIFS + SLOT + EifsNoDifs + mac->GetWifiPhy ()->CalculateTxDuration (m_testFrame->GetSize (), mode, WIFI_PREAMBLE_LONG) + ).GetMicroSeconds () / (10.24 * (1.0 - failAvg))); return metric; } } //namespace dot11s diff --git a/src/devices/mesh/mesh-wifi-interface-mac.cc b/src/devices/mesh/mesh-wifi-interface-mac.cc index 051cbf21c..220e803a8 100644 --- a/src/devices/mesh/mesh-wifi-interface-mac.cc +++ b/src/devices/mesh/mesh-wifi-interface-mac.cc @@ -45,31 +45,31 @@ TypeId MeshWifiInterfaceMac::GetTypeId () { static TypeId tid = TypeId ("ns3::MeshWifiInterfaceMac") - .SetParent () - .AddConstructor () - .AddAttribute ( "BeaconInterval", - "Beacon Interval", - TimeValue (Seconds (0.5)), + .SetParent () + .AddConstructor () + .AddAttribute ( "BeaconInterval", + "Beacon Interval", + TimeValue (Seconds (0.5)), - MakeTimeAccessor ( + MakeTimeAccessor ( &MeshWifiInterfaceMac::m_beaconInterval), - MakeTimeChecker () - ) - .AddAttribute ( "RandomStart", - "Window when beacon generating starts (uniform random) in seconds", - TimeValue (Seconds (0.5)), - MakeTimeAccessor ( + MakeTimeChecker () + ) + .AddAttribute ( "RandomStart", + "Window when beacon generating starts (uniform random) in seconds", + TimeValue (Seconds (0.5)), + MakeTimeAccessor ( &MeshWifiInterfaceMac::m_randomStart), - MakeTimeChecker () - ) - .AddAttribute ( "BeaconGeneration", - "Enable/Disable Beaconing.", - BooleanValue (true), - MakeBooleanAccessor ( + MakeTimeChecker () + ) + .AddAttribute ( "BeaconGeneration", + "Enable/Disable Beaconing.", + BooleanValue (true), + MakeBooleanAccessor ( &MeshWifiInterfaceMac::SetBeaconGeneration, &MeshWifiInterfaceMac::GetBeaconGeneration), - MakeBooleanChecker () - ) - ; + MakeBooleanChecker () + ) + ; return tid; } MeshWifiInterfaceMac::MeshWifiInterfaceMac () : @@ -364,7 +364,7 @@ MeshWifiInterfaceMac::ShiftTbtt (Time shift) // Shift scheduled event Simulator::Cancel (m_beaconSendEvent); m_beaconSendEvent = Simulator::Schedule (GetTbtt () - Simulator::Now (), &MeshWifiInterfaceMac::SendBeacon, - this); + this); } void MeshWifiInterfaceMac::ScheduleNextBeacon () @@ -410,7 +410,7 @@ MeshWifiInterfaceMac::Receive (Ptr packet, WifiMacHeader const *hdr) packet->PeekHeader (beacon_hdr); NS_LOG_DEBUG ("Beacon received from " << hdr->GetAddr2 () << " I am " << GetAddress () << " at " - << Simulator::Now ().GetMicroSeconds () << " microseconds"); + << Simulator::Now ().GetMicroSeconds () << " microseconds"); // update supported rates if (beacon_hdr.GetSsid ().IsEqual (GetSsid ())) @@ -495,19 +495,19 @@ MeshWifiInterfaceMac::Statistics::Print (std::ostream & os) const { os << "" << std::endl; + "rxBeacons=\"" << recvBeacons << "\" " + "txFrames=\"" << sentFrames << "\" " + "txBytes=\"" << sentBytes << "\" " + "rxFrames=\"" << recvFrames << "\" " + "rxBytes=\"" << recvBytes << "\"/>" << std::endl; } void MeshWifiInterfaceMac::Report (std::ostream & os) const { os << "" << std::endl; + "BeaconInterval=\"" << GetBeaconInterval ().GetSeconds () << "\" " + "Channel=\"" << GetFrequencyChannel () << "\" " + "Address = \"" << GetAddress () << "\">" << std::endl; m_stats.Print (os); os << "" << std::endl; } diff --git a/src/devices/wifi/adhoc-wifi-mac.cc b/src/devices/wifi/adhoc-wifi-mac.cc index 4e2afa49f..b7b32fe7d 100644 --- a/src/devices/wifi/adhoc-wifi-mac.cc +++ b/src/devices/wifi/adhoc-wifi-mac.cc @@ -48,7 +48,7 @@ AdhocWifiMac::GetTypeId (void) static TypeId tid = TypeId ("ns3::AdhocWifiMac") .SetParent () .AddConstructor () - ; + ; return tid; } diff --git a/src/devices/wifi/ap-wifi-mac.cc b/src/devices/wifi/ap-wifi-mac.cc index c23d561a0..8374a2da1 100644 --- a/src/devices/wifi/ap-wifi-mac.cc +++ b/src/devices/wifi/ap-wifi-mac.cc @@ -60,7 +60,7 @@ ApWifiMac::GetTypeId (void) MakeBooleanAccessor (&ApWifiMac::SetBeaconGeneration, &ApWifiMac::GetBeaconGeneration), MakeBooleanChecker ()) - ; + ; return tid; } diff --git a/src/devices/wifi/ap-wifi-mac.h b/src/devices/wifi/ap-wifi-mac.h index 05228bc93..90c3687f1 100644 --- a/src/devices/wifi/ap-wifi-mac.h +++ b/src/devices/wifi/ap-wifi-mac.h @@ -99,15 +99,15 @@ private: virtual void TxOk (const WifiMacHeader &hdr); virtual void TxFailed (const WifiMacHeader &hdr); - /** - * This method is called to de-aggregate an A-MSDU and forward the - * constituent packets up the stack. We override the WifiMac version - * here because, as an AP, we also need to think about redistributing - * to other associated STAs. - * - * \param aggregatedPacket the Packet containing the A-MSDU. - * \param hdr a pointer to the MAC header for \c aggregatedPacket. - */ + /** + * This method is called to de-aggregate an A-MSDU and forward the + * constituent packets up the stack. We override the WifiMac version + * here because, as an AP, we also need to think about redistributing + * to other associated STAs. + * + * \param aggregatedPacket the Packet containing the A-MSDU. + * \param hdr a pointer to the MAC header for \c aggregatedPacket. + */ virtual void DeaggregateAmsduAndForward (Ptr aggregatedPacket, const WifiMacHeader *hdr); diff --git a/src/devices/wifi/edca-txop-n.h b/src/devices/wifi/edca-txop-n.h index 973470e02..b0a92d62b 100644 --- a/src/devices/wifi/edca-txop-n.h +++ b/src/devices/wifi/edca-txop-n.h @@ -56,10 +56,10 @@ class MgtDelBaHeader; /* This queue contains packets for a particular access class. * possibles access classes are: - * + * * -AC_VO : voice, tid = 6,7 ^ * -AC_VI : video, tid = 4,5 | - * -AC_BE : best-effort, tid = 0,3 | priority + * -AC_BE : best-effort, tid = 0,3 | priority * -AC_BK : background, tid = 1,2 | * * For more details see section 9.1.3.1 in 802.11 standard. @@ -78,12 +78,12 @@ public: typedef Callback TxOk; typedef Callback TxFailed; - + static TypeId GetTypeId (void); EdcaTxopN (); virtual ~EdcaTxopN (); void DoDispose (); - + void SetLow (Ptr low); void SetTxMiddle (MacTxMiddle *txMiddle); void SetManager (DcfManager *manager); @@ -139,7 +139,7 @@ public: bool IsLastFragment (void) const; void NextFragment (void); Ptr GetFragmentPacket (WifiMacHeader *hdr); - + void SetAccessCategory (enum AcIndex ac); void Queue (Ptr packet, const WifiMacHeader &hdr); void SetMsduAggregator (Ptr aggr); @@ -187,7 +187,7 @@ private: * if an established block ack agreement exists with the receiver. */ void VerifyBlockAck (void); - + AcIndex m_ac; class Dcf; class TransmissionListener; @@ -206,12 +206,12 @@ private: RandomStream *m_rng; Ptr m_stationManager; uint8_t m_fragmentNumber; - + /* current packet could be a simple MSDU or, if an aggregator for this queue is present, could be an A-MSDU. */ Ptr m_currentPacket; - + WifiMacHeader m_currentHdr; Ptr m_aggregator; TypeOfStation m_typeOfStation; diff --git a/src/devices/wifi/mac-low.h b/src/devices/wifi/mac-low.h index 0726d74f5..64f4608a2 100644 --- a/src/devices/wifi/mac-low.h +++ b/src/devices/wifi/mac-low.h @@ -638,7 +638,7 @@ private: typedef std::map BlockAckCaches; typedef std::map::iterator BlockAckCachesI; - + Agreements m_bAckAgreements; BlockAckCaches m_bAckCaches; diff --git a/src/devices/wifi/regular-wifi-mac.cc b/src/devices/wifi/regular-wifi-mac.cc index 9061e93ca..0e73406f5 100644 --- a/src/devices/wifi/regular-wifi-mac.cc +++ b/src/devices/wifi/regular-wifi-mac.cc @@ -392,14 +392,14 @@ RegularWifiMac::GetBssid (void) const void RegularWifiMac::Enqueue (Ptr packet, - Mac48Address to, Mac48Address from) + Mac48Address to, Mac48Address from) { // We expect RegularWifiMac subclasses which do support forwarding (e.g., // AP) to override this method. Therefore, we throw a fatal error if // someone tries to invoke this method on a class which has not done // this. NS_FATAL_ERROR ("This MAC entity (" << this << ", " << GetAddress () - << ") does not support Enqueue() with from address"); + << ") does not support Enqueue() with from address"); } bool @@ -619,7 +619,7 @@ RegularWifiMac::GetTypeId (void) .AddTraceSource ("TxErrHeader", "The header of unsuccessfully transmitted packet", MakeTraceSourceAccessor (&RegularWifiMac::m_txErrCallback)) - ; + ; return tid; } diff --git a/src/devices/wifi/regular-wifi-mac.h b/src/devices/wifi/regular-wifi-mac.h index b5ced9e8b..73939f6e1 100644 --- a/src/devices/wifi/regular-wifi-mac.h +++ b/src/devices/wifi/regular-wifi-mac.h @@ -274,13 +274,13 @@ protected: void ForwardUp (Ptr packet, Mac48Address from, Mac48Address to); - /** - * This method can be called to de-aggregate an A-MSDU and forward - * the constituent packets up the stack. - * - * \param aggregatedPacket the Packet containing the A-MSDU. - * \param hdr a pointer to the MAC header for \c aggregatedPacket. - */ + /** + * This method can be called to de-aggregate an A-MSDU and forward + * the constituent packets up the stack. + * + * \param aggregatedPacket the Packet containing the A-MSDU. + * \param hdr a pointer to the MAC header for \c aggregatedPacket. + */ virtual void DeaggregateAmsduAndForward (Ptr aggregatedPacket, const WifiMacHeader *hdr); diff --git a/src/devices/wifi/sta-wifi-mac.cc b/src/devices/wifi/sta-wifi-mac.cc index fed66ddb3..5b0c4528b 100644 --- a/src/devices/wifi/sta-wifi-mac.cc +++ b/src/devices/wifi/sta-wifi-mac.cc @@ -50,11 +50,11 @@ NS_LOG_COMPONENT_DEFINE ("StaWifiMac"); \ ----------------- ----------------------------- \-> | Beacon Missed | --> | Wait Association Response | ----------------- ----------------------------- - \ ^ - \ | - \ ----------------------- - \-> | Wait Probe Response | - ----------------------- + \ ^ + \ | + \ ----------------------- + \-> | Wait Probe Response | + ----------------------- */ namespace ns3 { @@ -89,7 +89,7 @@ StaWifiMac::GetTypeId (void) MakeTraceSourceAccessor (&StaWifiMac::m_assocLogger)) .AddTraceSource ("DeAssoc", "Association with an access point lost.", MakeTraceSourceAccessor (&StaWifiMac::m_deAssocLogger)) - ; + ; return tid; } @@ -212,39 +212,39 @@ StaWifiMac::TryToEnsureAssociated (void) { NS_LOG_FUNCTION (this); switch (m_state) { - case ASSOCIATED: - return; - break; - case WAIT_PROBE_RESP: - /* we have sent a probe request earlier so we - do not need to re-send a probe request immediately. - We just need to wait until probe-request-timeout - or until we get a probe response - */ - break; - case BEACON_MISSED: - /* we were associated but we missed a bunch of beacons - * so we should assume we are not associated anymore. - * We try to initiate a probe request now. - */ - m_linkDown (); - SetState (WAIT_PROBE_RESP); - SendProbeRequest (); - break; - case WAIT_ASSOC_RESP: - /* we have sent an assoc request so we do not need to - re-send an assoc request right now. We just need to - wait until either assoc-request-timeout or until - we get an assoc response. - */ - break; - case REFUSED: - /* we have sent an assoc request and received a negative - assoc resp. We wait until someone restarts an - association with a given ssid. - */ - break; - } + case ASSOCIATED: + return; + break; + case WAIT_PROBE_RESP: + /* we have sent a probe request earlier so we + do not need to re-send a probe request immediately. + We just need to wait until probe-request-timeout + or until we get a probe response + */ + break; + case BEACON_MISSED: + /* we were associated but we missed a bunch of beacons + * so we should assume we are not associated anymore. + * We try to initiate a probe request now. + */ + m_linkDown (); + SetState (WAIT_PROBE_RESP); + SendProbeRequest (); + break; + case WAIT_ASSOC_RESP: + /* we have sent an assoc request so we do not need to + re-send an assoc request right now. We just need to + wait until either assoc-request-timeout or until + we get an assoc response. + */ + break; + case REFUSED: + /* we have sent an assoc request and received a negative + assoc resp. We wait until someone restarts an + association with a given ssid. + */ + break; + } } void @@ -284,7 +284,7 @@ StaWifiMac::RestartBeaconWatchdog (Time delay) NS_LOG_FUNCTION (this << delay); m_beaconWatchdogEnd = std::max (Simulator::Now () + delay, m_beaconWatchdogEnd); if (Simulator::GetDelayLeft (m_beaconWatchdog) < delay && - m_beaconWatchdog.IsExpired ()) + m_beaconWatchdog.IsExpired ()) { NS_LOG_DEBUG ("really restart watchdog."); m_beaconWatchdog = Simulator::Schedule (delay, &StaWifiMac::MissedBeacons, this); diff --git a/src/devices/wifi/wifi-test.cc b/src/devices/wifi/wifi-test.cc index 5f54ac3c1..b204cc5f8 100644 --- a/src/devices/wifi/wifi-test.cc +++ b/src/devices/wifi/wifi-test.cc @@ -58,16 +58,17 @@ private: WifiTest::WifiTest () : TestCase ("Wifi") -{} +{ +} -void +void WifiTest::SendOnePacket (Ptr dev) { Ptr p = Create (); dev->Send (p, dev->GetBroadcast (), 1); } -void +void WifiTest::CreateOne (Vector pos, Ptr channel) { Ptr node = CreateObject (); @@ -120,7 +121,7 @@ WifiTest::DoRun (void) { m_mac.SetTypeId ("ns3::AdhocWifiMac"); m_propDelay.SetTypeId ("ns3::ConstantSpeedPropagationDelayModel"); - + m_manager.SetTypeId ("ns3::ArfWifiManager"); RunOne (); m_manager.SetTypeId ("ns3::AarfWifiManager"); @@ -196,9 +197,10 @@ private: InterferenceHelperSequenceTest::InterferenceHelperSequenceTest () : TestCase ("InterferenceHelperSequence") -{} +{ +} -void +void InterferenceHelperSequenceTest::SendOnePacket (Ptr dev) { Ptr p = Create (9999); @@ -263,20 +265,20 @@ InterferenceHelperSequenceTest::DoRun (void) propLoss->SetDefaultLoss (999); Simulator::Schedule (Seconds (1.0), - &InterferenceHelperSequenceTest::SendOnePacket, this, - DynamicCast (senderB->GetDevice (0))); + &InterferenceHelperSequenceTest::SendOnePacket, this, + DynamicCast (senderB->GetDevice (0))); Simulator::Schedule (Seconds (1.0000001), - &InterferenceHelperSequenceTest::SwitchCh, this, - DynamicCast (rxOnly->GetDevice (0))); + &InterferenceHelperSequenceTest::SwitchCh, this, + DynamicCast (rxOnly->GetDevice (0))); Simulator::Schedule (Seconds (5.0), - &InterferenceHelperSequenceTest::SendOnePacket, this, - DynamicCast (senderA->GetDevice (0))); + &InterferenceHelperSequenceTest::SendOnePacket, this, + DynamicCast (senderA->GetDevice (0))); Simulator::Schedule (Seconds (7.0), - &InterferenceHelperSequenceTest::SendOnePacket, this, - DynamicCast (senderB->GetDevice (0))); + &InterferenceHelperSequenceTest::SendOnePacket, this, + DynamicCast (senderB->GetDevice (0))); Simulator::Stop (Seconds (100.0)); Simulator::Run (); diff --git a/src/helper/nqos-wifi-mac-helper.cc b/src/helper/nqos-wifi-mac-helper.cc index f54a7d4ad..1ce706880 100644 --- a/src/helper/nqos-wifi-mac-helper.cc +++ b/src/helper/nqos-wifi-mac-helper.cc @@ -26,10 +26,12 @@ namespace ns3 { NqosWifiMacHelper::NqosWifiMacHelper () -{} +{ +} NqosWifiMacHelper::~NqosWifiMacHelper () -{} +{ +} NqosWifiMacHelper NqosWifiMacHelper::Default (void) diff --git a/src/helper/qos-wifi-mac-helper.cc b/src/helper/qos-wifi-mac-helper.cc index 1d938a48d..060196249 100644 --- a/src/helper/qos-wifi-mac-helper.cc +++ b/src/helper/qos-wifi-mac-helper.cc @@ -28,10 +28,12 @@ namespace ns3 { QosWifiMacHelper::QosWifiMacHelper () -{} +{ +} QosWifiMacHelper::~QosWifiMacHelper () -{} +{ +} QosWifiMacHelper QosWifiMacHelper::Default (void) @@ -117,7 +119,7 @@ QosWifiMacHelper::Setup (Ptr mac, enum AcIndex ac, std::string dcaAttrN PointerValue ptr; mac->GetAttribute (dcaAttrName, ptr); Ptr edca = ptr.Get (); - + if (it != m_aggregators.end ()) { ObjectFactory factory = it->second; @@ -139,7 +141,7 @@ Ptr QosWifiMacHelper::Create (void) const { Ptr mac = m_mac.Create (); - + Setup (mac, AC_VO, "VO_EdcaTxopN"); Setup (mac, AC_VI, "VI_EdcaTxopN"); Setup (mac, AC_BE, "BE_EdcaTxopN"); diff --git a/src/helper/wifi-helper.cc b/src/helper/wifi-helper.cc index b34e51a10..b47cae38c 100644 --- a/src/helper/wifi-helper.cc +++ b/src/helper/wifi-helper.cc @@ -39,14 +39,17 @@ NS_LOG_COMPONENT_DEFINE ("WifiHelper"); namespace ns3 { WifiPhyHelper::~WifiPhyHelper () -{} +{ +} WifiMacHelper::~WifiMacHelper () -{} +{ +} WifiHelper::WifiHelper () : m_standard (WIFI_PHY_STANDARD_80211a) -{} +{ +} WifiHelper WifiHelper::Default (void) diff --git a/src/routing/olsr/test/tc-regression-test.cc b/src/routing/olsr/test/tc-regression-test.cc index fb017e011..bd518a707 100644 --- a/src/routing/olsr/test/tc-regression-test.cc +++ b/src/routing/olsr/test/tc-regression-test.cc @@ -61,11 +61,11 @@ TcRegressionTest::DoRun () { SeedManager::SetSeed(12345); CreateNodes (); - + Simulator::Stop (m_time); Simulator::Run (); Simulator::Destroy (); - + if (!WRITE_VECTORS) CheckResults (); return GetErrorStatus (); } @@ -76,25 +76,25 @@ TcRegressionTest::CreateNodes () // create 3 nodes NodeContainer c; c.Create (3); - + // place nodes in the chain MobilityHelper mobility; mobility.SetPositionAllocator ("ns3::GridPositionAllocator", - "MinX", DoubleValue (0.0), - "MinY", DoubleValue (0.0), - "DeltaX", DoubleValue (m_step), - "DeltaY", DoubleValue (0), - "GridWidth", UintegerValue (3), - "LayoutType", StringValue ("RowFirst")); + "MinX", DoubleValue (0.0), + "MinY", DoubleValue (0.0), + "DeltaX", DoubleValue (m_step), + "DeltaY", DoubleValue (0), + "GridWidth", UintegerValue (3), + "LayoutType", StringValue ("RowFirst")); mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel"); mobility.Install (c); - + // install TCP/IP & OLSR OlsrHelper olsr; InternetStackHelper internet; internet.SetRoutingHelper (olsr); internet.Install (c); - + // create wifi channel & devices NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default (); wifiMac.SetType ("ns3::AdhocWifiMac"); @@ -127,11 +127,11 @@ TcRegressionTest::CheckResults () // File naming conventions are hard-coded here. os1 << NS_TEST_SOURCEDIR << PREFIX << "-" << i << "-1.pcap"; os2 << GetTempDir () << PREFIX << "-" << i << "-1.pcap"; - + uint32_t sec(0), usec(0); bool diff = PcapFile::Diff (os1.str(), os2.str(), sec, usec); NS_TEST_EXPECT_MSG_EQ (diff, false, "PCAP traces " << os1.str() << " and " << os2.str() - << " differ starting from " << sec << " s " << usec << " us"); + << " differ starting from " << sec << " s " << usec << " us"); } }