check-style.py run on src/dsr
authorTom Henderson <tomh@tomh.org>
Sun, 13 May 2012 10:47:11 -0700
changeset 8756 9a34e618f40b
parent 8755 78bf735a3d5e
child 8757 1e800af096dc
check-style.py run on src/dsr
src/dsr/examples/dsr.cc
src/dsr/model/dsr-errorbuff.cc
src/dsr/model/dsr-maintain-buff.cc
src/dsr/model/dsr-network-queue.cc
src/dsr/model/dsr-network-queue.h
src/dsr/model/dsr-option-header.cc
src/dsr/model/dsr-options.cc
src/dsr/model/dsr-rcache.cc
src/dsr/model/dsr-rcache.h
src/dsr/model/dsr-routing.cc
src/dsr/model/dsr-routing.h
src/dsr/model/dsr-rreq-table.cc
src/dsr/model/dsr-rreq-table.h
src/dsr/model/dsr-rsendbuff.cc
--- a/src/dsr/examples/dsr.cc	Sun May 13 10:39:34 2012 -0700
+++ b/src/dsr/examples/dsr.cc	Sun May 13 10:47:11 2012 -0700
@@ -121,13 +121,13 @@
 
   YansWifiChannelHelper wifiChannel;
   wifiChannel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel");
-  wifiChannel.AddPropagationLoss("ns3::RangePropagationLossModel", "MaxRange", DoubleValue (txpDistance));
+  wifiChannel.AddPropagationLoss ("ns3::RangePropagationLossModel", "MaxRange", DoubleValue (txpDistance));
   wifiPhy.SetChannel (wifiChannel.Create ());
 
   // Add a non-QoS upper mac, and disable rate control
   NqosWifiMacHelper wifiMac = NqosWifiMacHelper::Default ();
   wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode", StringValue (dataMode), "ControlMode",
-      StringValue (phyMode));
+                                StringValue (phyMode));
 
   wifiMac.SetType ("ns3::AdhocWifiMac");
   allDevices = wifi.Install (wifiPhy, wifiMac, adhocNodes);
@@ -146,10 +146,10 @@
   Ptr<PositionAllocator> taPositionAlloc = pos.Create ()->GetObject<PositionAllocator> ();
 
   adhocMobility.SetMobilityModel ("ns3::RandomWaypointMobilityModel",
-      "Speed", RandomVariableValue (UniformVariable (0.0, nodeSpeed)),
-      "Pause", RandomVariableValue (ConstantVariable (pauseTime)),
-      "PositionAllocator", PointerValue (taPositionAlloc)
-      );
+                                  "Speed", RandomVariableValue (UniformVariable (0.0, nodeSpeed)),
+                                  "Pause", RandomVariableValue (ConstantVariable (pauseTime)),
+                                  "PositionAllocator", PointerValue (taPositionAlloc)
+                                  );
   adhocMobility.Install (adhocNodes);
 
   InternetStackHelper internet;
@@ -165,25 +165,25 @@
   allInterfaces = address.Assign (allDevices);
 
   uint16_t port = 9;
-  double randomStartTime = (1/ppers) / nSinks; //distributed btw 1s evenly as we are sending 4pkt/s
+  double randomStartTime = (1 / ppers) / nSinks; //distributed btw 1s evenly as we are sending 4pkt/s
 
   for (uint32_t i = 0; i < nSinks; ++i)
-  {
-    PacketSinkHelper sink ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), port));
-    ApplicationContainer apps_sink = sink.Install (adhocNodes.Get (i));
-    apps_sink.Start (Seconds (0.0));
-    apps_sink.Stop (Seconds (TotalTime));
+    {
+      PacketSinkHelper sink ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), port));
+      ApplicationContainer apps_sink = sink.Install (adhocNodes.Get (i));
+      apps_sink.Start (Seconds (0.0));
+      apps_sink.Stop (Seconds (TotalTime));
 
-    OnOffHelper onoff1 ("ns3::UdpSocketFactory", Address (InetSocketAddress (allInterfaces.GetAddress (i), port)));
-    onoff1.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
-    onoff1.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
-    onoff1.SetAttribute ("PacketSize", UintegerValue (packetSize));
-    onoff1.SetAttribute ("DataRate", DataRateValue (DataRate (rate)));
+      OnOffHelper onoff1 ("ns3::UdpSocketFactory", Address (InetSocketAddress (allInterfaces.GetAddress (i), port)));
+      onoff1.SetAttribute ("OnTime", RandomVariableValue (ConstantVariable (1)));
+      onoff1.SetAttribute ("OffTime", RandomVariableValue (ConstantVariable (0)));
+      onoff1.SetAttribute ("PacketSize", UintegerValue (packetSize));
+      onoff1.SetAttribute ("DataRate", DataRateValue (DataRate (rate)));
 
-    ApplicationContainer apps1 = onoff1.Install (adhocNodes.Get (i + nWifis - nSinks));
-    apps1.Start (Seconds (dataStart + i*randomStartTime));
-    apps1.Stop (Seconds (dataTime + i*randomStartTime));
-  }
+      ApplicationContainer apps1 = onoff1.Install (adhocNodes.Get (i + nWifis - nSinks));
+      apps1.Start (Seconds (dataStart + i * randomStartTime));
+      apps1.Stop (Seconds (dataTime + i * randomStartTime));
+    }
 
   NS_LOG_INFO ("Run Simulation.");
   Simulator::Stop (Seconds (TotalTime));
--- a/src/dsr/model/dsr-errorbuff.cc	Sun May 13 10:39:34 2012 -0700
+++ b/src/dsr/model/dsr-errorbuff.cc	Sun May 13 10:47:11 2012 -0700
@@ -56,7 +56,7 @@
        != m_errorBuffer.end (); ++i)
     {
       NS_LOG_INFO ("packet id " << i->GetPacket ()->GetUid () << " " << entry.GetPacket ()->GetUid () << " source " << i->GetSource () << " " << entry.GetSource ()
-                   << " next hop " << i->GetNextHop () << " " << entry.GetNextHop () << " dst " << i->GetDestination () << " " << entry.GetDestination ());
+                                << " next hop " << i->GetNextHop () << " " << entry.GetNextHop () << " dst " << i->GetDestination () << " " << entry.GetDestination ());
 
       if ((i->GetPacket ()->GetUid () == entry.GetPacket ()->GetUid ()) && (i->GetSource () == entry.GetSource ()) && (i->GetNextHop () == entry.GetSource ())
           && (i->GetDestination () == entry.GetDestination ()))
@@ -100,7 +100,7 @@
         }
     }
   m_errorBuffer.erase (std::remove_if (m_errorBuffer.begin (), m_errorBuffer.end (),
-                                      std::bind2nd (std::ptr_fun (ErrorBuffer::LinkEqual), link)), m_errorBuffer.end ());
+                                       std::bind2nd (std::ptr_fun (ErrorBuffer::LinkEqual), link)), m_errorBuffer.end ());
 }
 
 bool
@@ -169,7 +169,7 @@
         }
     }
   m_errorBuffer.erase (std::remove_if (m_errorBuffer.begin (), m_errorBuffer.end (), pred),
-                      m_errorBuffer.end ());
+                       m_errorBuffer.end ());
 }
 
 void
--- a/src/dsr/model/dsr-maintain-buff.cc	Sun May 13 10:39:34 2012 -0700
+++ b/src/dsr/model/dsr-maintain-buff.cc	Sun May 13 10:47:11 2012 -0700
@@ -56,8 +56,8 @@
        != m_maintainBuffer.end (); ++i)
     {
       NS_LOG_INFO ("nexthop " << i->GetNextHop () << " " << entry.GetNextHop () << " our add " << i->GetOurAdd () << " " << entry.GetOurAdd ()
-                   << " src " << i->GetSrc () << " " << entry.GetSrc () << " dst " << i->GetDst () << " " << entry.GetDst ()
-                   << " ackId " << i->GetAckId () << " " << entry.GetAckId () << " SegsLeft " << (uint32_t)i->GetSegsLeft () << " " << (uint32_t)entry.GetSegsLeft ()
+                              << " src " << i->GetSrc () << " " << entry.GetSrc () << " dst " << i->GetDst () << " " << entry.GetDst ()
+                              << " ackId " << i->GetAckId () << " " << entry.GetAckId () << " SegsLeft " << (uint32_t)i->GetSegsLeft () << " " << (uint32_t)entry.GetSegsLeft ()
                    );
 
       if ((i->GetNextHop () == entry.GetNextHop ()) && (i->GetOurAdd () == entry.GetOurAdd ()) && (i->GetSrc () == entry.GetSrc ())
@@ -75,7 +75,7 @@
       m_maintainBuffer.erase (m_maintainBuffer.begin ());        // Drop the most aged packet
     }
   m_maintainBuffer.push_back (entry);
-  NS_LOG_DEBUG ("The maintain size " << m_maintainBuffer.size());
+  NS_LOG_DEBUG ("The maintain size " << m_maintainBuffer.size ());
   return true;
 }
 
@@ -157,8 +157,8 @@
     {
 
       NS_LOG_DEBUG ("nexthop " << i->GetNextHop () << " " << entry.GetNextHop () << " our address " << i->GetOurAdd () << " " << entry.GetOurAdd ()
-                 << " src " << i->GetSrc () << " " << entry.GetSrc () << " dst " << i->GetDst () << " " << entry.GetDst ()
-                 << " ackId " << i->GetAckId () << " " << entry.GetAckId ());
+                               << " src " << i->GetSrc () << " " << entry.GetSrc () << " dst " << i->GetDst () << " " << entry.GetDst ()
+                               << " ackId " << i->GetAckId () << " " << entry.GetAckId ());
 
       if ((i->GetOurAdd () == entry.GetOurAdd ()) && (i->GetNextHop () == entry.GetNextHop ())
           && (i->GetSrc () == entry.GetSrc ()) && (i->GetDst () == entry.GetDst ())
@@ -179,8 +179,8 @@
     {
 
       NS_LOG_DEBUG ("nexthop " << i->GetNextHop () << " " << entry.GetNextHop () << " our address " << i->GetOurAdd () << " " << entry.GetOurAdd ()
-                 << " src " << i->GetSrc () << " " << entry.GetSrc () << " dst " << i->GetDst () << " " << entry.GetDst ()
-                 << " ackId " << i->GetAckId () << " " << entry.GetAckId ());
+                               << " src " << i->GetSrc () << " " << entry.GetSrc () << " dst " << i->GetDst () << " " << entry.GetDst ()
+                               << " ackId " << i->GetAckId () << " " << entry.GetAckId ());
 
       if ((i->GetOurAdd () == entry.GetOurAdd ()) && (i->GetNextHop () == entry.GetNextHop ())
           && (i->GetSrc () == entry.GetSrc ()) && (i->GetDst () == entry.GetDst ())
@@ -196,14 +196,14 @@
 bool
 MaintainBuffer::PromiscEqual (MaintainBuffEntry & entry)
 {
-  NS_LOG_DEBUG ("The maintenance buffer size " << m_maintainBuffer.size());
+  NS_LOG_DEBUG ("The maintenance buffer size " << m_maintainBuffer.size ());
   for (std::vector<MaintainBuffEntry>::iterator i = m_maintainBuffer.begin (); i
        != m_maintainBuffer.end (); ++i)
     {
       NS_LOG_DEBUG ("src " << i->GetSrc () << " " << entry.GetSrc () << " dst " << i->GetDst () << " " << entry.GetDst ()
-                 << " SegsLeft " << (uint32_t)i->GetSegsLeft () << " " << (uint32_t)entry.GetSegsLeft () << " ackId " << (uint32_t)i->GetAckId () << " "
-                 << (uint32_t)entry.GetAckId ()
-          );
+                           << " SegsLeft " << (uint32_t)i->GetSegsLeft () << " " << (uint32_t)entry.GetSegsLeft () << " ackId " << (uint32_t)i->GetAckId () << " "
+                           << (uint32_t)entry.GetAckId ()
+                    );
 
       if ((i->GetSrc () == entry.GetSrc ()) && (i->GetDst () == entry.GetDst ())
           && (i->GetSegsLeft () == entry.GetSegsLeft ()) && (i->GetAckId () == entry.GetAckId ())
--- a/src/dsr/model/dsr-network-queue.cc	Sun May 13 10:39:34 2012 -0700
+++ b/src/dsr/model/dsr-network-queue.cc	Sun May 13 10:47:11 2012 -0700
@@ -49,27 +49,29 @@
 DsrNetworkQueue::GetTypeID (void)
 {
   static TypeId tid = TypeId ("ns3::dsr::DsrNetworkQueue")
-      .SetParent<Object> ()
-      .AddConstructor<DsrNetworkQueue>  ()
-      ;
+    .SetParent<Object> ()
+    .AddConstructor<DsrNetworkQueue>  ()
+  ;
   return tid;
 }
 
-DsrNetworkQueue::DsrNetworkQueue (uint32_t maxLen, Time maxDelay) :
-    m_size(0), m_maxSize (maxLen), m_maxDelay (maxDelay)
+DsrNetworkQueue::DsrNetworkQueue (uint32_t maxLen, Time maxDelay)
+  : m_size (0),
+    m_maxSize (maxLen),
+    m_maxDelay (maxDelay)
 {
-  NS_LOG_FUNCTION(this );
+  NS_LOG_FUNCTION (this );
 }
 
-DsrNetworkQueue::DsrNetworkQueue () : m_size(0)
+DsrNetworkQueue::DsrNetworkQueue () : m_size (0)
 {
-  NS_LOG_FUNCTION(this );
+  NS_LOG_FUNCTION (this );
 }
 
 DsrNetworkQueue::~DsrNetworkQueue ()
 {
-  NS_LOG_FUNCTION(this );
-  Flush();
+  NS_LOG_FUNCTION (this );
+  Flush ();
 }
 
 void
@@ -101,9 +103,9 @@
 {
   NS_LOG_FUNCTION (this << m_size << m_maxSize);
   if (m_size >= m_maxSize)
-  {
-    return false;
-  }
+    {
+      return false;
+    }
   Time now = Simulator::Now ();
   entry.SetInsertedTimeStamp (now);
   m_dsrNetworkQueue.push_back (entry);
@@ -119,11 +121,11 @@
   Cleanup ();
   std::vector<DsrNetworkQueueEntry>::iterator i = m_dsrNetworkQueue.begin ();
   if (i == m_dsrNetworkQueue.end ())
-  {
-    // no elements in array
-    NS_LOG_DEBUG ("Does not find the queued packet in the network queue");
-    return false;
-  }
+    {
+      // no elements in array
+      NS_LOG_DEBUG ("Does not find the queued packet in the network queue");
+      return false;
+    }
   entry = *i;
   m_dsrNetworkQueue.erase (i);
   m_size--;
@@ -133,7 +135,7 @@
 void
 DsrNetworkQueue::Cleanup (void)
 {
-  NS_LOG_FUNCTION(this);
+  NS_LOG_FUNCTION (this);
   if (m_dsrNetworkQueue.empty ())
     {
       return;
@@ -141,9 +143,9 @@
 
   Time now = Simulator::Now ();
   uint32_t n = 0;
-  for (std::vector<DsrNetworkQueueEntry>::iterator i = m_dsrNetworkQueue.begin (); i != m_dsrNetworkQueue.end ();)
+  for (std::vector<DsrNetworkQueueEntry>::iterator i = m_dsrNetworkQueue.begin (); i != m_dsrNetworkQueue.end (); )
     {
-      if (i->GetInsertedTimeStamp() + m_maxDelay > now)
+      if (i->GetInsertedTimeStamp () + m_maxDelay > now)
         {
           i++;
         }
@@ -159,14 +161,14 @@
 uint32_t
 DsrNetworkQueue::GetSize ()
 {
-  NS_LOG_FUNCTION(this);
+  NS_LOG_FUNCTION (this);
   return m_size;
 }
 
 void
 DsrNetworkQueue::Flush (void)
 {
-  NS_LOG_FUNCTION(this);
+  NS_LOG_FUNCTION (this);
   m_dsrNetworkQueue.erase (m_dsrNetworkQueue.begin (), m_dsrNetworkQueue.end ());
   m_size = 0;
 }
--- a/src/dsr/model/dsr-network-queue.h	Sun May 13 10:39:34 2012 -0700
+++ b/src/dsr/model/dsr-network-queue.h	Sun May 13 10:47:11 2012 -0700
@@ -69,22 +69,52 @@
    */
   bool operator== (DsrNetworkQueueEntry const & o) const
   {
-    return ((m_packet == o.m_packet) && (m_srcAddr == o.m_srcAddr) && (m_nextHopAddr == o.m_nextHopAddr) &&
-            (tstamp == o.tstamp) && (m_ipv4Route == o.m_ipv4Route));
+    return ((m_packet == o.m_packet) && (m_srcAddr == o.m_srcAddr) && (m_nextHopAddr == o.m_nextHopAddr)
+            && (tstamp == o.tstamp) && (m_ipv4Route == o.m_ipv4Route));
   }
 
   ///\name Fields
   //\{
-  Ptr<const Packet> GetPacket () const { return m_packet; }
-  void SetPacket (Ptr<const Packet> p) { m_packet = p; }
-  Ptr<Ipv4Route> GetIpv4Route() const { return m_ipv4Route; }
-  void SetIpv4Route (Ptr<Ipv4Route> route) { m_ipv4Route = route; }
-  Ipv4Address GetSourceAddress() const { return m_srcAddr; }
-  void SetSourceAddress (Ipv4Address addr) { m_srcAddr = addr; }
-  Ipv4Address GetNextHopAddress() const { return m_nextHopAddr; }
-  void SetNextHopAddress (Ipv4Address addr) { m_nextHopAddr = addr; }
-  Time GetInsertedTimeStamp (void) const {return tstamp;}
-  void SetInsertedTimeStamp (Time time) {tstamp = time;}
+  Ptr<const Packet> GetPacket () const
+  {
+    return m_packet;
+  }
+  void SetPacket (Ptr<const Packet> p)
+  {
+    m_packet = p;
+  }
+  Ptr<Ipv4Route> GetIpv4Route () const
+  {
+    return m_ipv4Route;
+  }
+  void SetIpv4Route (Ptr<Ipv4Route> route)
+  {
+    m_ipv4Route = route;
+  }
+  Ipv4Address GetSourceAddress () const
+  {
+    return m_srcAddr;
+  }
+  void SetSourceAddress (Ipv4Address addr)
+  {
+    m_srcAddr = addr;
+  }
+  Ipv4Address GetNextHopAddress () const
+  {
+    return m_nextHopAddr;
+  }
+  void SetNextHopAddress (Ipv4Address addr)
+  {
+    m_nextHopAddr = addr;
+  }
+  Time GetInsertedTimeStamp (void) const
+  {
+    return tstamp;
+  }
+  void SetInsertedTimeStamp (Time time)
+  {
+    tstamp = time;
+  }
   //\}
 private:
   /// Data packet
--- a/src/dsr/model/dsr-option-header.cc	Sun May 13 10:39:34 2012 -0700
+++ b/src/dsr/model/dsr-option-header.cc	Sun May 13 10:47:11 2012 -0700
@@ -798,7 +798,7 @@
 
 DsrOptionRerrUnreachHeader::DsrOptionRerrUnreachHeader ()
   :    m_reserved (0),
-       m_salvage (0)
+    m_salvage (0)
 {
   SetType (3);
   SetLength (18);
--- a/src/dsr/model/dsr-options.cc	Sun May 13 10:39:34 2012 -0700
+++ b/src/dsr/model/dsr-options.cc	Sun May 13 10:47:11 2012 -0700
@@ -621,8 +621,8 @@
               bool addRoute = false;
               if (numberAddress > 0)
                 {
-                  RouteCacheEntry toSource (/*IP_VECTOR=*/m_finalRoute, /*dst=*/
-                                  dst, /*expire time=*/ActiveRouteTimeout);
+                  RouteCacheEntry toSource (/*IP_VECTOR=*/ m_finalRoute, /*dst=*/
+                                                           dst, /*expire time=*/ ActiveRouteTimeout);
                   if (dsr->IsLinkCache ())
                     {
                       addRoute = dsr->AddRoute_Link (m_finalRoute, ipv4Address);
@@ -984,7 +984,7 @@
       RouteCacheEntry toDestination (/*IP_VECTOR=*/ nodeList, /*dst=*/ dst, /*expire time=*/ ActiveRouteTimeout);
       NS_ASSERT (nodeList.front () == ipv4Address);
       bool addRoute = false;
-      if(dsr->IsLinkCache())
+      if (dsr->IsLinkCache ())
         {
           addRoute = dsr->AddRoute_Link (nodeList, ipv4Address);
         }
@@ -1051,7 +1051,7 @@
           RouteCacheEntry toDestination (/*IP_VECTOR=*/ cutRoute, /*dst=*/ dst, /*expire time=*/ ActiveRouteTimeout);
           NS_ASSERT (cutRoute.front () == ipv4Address);
           bool addRoute = false;
-          if(dsr->IsLinkCache())
+          if (dsr->IsLinkCache ())
             {
               addRoute = dsr->AddRoute_Link (nodeList, ipv4Address);
             }
@@ -1207,7 +1207,7 @@
       p->CopyData (data, size);
       uint8_t optionType = 0;
       optionType = *(data);
-      NS_LOG_DEBUG ("The packet size over here " << p->GetSize());
+      NS_LOG_DEBUG ("The packet size over here " << p->GetSize ());
 
       NS_LOG_DEBUG ("The option type over here " << (uint32_t)optionType);
       if (optionType == 160)
@@ -1289,7 +1289,7 @@
         }
       // Set the route and forward the data packet
       SetRoute (nextAddress, ipv4Address);
-      NS_LOG_DEBUG ("dsr packet size " << dsrP->GetSize());
+      NS_LOG_DEBUG ("dsr packet size " << dsrP->GetSize ());
       dsr->ForwardPacket (dsrP, newSourceRoute, ipv4Header, realSource, nextAddress, targetAddress, protocol, m_ipv4Route);
     }
   return sourceRoute.GetSerializedSize ();
--- a/src/dsr/model/dsr-rcache.cc	Sun May 13 10:39:34 2012 -0700
+++ b/src/dsr/model/dsr-rcache.cc	Sun May 13 10:47:11 2012 -0700
@@ -55,9 +55,9 @@
 bool CompareRoutesBoth (const RouteCacheEntry &a, const RouteCacheEntry &b)
 {
   // compare based on both with hop count considered priority
-  return (a.GetVector ().size () < b.GetVector ().size ()) ||
-      ((a.GetVector ().size () == b.GetVector ().size ()) && (a.GetExpireTime() > b.GetExpireTime()))
-      ;
+  return (a.GetVector ().size () < b.GetVector ().size ())
+         || ((a.GetVector ().size () == b.GetVector ().size ()) && (a.GetExpireTime () > b.GetExpireTime ()))
+  ;
 }
 
 bool CompareRoutesHops (const RouteCacheEntry &a, const RouteCacheEntry &b)
@@ -69,10 +69,10 @@
 bool CompareRoutesExpire (const RouteCacheEntry &a, const RouteCacheEntry &b)
 {
   // compare based on expire time
-  return a.GetExpireTime() > b.GetExpireTime();
+  return a.GetExpireTime () > b.GetExpireTime ();
 }
 
-void Link::Print() const
+void Link::Print () const
 {
   NS_LOG_DEBUG (m_low << "----" << m_high);
 }
@@ -206,7 +206,7 @@
 RouteCache::LookupRoute (Ipv4Address id, RouteCacheEntry & rt)
 {
   NS_LOG_FUNCTION (this << id);
-  if (IsLinkCache())
+  if (IsLinkCache ())
     {
       return LookupRoute_Link (id, rt);
     }
@@ -280,7 +280,7 @@
        */
       std::list<RouteCacheEntry> rtVector = m->second;
       rt = rtVector.front ();  // use the first entry in the route vector
-      NS_LOG_DEBUG ("Route to " << id << " with route size " << rtVector.size());
+      NS_LOG_DEBUG ("Route to " << id << " with route size " << rtVector.size ());
       return true;
     }
 }
@@ -290,9 +290,13 @@
 {
   NS_LOG_FUNCTION (this << type);
   if (type == std::string ("LinkCache"))
-    m_isLinkCache = true;
+    {
+      m_isLinkCache = true;
+    }
   else if (type == std::string ("PathCache"))
-    m_isLinkCache = false;
+    {
+      m_isLinkCache = false;
+    }
   else
     {
       m_isLinkCache = false;             // use path cache as default
@@ -340,63 +344,63 @@
   double temp = MAXWEIGHT;
   Ipv4Address tempip = Ipv4Address ("255.255.255.255");
   for (uint32_t i = 0; i < m_netGraph.size (); i++)
-  {
-    temp = MAXWEIGHT;
-    for (std::map<Ipv4Address,uint32_t>::const_iterator j = d.begin (); j != d.end (); ++j)
-      {
-        Ipv4Address ip = j->first;
-        if (s.find (ip) == s.end ())
-          {
-            /**
-             * \brief The followings are for comparison
-             */
-            if (j->second <= temp)
-              {
-                temp = j->second;
-                tempip = ip;
-              }
-          }
-      }
-    if (!tempip.IsBroadcast ())
     {
-      s[tempip] = true;
-      for (std::map<Ipv4Address, uint32_t>::const_iterator k = m_netGraph[tempip].begin (); k != m_netGraph[tempip].end (); ++k)
-      {
-        if (s.find (k->first) == s.end () && d[k->first] > d[tempip] + k->second)
-          {
-            d[k->first] = d[tempip] + k->second;
-            pre[k->first] = tempip;
-          }
-        /**
-         *  Selects the shortest-length route that has the longest expected lifetime
-         *  (highest minimum timeout of any link in the route)
-         *  For the computation overhead and complexity
-         *  Here I just implement kind of greedy strategy to select link with the longest expected lifetime when there is two options
-         */
-        else if (d[k->first] == d[tempip] + k->second)
+      temp = MAXWEIGHT;
+      for (std::map<Ipv4Address,uint32_t>::const_iterator j = d.begin (); j != d.end (); ++j)
         {
-          std::map<Link, LinkStab>::iterator oldlink = m_linkCache.find (Link (k->first, pre[k->first]));
-          std::map<Link, LinkStab>::iterator newlink = m_linkCache.find (Link (k->first, tempip));
-          if (oldlink != m_linkCache.end () && newlink != m_linkCache.end ())
+          Ipv4Address ip = j->first;
+          if (s.find (ip) == s.end ())
             {
-              if (oldlink->second.GetLinkStability () < newlink->second.GetLinkStability ())
+              /**
+               * \brief The followings are for comparison
+               */
+              if (j->second <= temp)
                 {
-                  NS_LOG_INFO ("Select the link with longest expected lifetime");
+                  temp = j->second;
+                  tempip = ip;
+                }
+            }
+        }
+      if (!tempip.IsBroadcast ())
+        {
+          s[tempip] = true;
+          for (std::map<Ipv4Address, uint32_t>::const_iterator k = m_netGraph[tempip].begin (); k != m_netGraph[tempip].end (); ++k)
+            {
+              if (s.find (k->first) == s.end () && d[k->first] > d[tempip] + k->second)
+                {
                   d[k->first] = d[tempip] + k->second;
                   pre[k->first] = tempip;
                 }
-            }
-          else
-            {
-              NS_LOG_INFO ("Link Stability Info Corrupt");
+              /**
+               *  Selects the shortest-length route that has the longest expected lifetime
+               *  (highest minimum timeout of any link in the route)
+               *  For the computation overhead and complexity
+               *  Here I just implement kind of greedy strategy to select link with the longest expected lifetime when there is two options
+               */
+              else if (d[k->first] == d[tempip] + k->second)
+                {
+                  std::map<Link, LinkStab>::iterator oldlink = m_linkCache.find (Link (k->first, pre[k->first]));
+                  std::map<Link, LinkStab>::iterator newlink = m_linkCache.find (Link (k->first, tempip));
+                  if (oldlink != m_linkCache.end () && newlink != m_linkCache.end ())
+                    {
+                      if (oldlink->second.GetLinkStability () < newlink->second.GetLinkStability ())
+                        {
+                          NS_LOG_INFO ("Select the link with longest expected lifetime");
+                          d[k->first] = d[tempip] + k->second;
+                          pre[k->first] = tempip;
+                        }
+                    }
+                  else
+                    {
+                      NS_LOG_INFO ("Link Stability Info Corrupt");
+                    }
+                }
             }
         }
-      }
     }
-  }
   // clean the best route table
   m_bestRoutesTable_link.clear ();
-  for(std::map<Ipv4Address, Ipv4Address>::iterator i = pre.begin (); i != pre.end (); ++i)
+  for (std::map<Ipv4Address, Ipv4Address>::iterator i = pre.begin (); i != pre.end (); ++i)
     {
       // loop for all vertexes
       RouteCacheEntry::IP_VECTOR route;
@@ -414,7 +418,7 @@
            * \brief Reverse the route
            */
           RouteCacheEntry::IP_VECTOR reverseroute;
-          for(RouteCacheEntry::IP_VECTOR::reverse_iterator j = route.rbegin (); j!= route.rend (); ++j)
+          for (RouteCacheEntry::IP_VECTOR::reverse_iterator j = route.rbegin (); j != route.rend (); ++j)
             {
               reverseroute.push_back (*j);
             }
@@ -432,7 +436,7 @@
   std::map<Ipv4Address, RouteCacheEntry::IP_VECTOR>::const_iterator i = m_bestRoutesTable_link.find (id);
   if (i == m_bestRoutesTable_link.end ())
     {
-      NS_LOG_INFO("No Route To " << id);
+      NS_LOG_INFO ("No Route To " << id);
       return false;
     }
   else
@@ -459,10 +463,10 @@
 RouteCache::PurgeLinkNode ()
 {
   NS_LOG_FUNCTION (this);
-  NS_LOG_DEBUG ("The size of the link cache before " << m_linkCache.size());
-  for (std::map<Link, LinkStab>::iterator i = m_linkCache.begin (); i != m_linkCache.end ();)
+  NS_LOG_DEBUG ("The size of the link cache before " << m_linkCache.size ());
+  for (std::map<Link, LinkStab>::iterator i = m_linkCache.begin (); i != m_linkCache.end (); )
     {
-      NS_LOG_DEBUG ("The link stability " << i->second.GetLinkStability());
+      NS_LOG_DEBUG ("The link stability " << i->second.GetLinkStability ());
       std::map<Link, LinkStab>::iterator itmp = i;
       if (i->second.GetLinkStability () <= Seconds (0))
         {
@@ -474,8 +478,8 @@
           ++i;
         }
     }
-  NS_LOG_DEBUG ("The size of the node cache before " << m_nodeCache.size());
-  for (std::map<Ipv4Address, NodeStab>::iterator i = m_nodeCache.begin (); i != m_nodeCache.end ();)
+  NS_LOG_DEBUG ("The size of the node cache before " << m_nodeCache.size ());
+  for (std::map<Ipv4Address, NodeStab>::iterator i = m_nodeCache.begin (); i != m_nodeCache.end (); )
     {
       NS_LOG_DEBUG ("The node stability " << i->second.GetNodeStability ());
       std::map<Ipv4Address, NodeStab>::iterator itmp = i;
@@ -496,7 +500,7 @@
 {
   NS_LOG_FUNCTION (this);
   m_netGraph.clear ();
-  for(std::map<Link, LinkStab>::iterator i = m_linkCache.begin (); i != m_linkCache.end (); ++i)
+  for (std::map<Link, LinkStab>::iterator i = m_linkCache.begin (); i != m_linkCache.end (); ++i)
     {
       // Here the weight is set as 1
       uint32_t weight = 1;
@@ -560,20 +564,20 @@
         {
           m_nodeCache[nodelist[i]] = ns;
         }
-      if (m_nodeCache.find (nodelist[i+1]) == m_nodeCache.end ())
+      if (m_nodeCache.find (nodelist[i + 1]) == m_nodeCache.end ())
         {
-          m_nodeCache[nodelist[i+1]] = ns;
+          m_nodeCache[nodelist[i + 1]] = ns;
         }
-      Link link (nodelist[i], nodelist[i+1]);
+      Link link (nodelist[i], nodelist[i + 1]);
       LinkStab stab;
       stab.SetLinkStability (m_initStability);
-      if (m_nodeCache[nodelist[i]].GetNodeStability () < m_nodeCache[nodelist[i+1]].GetNodeStability ())
+      if (m_nodeCache[nodelist[i]].GetNodeStability () < m_nodeCache[nodelist[i + 1]].GetNodeStability ())
         {
           stab.SetLinkStability (m_nodeCache[nodelist[i]].GetNodeStability ());
         }
       else
         {
-          stab.SetLinkStability (m_nodeCache[nodelist[i+1]].GetNodeStability ());
+          stab.SetLinkStability (m_nodeCache[nodelist[i + 1]].GetNodeStability ());
         }
       if (stab.GetLinkStability () < m_minLifeTime)
         {
@@ -602,7 +606,7 @@
     }
   for (RouteCacheEntry::IP_VECTOR::iterator i = rt.begin (); i != rt.end () - 1; ++i)
     {
-      Link link (*i, *(i+1));
+      Link link (*i, *(i + 1));
       if (m_linkCache.find (link) != m_linkCache.end ())
         {
           if (m_linkCache[link].GetLinkStability () < m_useExtends)
@@ -684,10 +688,10 @@
               // This sort function will sort the route cache entries based on the size of route in each of the
               // route entries
               rtVector.sort (CompareRoutesExpire);
-              NS_LOG_DEBUG ("The first time" << rtVector.front().GetExpireTime().GetSeconds() << " The second time "
-                  << rtVector.back ().GetExpireTime ().GetSeconds ());
+              NS_LOG_DEBUG ("The first time" << rtVector.front ().GetExpireTime ().GetSeconds () << " The second time "
+                                             << rtVector.back ().GetExpireTime ().GetSeconds ());
               NS_LOG_DEBUG ("The first hop" << rtVector.front ().GetVector ().size () << " The second hop "
-                  << rtVector.back ().GetVector ().size ());
+                                            << rtVector.back ().GetVector ().size ());
               m_sortedRoutes.erase (dst);               // erase the route entries for dst first
               /**
                * Save the new route cache along with the destination address in map
@@ -717,9 +721,9 @@
       if (routeVector == newVector)
         {
           NS_LOG_DEBUG ("Found same routes in the route cache with the vector size "
-              << rt.GetDestination() << " " << rtVector.size());
-          NS_LOG_DEBUG ("The new route expire time " << rt.GetExpireTime().GetSeconds()
-              << " the original expire time " << i->GetExpireTime().GetSeconds());
+                        << rt.GetDestination () << " " << rtVector.size ());
+          NS_LOG_DEBUG ("The new route expire time " << rt.GetExpireTime ().GetSeconds ()
+                                                     << " the original expire time " << i->GetExpireTime ().GetSeconds ());
           if (rt.GetExpireTime () > i->GetExpireTime ())
             {
               i->SetExpireTime (rt.GetExpireTime ());
@@ -755,7 +759,7 @@
 RouteCache::DeleteAllRoutesIncludeLink (Ipv4Address errorSrc, Ipv4Address unreachNode, Ipv4Address node)
 {
   NS_LOG_FUNCTION (this << errorSrc << unreachNode << node);
-  if(IsLinkCache ())
+  if (IsLinkCache ())
     {
       /*
        * The followings are for cleaning the broken link in linkcache
@@ -886,8 +890,10 @@
             }
           ++j;
           if (!IsLinkCache ())
-            m_sortedRoutes.erase (jtmp);
-          if (rtVector.size())
+            {
+              m_sortedRoutes.erase (jtmp);
+            }
+          if (rtVector.size ())
             {
               /*
                * Save the new route cache along with the destination address in map
@@ -930,7 +936,7 @@
   NS_LOG_FUNCTION (this);
   for (std::list<RouteCacheEntry>::iterator i = route.begin (); i != route.end (); i++)
     {
-      std::vector<Ipv4Address> path = i->GetVector();
+      std::vector<Ipv4Address> path = i->GetVector ();
       NS_LOG_INFO ("Route NO. ");
       PrintVector (path);
     }
@@ -947,7 +953,7 @@
       return;
     }
   for (std::map<Ipv4Address, std::list<RouteCacheEntry> >::iterator i =
-          m_sortedRoutes.begin (); i != m_sortedRoutes.end (); )
+         m_sortedRoutes.begin (); i != m_sortedRoutes.end (); )
     {
       // Loop of route cache entry with the route size
       std::map<Ipv4Address, std::list<RouteCacheEntry> >::iterator itmp = i;
@@ -956,7 +962,7 @@
        */
       Ipv4Address dst = i->first;
       std::list<RouteCacheEntry> rtVector = i->second;
-      NS_LOG_DEBUG ("The route vector size of 1 " << dst << " " << rtVector.size());
+      NS_LOG_DEBUG ("The route vector size of 1 " << dst << " " << rtVector.size ());
       if (rtVector.size ())
         {
           for (std::list<RouteCacheEntry>::iterator j = rtVector.begin (); j != rtVector.end (); )
@@ -978,7 +984,7 @@
                   ++j;
                 }
             }
-          NS_LOG_DEBUG ("The route vector size of 2 " << dst << " " << rtVector.size());
+          NS_LOG_DEBUG ("The route vector size of 2 " << dst << " " << rtVector.size ());
           if (rtVector.size ())
             {
               ++i;
@@ -986,7 +992,7 @@
               /*
                * Save the new route cache along with the destination address in map
                */
-                m_sortedRoutes.insert (std::make_pair (dst, rtVector));
+              m_sortedRoutes.insert (std::make_pair (dst, rtVector));
             }
           else
             {
--- a/src/dsr/model/dsr-rcache.h	Sun May 13 10:39:34 2012 -0700
+++ b/src/dsr/model/dsr-rcache.h	Sun May 13 10:47:11 2012 -0700
@@ -88,27 +88,33 @@
   Ipv4Address m_low;
   Ipv4Address m_high;
   Link (Ipv4Address ip1, Ipv4Address ip2)
-    {
-      if (ip1 < ip2)
-        {
-          m_low = ip1;
-          m_high = ip2;
-        }
-      else
-        {
-          m_low = ip2;
-          m_high = ip1;
-        }
-    }
+  {
+    if (ip1 < ip2)
+      {
+        m_low = ip1;
+        m_high = ip2;
+      }
+    else
+      {
+        m_low = ip2;
+        m_high = ip1;
+      }
+  }
   bool operator < (Link const& L) const
-    {
-      if (m_low < L.m_low)
+  {
+    if (m_low < L.m_low)
+      {
         return true;
-      else if (m_low == L.m_low)
+      }
+    else if (m_low == L.m_low)
+      {
         return (m_high < L.m_high);
-      else
+      }
+    else
+      {
         return false;
-    }
+      }
+  }
   void Print () const;
 };
 
@@ -238,30 +244,30 @@
   bool operator== (RouteCacheEntry const & o) const
   {
     if (m_path.size () != o.m_path.size ())
-    {
-      NS_ASSERT (false);
-      return false;
-    }
+      {
+        NS_ASSERT (false);
+        return false;
+      }
     IP_VECTOR::const_iterator j = o.m_path.begin ();
     for (IP_VECTOR::const_iterator i = m_path.begin (); i
          != m_path.end (); i++, j++)
-    {
-      /*
-       * Verify if neither the entry are not 0 and they equal to each other
-       */
-      if (((*i) == 0) || ((*j) == 0))
       {
-        return false;
+        /*
+         * Verify if neither the entry are not 0 and they equal to each other
+         */
+        if (((*i) == 0) || ((*j) == 0))
+          {
+            return false;
+          }
+        else if (!((*i) == (*j)) )
+          {
+            return false;
+          }
+        else
+          {
+            return true;
+          }
       }
-      else if (!((*i) == (*j)) )
-      {
-        return false;
-      }
-      else
-      {
-        return true;
-      }
-    }
     return false;
   }
   // \}
--- a/src/dsr/model/dsr-routing.cc	Sun May 13 10:39:34 2012 -0700
+++ b/src/dsr/model/dsr-routing.cc	Sun May 13 10:47:11 2012 -0700
@@ -359,7 +359,7 @@
         {
           // Use primary address, if multiple
           Ipv4Address addr = m_ipv4->GetAddress (i, 0).GetLocal ();
-          m_broadcast = m_ipv4->GetAddress (i, 0).GetBroadcast();
+          m_broadcast = m_ipv4->GetAddress (i, 0).GetBroadcast ();
           NS_LOG_DEBUG ("The addr " << addr);
           if (addr != loopback)
             {
@@ -387,18 +387,18 @@
               break;
             }
         }
-      NS_ASSERT (m_mainAddress != Ipv4Address () && m_broadcast != Ipv4Address());
+      NS_ASSERT (m_mainAddress != Ipv4Address () && m_broadcast != Ipv4Address ());
     }
 
   NS_LOG_DEBUG ("The number queues " << m_numPriorityQueues);
   for (uint32_t i = 0; i < m_numPriorityQueues; i++)
-  {
-    // Set the network queue max size and the delay
-    NS_LOG_DEBUG ("The network size " << m_maxNetworkSize << " and the network delay " << m_maxNetworkDelay.GetSeconds());
-    Ptr<dsr::DsrNetworkQueue> queue_i = CreateObject<dsr::DsrNetworkQueue> (m_maxNetworkSize,m_maxNetworkDelay);
-    std::pair<std::map<uint32_t, Ptr<dsr::DsrNetworkQueue> >::iterator, bool> result_i = m_priorityQueue.insert (std::make_pair (i, queue_i));
-    NS_ASSERT_MSG (result_i.second, "Error in creating queues");
-  }
+    {
+      // Set the network queue max size and the delay
+      NS_LOG_DEBUG ("The network size " << m_maxNetworkSize << " and the network delay " << m_maxNetworkDelay.GetSeconds ());
+      Ptr<dsr::DsrNetworkQueue> queue_i = CreateObject<dsr::DsrNetworkQueue> (m_maxNetworkSize,m_maxNetworkDelay);
+      std::pair<std::map<uint32_t, Ptr<dsr::DsrNetworkQueue> >::iterator, bool> result_i = m_priorityQueue.insert (std::make_pair (i, queue_i));
+      NS_ASSERT_MSG (result_i.second, "Error in creating queues");
+    }
   Ptr<dsr::RreqTable> rreqTable = CreateObject<dsr::RreqTable> ();
   // Set the initial hop limit
   rreqTable->SetInitHopLimit (m_discoveryHopLimit);
@@ -624,7 +624,7 @@
       Ptr<Ipv4> ipv4 = node->GetObject<Ipv4> ();
       if (ipv4->GetAddress (1, 0).GetLocal () == address)
         {
-          return uint16_t(i);
+          return uint16_t (i);
         }
     }
   return 256;
@@ -884,7 +884,7 @@
                   dsrRoutingHeader.SetMessageType (1);
                   dsrRoutingHeader.SetSourceId (GetIDfromIP (m_mainAddress));
                   dsrRoutingHeader.SetDestId (255);
-                  dsrRoutingHeader.SetPayloadLength (uint16_t(length) + 4);
+                  dsrRoutingHeader.SetPayloadLength (uint16_t (length) + 4);
                   dsrRoutingHeader.AddDsrOption (newUnreach);
                   dsrRoutingHeader.AddDsrOption (sourceRoute);
 
@@ -896,7 +896,7 @@
                   uint32_t priority = GetPriority (DSR_CONTROL_PACKET);
                   std::map<uint32_t, Ptr<dsr::DsrNetworkQueue> >::iterator i = m_priorityQueue.find (priority);
                   Ptr<dsr::DsrNetworkQueue> dsrNetworkQueue = i->second;
-                  NS_LOG_DEBUG("Will be inserting into priority queue " << dsrNetworkQueue << " number: " << priority);
+                  NS_LOG_DEBUG ("Will be inserting into priority queue " << dsrNetworkQueue << " number: " << priority);
 
                   DsrNetworkQueueEntry newEntry (newPacket, m_mainAddress, nextHop, Simulator::Now (), m_ipv4Route);
 
@@ -931,7 +931,7 @@
               sourceRoute.SetSalvage (salvage);
 
               uint8_t length = sourceRoute.GetLength ();
-              dsrRoutingHeader.SetPayloadLength (uint16_t(length) + 2);
+              dsrRoutingHeader.SetPayloadLength (uint16_t (length) + 2);
               dsrRoutingHeader.AddDsrOption (sourceRoute);
               cleanP->AddHeader (dsrRoutingHeader);
               // Send the data packet out before schedule the next packet transmission
@@ -939,8 +939,8 @@
               Ptr<const Packet> mtP = cleanP->Copy ();
               // Put the data packet in the maintenance queue for data packet retransmission
               MaintainBuffEntry newEntry (/*Packet=*/ mtP, /*Ipv4Address=*/ m_mainAddress, /*nextHop=*/ nextHop,
-                                          /*source=*/ m_mainAddress, /*destination=*/ destination, /*ackId=*/ 0,
-                                          /*SegsLeft=*/nodeList.size () - 2, /*expire time=*/ m_maxMaintainTime);
+                                                      /*source=*/ m_mainAddress, /*destination=*/ destination, /*ackId=*/ 0,
+                                                      /*SegsLeft=*/ nodeList.size () - 2, /*expire time=*/ m_maxMaintainTime);
               bool result = m_maintainBuffer.Enqueue (newEntry); // Enqueue the packet the the maintenance buffer
               if (result)
                 {
@@ -1113,7 +1113,7 @@
       sourceRoute.SetSalvage (salvage);
 
       uint8_t length = sourceRoute.GetLength ();
-      dsrRoutingHeader.SetPayloadLength (uint16_t(length) + 2);
+      dsrRoutingHeader.SetPayloadLength (uint16_t (length) + 2);
       dsrRoutingHeader.AddDsrOption (sourceRoute);
       cleanP->AddHeader (dsrRoutingHeader);
       // Send the data packet out before schedule the next packet transmission
@@ -1123,7 +1123,7 @@
       // Put the data packet in the maintenance queue for data packet retransmission
       MaintainBuffEntry newEntry (/*Packet=*/ mtP, /*Ipv4Address=*/ m_mainAddress, /*nextHop=*/ nextHop,
                                               /*source=*/ source, /*destination=*/ destination, /*ackId=*/ 0,
-                                              /*SegsLeft=*/nodeList.size () - 2, /*expire time=*/ m_maxMaintainTime);
+                                              /*SegsLeft=*/ nodeList.size () - 2, /*expire time=*/ m_maxMaintainTime);
       bool result = m_maintainBuffer.Enqueue (newEntry);     // Enqueue the packet the the maintenance buffer
 
       if (result)
@@ -1226,7 +1226,7 @@
       uint8_t srLength = sourceRoute.GetLength ();
       uint8_t length = (srLength + rerrLength);
 
-      dsrRoutingHeader.SetPayloadLength (uint16_t(length) + 4);
+      dsrRoutingHeader.SetPayloadLength (uint16_t (length) + 4);
       dsrRoutingHeader.AddDsrOption (rerrUnreachHeader);
       dsrRoutingHeader.AddDsrOption (sourceRoute);
       newPacket->AddHeader (dsrRoutingHeader);
@@ -1234,12 +1234,12 @@
       SetRoute (nextHop, m_mainAddress);
       Ptr<NetDevice> dev = m_ip->GetNetDevice (m_ip->GetInterfaceForAddress (m_mainAddress));
       m_ipv4Route->SetOutputDevice (dev);
-      NS_LOG_INFO ("Send the packet to the next hop address " << nextHop << " from " << m_mainAddress << " with the size " << newPacket->GetSize());
+      NS_LOG_INFO ("Send the packet to the next hop address " << nextHop << " from " << m_mainAddress << " with the size " << newPacket->GetSize ());
 
       uint32_t priority = GetPriority (DSR_CONTROL_PACKET);
       std::map<uint32_t, Ptr<dsr::DsrNetworkQueue> >::iterator i = m_priorityQueue.find (priority);
       Ptr<dsr::DsrNetworkQueue> dsrNetworkQueue = i->second;
-      NS_LOG_DEBUG("Will be inserting into priority queue " << dsrNetworkQueue << " number: " << priority);
+      NS_LOG_DEBUG ("Will be inserting into priority queue " << dsrNetworkQueue << " number: " << priority);
 
       DsrNetworkQueueEntry newEntry (newPacket, m_mainAddress, nextHop, Simulator::Now (), m_ipv4Route);
 
@@ -1270,7 +1270,7 @@
   dsrRoutingHeader.SetDestId (GetIDfromIP (rerr.GetErrorDst ()));
 
   uint8_t length = (sourceRoute.GetLength () + rerr.GetLength ());
-  dsrRoutingHeader.SetPayloadLength (uint16_t(length) + 4);
+  dsrRoutingHeader.SetPayloadLength (uint16_t (length) + 4);
   dsrRoutingHeader.AddDsrOption (rerr);
   dsrRoutingHeader.AddDsrOption (sourceRoute);
   Ptr<Packet> packet = Create<Packet> ();
@@ -1281,9 +1281,9 @@
   uint32_t priority = GetPriority (DSR_CONTROL_PACKET);
   std::map<uint32_t, Ptr<dsr::DsrNetworkQueue> >::iterator i = m_priorityQueue.find (priority);
   Ptr<dsr::DsrNetworkQueue> dsrNetworkQueue = i->second;
-  NS_LOG_DEBUG("Will be inserting into priority queue " << dsrNetworkQueue << " number: " << priority);
+  NS_LOG_DEBUG ("Will be inserting into priority queue " << dsrNetworkQueue << " number: " << priority);
 
-   DsrNetworkQueueEntry newEntry (packet, m_mainAddress, nextHop, Simulator::Now (), route);
+  DsrNetworkQueueEntry newEntry (packet, m_mainAddress, nextHop, Simulator::Now (), route);
 
   if (dsrNetworkQueue->Enqueue (newEntry))
     {
@@ -1371,18 +1371,18 @@
 
           uint8_t length = sourceRoute.GetLength ();
 
-          dsrRoutingHeader.SetPayloadLength (uint16_t(length) + 2);
+          dsrRoutingHeader.SetPayloadLength (uint16_t (length) + 2);
           dsrRoutingHeader.AddDsrOption (sourceRoute);
           cleanP->AddHeader (dsrRoutingHeader);
           // Send the data packet out before schedule the next packet transmission
           SendPacket (cleanP, source, nextHop, protocol);
 
           Ptr<const Packet> mtP = cleanP->Copy ();
-          NS_LOG_DEBUG ("maintain packet size " << cleanP->GetSize());
+          NS_LOG_DEBUG ("maintain packet size " << cleanP->GetSize ());
           // Put the data packet in the maintenance queue for data packet retransmission
           MaintainBuffEntry newEntry (/*Packet=*/ mtP, /*ourAddress=*/ m_mainAddress, /*nextHop=*/ nextHop,
-                                      /*source=*/ source, /*destination=*/ destination, /*ackId=*/ 0,
-                                      /*SegsLeft=*/nodeList.size () - 2, /*expire time=*/ m_maxMaintainTime);
+                                                  /*source=*/ source, /*destination=*/ destination, /*ackId=*/ 0,
+                                                  /*SegsLeft=*/ nodeList.size () - 2, /*expire time=*/ m_maxMaintainTime);
           bool result = m_maintainBuffer.Enqueue (newEntry);       // Enqueue the packet the the maintenance buffer
           if (result)
             {
@@ -1473,7 +1473,7 @@
   uint32_t priority = GetPriority (DSR_DATA_PACKET);
   std::map<uint32_t, Ptr<dsr::DsrNetworkQueue> >::iterator i = m_priorityQueue.find (priority);
   Ptr<dsr::DsrNetworkQueue> dsrNetworkQueue = i->second;
-  NS_LOG_DEBUG("Will be inserting into priority queue " << dsrNetworkQueue << " number: " << priority);
+  NS_LOG_DEBUG ("Will be inserting into priority queue " << dsrNetworkQueue << " number: " << priority);
 
   DsrNetworkQueueEntry newEntry (packet, source, nextHop, Simulator::Now (), m_ipv4Route);
 
@@ -1510,61 +1510,61 @@
     }
   // priorities range from 0 to m_numPriorityQueues, with 0 as the highest priority
   for (uint32_t i = priority; numPriorities < m_numPriorityQueues; numPriorities++)
-  {
-    std::map<uint32_t, Ptr<DsrNetworkQueue> >::iterator q = m_priorityQueue.find (i);
-    Ptr<dsr::DsrNetworkQueue> dsrNetworkQueue = q->second;
-    uint32_t queueSize = dsrNetworkQueue->GetSize ();
-    if (queueSize == 0)
     {
-      if ((i == (m_numPriorityQueues - 1)) && continueWithFirst)
-      {
-        i = 0;
-      }
+      std::map<uint32_t, Ptr<DsrNetworkQueue> >::iterator q = m_priorityQueue.find (i);
+      Ptr<dsr::DsrNetworkQueue> dsrNetworkQueue = q->second;
+      uint32_t queueSize = dsrNetworkQueue->GetSize ();
+      if (queueSize == 0)
+        {
+          if ((i == (m_numPriorityQueues - 1)) && continueWithFirst)
+            {
+              i = 0;
+            }
+          else
+            {
+              i++;
+            }
+        }
       else
-      {
-        i++;
-      }
-    }
-    else
-    {
-      uint32_t totalQueueSize;
-      for (std::map<uint32_t, Ptr<dsr::DsrNetworkQueue> >::iterator j = m_priorityQueue.begin (); j != m_priorityQueue.end (); j++)
-        {
-          NS_LOG_DEBUG ("The size of the network queue for " << j->first << " is " << j->second->GetSize());
-          totalQueueSize += j->second->GetSize ();
-          NS_LOG_DEBUG ("And the total size is " << totalQueueSize);
-        }
-      if (totalQueueSize > 5)
         {
-          // Here the queue size is larger than 5, we need to increase the retransmission timer for each packet in the network queue
-          IncreaseRetransTimer ();
+          uint32_t totalQueueSize;
+          for (std::map<uint32_t, Ptr<dsr::DsrNetworkQueue> >::iterator j = m_priorityQueue.begin (); j != m_priorityQueue.end (); j++)
+            {
+              NS_LOG_DEBUG ("The size of the network queue for " << j->first << " is " << j->second->GetSize ());
+              totalQueueSize += j->second->GetSize ();
+              NS_LOG_DEBUG ("And the total size is " << totalQueueSize);
+            }
+          if (totalQueueSize > 5)
+            {
+              // Here the queue size is larger than 5, we need to increase the retransmission timer for each packet in the network queue
+              IncreaseRetransTimer ();
+            }
+          DsrNetworkQueueEntry newEntry;
+          dsrNetworkQueue->Dequeue (newEntry);
+          if (SendRealDown (newEntry))
+            {
+              NS_LOG_DEBUG ("Packet sent by Dsr. Calling PriorityScheduler after some time");
+              //packet was successfully sent down. call scheduler after some time
+              Simulator::Schedule (MicroSeconds (UniformVariable ().GetInteger (0, 1000)),
+                                   &DsrRouting::PriorityScheduler,this, i, false);
+            }
+          else
+            {
+              // packet was dropped by Dsr. Call scheduler immediately so that we can
+              // send another packet immediately.
+              NS_LOG_DEBUG ("Packet dropped by Dsr. Calling PriorityScheduler immediately");
+              Simulator::Schedule (Seconds (0), &DsrRouting::PriorityScheduler, this, i, false);
+            }
+          if ((i == (m_numPriorityQueues - 1)) && continueWithFirst)
+            {
+              i = 0;
+            }
+          else
+            {
+              i++;
+            }
         }
-      DsrNetworkQueueEntry newEntry;
-      dsrNetworkQueue->Dequeue (newEntry);
-      if (SendRealDown (newEntry))
-      {
-        NS_LOG_DEBUG("Packet sent by Dsr. Calling PriorityScheduler after some time");
-        //packet was successfully sent down. call scheduler after some time
-        Simulator::Schedule (MicroSeconds (UniformVariable ().GetInteger (0, 1000)),
-            &DsrRouting::PriorityScheduler,this, i, false);
-      }
-      else
-      {
-        // packet was dropped by Dsr. Call scheduler immediately so that we can
-        // send another packet immediately.
-        NS_LOG_DEBUG("Packet dropped by Dsr. Calling PriorityScheduler immediately");
-        Simulator::Schedule (Seconds (0), &DsrRouting::PriorityScheduler, this, i, false);
-      }
-      if ((i == (m_numPriorityQueues - 1)) && continueWithFirst)
-      {
-        i = 0;
-      }
-      else
-      {
-        i++;
-      }
     }
-  }
 }
 
 void
@@ -1584,7 +1584,7 @@
         {
           if (nextHop == j->first.m_nextHop)
             {
-              NS_LOG_DEBUG ("The network delay left is " << j->second.GetDelayLeft());
+              NS_LOG_DEBUG ("The network delay left is " << j->second.GetDelayLeft ());
               j->second.SetDelay (j->second.GetDelayLeft () + m_retransIncr);
               NS_LOG_DEBUG ("The new network delay time is " << j->second.GetDelayLeft ());
             }
@@ -1600,7 +1600,7 @@
   Ipv4Address nextHop = newEntry.GetNextHopAddress ();
   Ptr<Packet> packet = newEntry.GetPacket ()->Copy ();
   Ptr<Ipv4Route> route = newEntry.GetIpv4Route ();
-  m_downTarget (packet, source, nextHop, GetProtocolNumber(), route);
+  m_downTarget (packet, source, nextHop, GetProtocolNumber (), route);
   return true;
 }
 
@@ -1638,7 +1638,7 @@
           dsrRoutingHeader.SetDestId (GetIDfromIP (destination));
 
           uint8_t length = sourceRoute.GetLength ();
-          dsrRoutingHeader.SetPayloadLength (uint16_t(length) + 2);
+          dsrRoutingHeader.SetPayloadLength (uint16_t (length) + 2);
           dsrRoutingHeader.AddDsrOption (sourceRoute);
 
           p->AddHeader (dsrRoutingHeader);
@@ -1650,7 +1650,7 @@
           // Put the data packet in the maintenance queue for data packet retransmission
           MaintainBuffEntry newEntry (/*Packet=*/ mtP, /*ourAddress=*/ m_mainAddress, /*nextHop=*/ nextHop,
                                                   /*source=*/ source, /*destination=*/ destination, /*ackId=*/ 0,
-                                                  /*SegsLeft=*/nodeList.size () - 2, /*expire time=*/ m_maxMaintainTime);
+                                                  /*SegsLeft=*/ nodeList.size () - 2, /*expire time=*/ m_maxMaintainTime);
           bool result = m_maintainBuffer.Enqueue (newEntry);       // Enqueue the packet the the maintenance buffer
 
           if (result)
@@ -1750,7 +1750,7 @@
                   newRoutingHeader.SetMessageType (1);
                   newRoutingHeader.SetSourceId (GetIDfromIP (rerr.GetErrorSrc ()));
                   newRoutingHeader.SetDestId (GetIDfromIP (rerr.GetErrorDst ()));
-                  newRoutingHeader.SetPayloadLength (uint16_t(length) + 4);
+                  newRoutingHeader.SetPayloadLength (uint16_t (length) + 4);
                   newRoutingHeader.AddDsrOption (newUnreach);
                   newRoutingHeader.AddDsrOption (sourceRoute);
                   if (m_routeCache->IsLinkCache ())
@@ -1766,7 +1766,7 @@
                   uint32_t priority = GetPriority (DSR_CONTROL_PACKET);
                   std::map<uint32_t, Ptr<dsr::DsrNetworkQueue> >::iterator i = m_priorityQueue.find (priority);
                   Ptr<dsr::DsrNetworkQueue> dsrNetworkQueue = i->second;
-                  NS_LOG_DEBUG("Will be inserting into priority queue " << dsrNetworkQueue << " number: " << priority);
+                  NS_LOG_DEBUG ("Will be inserting into priority queue " << dsrNetworkQueue << " number: " << priority);
 
                   DsrNetworkQueueEntry newEntry (newPacket, m_mainAddress, nextHop, Simulator::Now (), m_ipv4Route);
 
@@ -1781,12 +1781,12 @@
                 }
             }
 
-        if (m_errorBuffer.GetSize () != 0 && m_errorBuffer.Find (destination))
-          {
-            NS_LOG_DEBUG ("Schedule sending the next packet in send buffer");
-            Simulator::Schedule (MilliSeconds (UniformVariable ().GetInteger (0,100)),
-                                 &DsrRouting::SendPacketFromBuffer,this,sourceRoute,nextHop,protocol);
-          }
+          if (m_errorBuffer.GetSize () != 0 && m_errorBuffer.Find (destination))
+            {
+              NS_LOG_DEBUG ("Schedule sending the next packet in send buffer");
+              Simulator::Schedule (MilliSeconds (UniformVariable ().GetInteger (0,100)),
+                                   &DsrRouting::SendPacketFromBuffer,this,sourceRoute,nextHop,protocol);
+            }
         }
     }
   else
@@ -1832,8 +1832,8 @@
    */
   Ptr<Packet> mainP = Create<Packet> ();
   MaintainBuffEntry newEntry (/*Packet=*/ mainP, /*ourAddress=*/ sender, /*nextHop=*/ receiver,
-                              /*source=*/ realSrc, /*destination=*/ realDst, /*ackId=*/ ackId,
-                              /*SegsLeft=*/0, /*expire time=*/ Simulator::Now ());
+                                          /*source=*/ realSrc, /*destination=*/ realDst, /*ackId=*/ ackId,
+                                          /*SegsLeft=*/ 0, /*expire time=*/ Simulator::Now ());
   CancelNetworkPacketTimer (newEntry);
 }
 
@@ -1856,10 +1856,10 @@
   NS_LOG_INFO ("ackId " << mb.GetAckId () << " ourAdd " << mb.GetOurAdd () << " nextHop " << mb.GetNextHop ()
                         << " source " << mb.GetSrc () << " destination " << mb.GetDst ()
                         << " segsLeft " << (uint32_t)mb.GetSegsLeft ()
-                        );
+               );
   // Find the network acknowledgment timer
   std::map<NetworkKey, Timer>::const_iterator i =
-      m_addressForwardTimer.find (networkKey);
+    m_addressForwardTimer.find (networkKey);
   if (i == m_addressForwardTimer.end ())
     {
       NS_LOG_INFO ("did not find the packet timer");
@@ -1879,12 +1879,12 @@
         }
       m_addressForwardTimer.erase (networkKey);
     }
-    // Erase the maintenance entry
-    // yet this does not check the segments left value here
-    if (m_maintainBuffer.NetworkEqual (mb))
-      {
-        NS_LOG_INFO ("Remove same maintenance buffer entry based on network acknowledgment");
-      }
+  // Erase the maintenance entry
+  // yet this does not check the segments left value here
+  if (m_maintainBuffer.NetworkEqual (mb))
+    {
+      NS_LOG_INFO ("Remove same maintenance buffer entry based on network acknowledgment");
+    }
 }
 
 void
@@ -1902,7 +1902,7 @@
 
   // Find the passive acknowledgment timer
   std::map<PassiveKey, Timer>::const_iterator j =
-      m_passiveAckTimer.find (passiveKey);
+    m_passiveAckTimer.find (passiveKey);
   if (j == m_passiveAckTimer.end ())
     {
       NS_LOG_INFO ("did not find the passive timer");
@@ -2013,7 +2013,7 @@
       uint8_t length = (sourceRoute.GetLength () + ackReq.GetLength ());
       NS_LOG_INFO ("length of source route header " << (uint32_t)(sourceRoute.GetLength ())
                                                     << " length of ack request header " << (uint32_t)(ackReq.GetLength ()));
-      newDsrRoutingHeader.SetPayloadLength (uint16_t(length) + 4);
+      newDsrRoutingHeader.SetPayloadLength (uint16_t (length) + 4);
       newDsrRoutingHeader.AddDsrOption (sourceRoute);
       newDsrRoutingHeader.AddDsrOption (ackReq);
       p->AddHeader (newDsrRoutingHeader);
@@ -2026,7 +2026,7 @@
       uint32_t priority = GetPriority (DSR_DATA_PACKET);
       std::map<uint32_t, Ptr<dsr::DsrNetworkQueue> >::iterator i = m_priorityQueue.find (priority);
       Ptr<dsr::DsrNetworkQueue> dsrNetworkQueue = i->second;
-      NS_LOG_DEBUG("Will be inserting into priority queue " << dsrNetworkQueue << " number: " << priority);
+      NS_LOG_DEBUG ("Will be inserting into priority queue " << dsrNetworkQueue << " number: " << priority);
 
       DsrNetworkQueueEntry newEntry (p, m_mainAddress, nextHop, Simulator::Now (), m_ipv4Route);
 
@@ -2119,8 +2119,8 @@
       m_addressForwardTimer[networkKey].SetFunction (&DsrRouting::NetworkScheduleTimerExpire, this);
       m_addressForwardTimer[networkKey].Remove ();
       m_addressForwardTimer[networkKey].SetArguments (newEntry, protocol);
-      NS_LOG_DEBUG ("The packet retries time for " << newEntry.GetAckId() << " is " << m_sendRetries
-          << " and the delay time is " << Time (2 * m_nodeTraversalTime));
+      NS_LOG_DEBUG ("The packet retries time for " << newEntry.GetAckId () << " is " << m_sendRetries
+                                                   << " and the delay time is " << Time (2 * m_nodeTraversalTime));
       // Back-off mechanism
       m_addressForwardTimer[networkKey].Schedule (Time (2 * m_nodeTraversalTime));
     }
@@ -2140,7 +2140,7 @@
       p = mb.GetPacket ()->Copy ();
       dsrP = mb.GetPacket ()->Copy ();
 
-      NS_LOG_DEBUG ("The packet with dsr header " << dsrP->GetSize());
+      NS_LOG_DEBUG ("The packet with dsr header " << dsrP->GetSize ());
       networkKey.m_ackId = mb.GetAckId ();
       networkKey.m_ourAdd = mb.GetOurAdd ();
       networkKey.m_nextHop = mb.GetNextHop ();
@@ -2162,8 +2162,8 @@
       m_addressForwardTimer[networkKey].SetFunction (&DsrRouting::NetworkScheduleTimerExpire, this);
       m_addressForwardTimer[networkKey].Remove ();
       m_addressForwardTimer[networkKey].SetArguments (mb, protocol);
-      NS_LOG_DEBUG ("The packet retries time for " << mb.GetAckId() << " is " << m_sendRetries
-          << " and the delay time is " << Time (2 * m_sendRetries *  m_nodeTraversalTime));
+      NS_LOG_DEBUG ("The packet retries time for " << mb.GetAckId () << " is " << m_sendRetries
+                                                   << " and the delay time is " << Time (2 * m_sendRetries *  m_nodeTraversalTime));
       // Back-off mechanism
       m_addressForwardTimer[networkKey].Schedule (Time (2 * m_sendRetries * m_nodeTraversalTime));
     }
@@ -2316,7 +2316,7 @@
   // We get the salvage value in sourceRoute header and set it to route error header if triggered error
   Ptr<Packet> p = packet->Copy ();
   uint8_t length = sourceRoute.GetLength ();
-  dsrRoutingHeader.SetPayloadLength (uint16_t(length) + 2);
+  dsrRoutingHeader.SetPayloadLength (uint16_t (length) + 2);
   dsrRoutingHeader.AddDsrOption (sourceRoute);
   p->AddHeader (dsrRoutingHeader);
 
@@ -2327,7 +2327,7 @@
 
   MaintainBuffEntry newEntry (/*Packet=*/ mtP, /*ourAddress=*/ m_mainAddress, /*nextHop=*/ nextHop,
                                           /*source=*/ source, /*destination=*/ targetAddress,
-                                          /*ackId=*/ m_ackId, /*SegsLeft=*/sourceRoute.GetSegmentsLeft(), /*expire time=*/ m_maxMaintainTime);
+                                          /*ackId=*/ m_ackId, /*SegsLeft=*/ sourceRoute.GetSegmentsLeft (), /*expire time=*/ m_maxMaintainTime);
   bool result = m_maintainBuffer.Enqueue (newEntry);
 
   if (result)
@@ -2386,7 +2386,7 @@
 
   dsrRoutingHeader.AddDsrOption (rreqHeader);                      // Add the rreqHeader to the dsr extension header
   uint8_t length = rreqHeader.GetLength ();
-  dsrRoutingHeader.SetPayloadLength (uint16_t(length) + 2);
+  dsrRoutingHeader.SetPayloadLength (uint16_t (length) + 2);
   packet->AddHeader (dsrRoutingHeader);
 
   // Schedule the route requests retry with non-propagation set true
@@ -2414,8 +2414,8 @@
   uint8_t salvage = rerr.GetSalvage ();
   Ipv4Address dst = rerr.GetOriginalDst ();
   NS_LOG_DEBUG ("our own address here " << m_mainAddress << " error source " << rerr.GetErrorSrc () << " error destination " << rerr.GetErrorDst ()
-      << " error next hop " << rerr.GetUnreachNode () << " original dst " << rerr.GetOriginalDst ()
-     );
+                                        << " error next hop " << rerr.GetUnreachNode () << " original dst " << rerr.GetOriginalDst ()
+                );
   RouteCacheEntry toDst;
   if (m_routeCache->LookupRoute (dst, toDst))
     {
@@ -2472,7 +2472,7 @@
       dsrRoutingHeader.AddDsrOption (rreqHeader);         // Add the rreqHeader to the dsr extension header
       dsrRoutingHeader.AddDsrOption (rerr);
       uint8_t length = rreqHeader.GetLength () + rerr.GetLength ();
-      dsrRoutingHeader.SetPayloadLength (uint16_t(length) + 4);
+      dsrRoutingHeader.SetPayloadLength (uint16_t (length) + 4);
       dstP->AddHeader (dsrRoutingHeader);
       // Schedule the route requests retry, propagate the route request message as it contains error
       bool nonProp = false;
@@ -2615,12 +2615,12 @@
       if (rreqDelay > m_maxRequestPeriod)
         {
           // use the max request period
-          NS_LOG_DEBUG ("The max request delay time " << m_maxRequestPeriod.GetSeconds());
+          NS_LOG_DEBUG ("The max request delay time " << m_maxRequestPeriod.GetSeconds ());
           m_addressReqTimer[dst].Schedule (m_maxRequestPeriod);
         }
       else
         {
-          NS_LOG_DEBUG ("The request delay time " << rreqDelay.GetSeconds());
+          NS_LOG_DEBUG ("The request delay time " << rreqDelay.GetSeconds ());
           m_addressReqTimer[dst].Schedule (rreqDelay);
         }
 
@@ -2708,7 +2708,7 @@
   uint32_t priority = GetPriority (DSR_CONTROL_PACKET);
   std::map<uint32_t, Ptr<dsr::DsrNetworkQueue> >::iterator i = m_priorityQueue.find (priority);
   Ptr<dsr::DsrNetworkQueue> dsrNetworkQueue = i->second;
-  NS_LOG_DEBUG("Will be inserting into priority queue " << dsrNetworkQueue << " number: " << priority);
+  NS_LOG_DEBUG ("Will be inserting into priority queue " << dsrNetworkQueue << " number: " << priority);
 
   DsrNetworkQueueEntry newEntry (packet, source, m_broadcast, Simulator::Now (), 0);
 
@@ -2780,7 +2780,7 @@
       dsrRoutingHeader.SetDestId (GetIDfromIP (replyDst));
 
       uint8_t length = rrep.GetLength ();        // Get the length of the rrep header excluding the type header
-      dsrRoutingHeader.SetPayloadLength (uint16_t(length) + 2);
+      dsrRoutingHeader.SetPayloadLength (uint16_t (length) + 2);
       dsrRoutingHeader.AddDsrOption (rrep);
       Ptr<Packet> newPacket = Create<Packet> ();
       newPacket->AddHeader (dsrRoutingHeader);
@@ -2811,7 +2811,7 @@
   uint32_t priority = GetPriority (DSR_CONTROL_PACKET);
   std::map<uint32_t, Ptr<dsr::DsrNetworkQueue> >::iterator i = m_priorityQueue.find (priority);
   Ptr<dsr::DsrNetworkQueue> dsrNetworkQueue = i->second;
-  NS_LOG_DEBUG("Will be inserting into priority queue " << dsrNetworkQueue << " number: " << priority);
+  NS_LOG_DEBUG ("Will be inserting into priority queue " << dsrNetworkQueue << " number: " << priority);
 
   DsrNetworkQueueEntry newEntry (packet, source, nextHop, Simulator::Now (), route);
 
@@ -2874,7 +2874,7 @@
   ack.SetRealDst (realDst);
 
   uint8_t length = ack.GetLength ();
-  dsrRoutingHeader.SetPayloadLength (uint16_t(length) + 2);
+  dsrRoutingHeader.SetPayloadLength (uint16_t (length) + 2);
   dsrRoutingHeader.AddDsrOption (ack);
 
   Ptr<Packet> packet = Create<Packet> ();
@@ -2886,7 +2886,7 @@
   uint32_t priority = GetPriority (DSR_CONTROL_PACKET);
   std::map<uint32_t, Ptr<dsr::DsrNetworkQueue> >::iterator i = m_priorityQueue.find (priority);
   Ptr<dsr::DsrNetworkQueue> dsrNetworkQueue = i->second;
-  NS_LOG_DEBUG("Will be inserting into priority queue " << dsrNetworkQueue << " number: " << priority);
+  NS_LOG_DEBUG ("Will be inserting into priority queue " << dsrNetworkQueue << " number: " << priority);
 
   DsrNetworkQueueEntry newEntry (packet, m_mainAddress, destination, Simulator::Now (), route);
 
@@ -2945,7 +2945,7 @@
   uint8_t segmentsLeft = 0;
 
   optionType = *(data);
-  NS_LOG_LOGIC ("The option type value " << (uint32_t)optionType << " with packet size " << p->GetSize());
+  NS_LOG_LOGIC ("The option type value " << (uint32_t)optionType << " with packet size " << p->GetSize ());
   dsrOption = GetOption (optionType);       // Get the relative dsr option and demux to the process function
 
   if (optionType == 1)        // This is the request option
@@ -3033,20 +3033,20 @@
                   // we need to make a copy in the unlikely event we hit the
                   // RX_ENDPOINT_UNREACH code path
                   // Here we can use the packet that has been get off whole DSR header
-                  NS_LOG_DEBUG ("The packet size here " << copy->GetSize());
+                  NS_LOG_DEBUG ("The packet size here " << copy->GetSize ());
                   NS_LOG_DEBUG ("The packet received " << *copy);
                   enum IpL4Protocol::RxStatus status =
                     nextProto->Receive (copy, ip, incomingInterface);
                   NS_LOG_DEBUG ("The receive status " << status);
                   switch (status)
                     {
-                      case IpL4Protocol::RX_OK:
-                      // fall through
-                      case IpL4Protocol::RX_ENDPOINT_CLOSED:
-                      // fall through
-                      case IpL4Protocol::RX_CSUM_FAILED:
-                        break;
-                      case IpL4Protocol::RX_ENDPOINT_UNREACH:
+                    case IpL4Protocol::RX_OK:
+                    // fall through
+                    case IpL4Protocol::RX_ENDPOINT_CLOSED:
+                    // fall through
+                    case IpL4Protocol::RX_CSUM_FAILED:
+                      break;
+                    case IpL4Protocol::RX_ENDPOINT_UNREACH:
                       if (ip.GetDestination ().IsBroadcast () == true
                           || ip.GetDestination ().IsMulticast () == true)
                         {
--- a/src/dsr/model/dsr-routing.h	Sun May 13 10:39:34 2012 -0700
+++ b/src/dsr/model/dsr-routing.h	Sun May 13 10:47:11 2012 -0700
@@ -402,8 +402,8 @@
    * in the stack.
    */
   virtual enum IpL4Protocol::RxStatus Receive (Ptr<Packet> p,
-                                                 Ipv4Header const &header,
-                                                 Ptr<Ipv4Interface> incomingInterface);
+                                               Ipv4Header const &header,
+                                               Ptr<Ipv4Interface> incomingInterface);
 
   /**
    * \param p packet to forward up
--- a/src/dsr/model/dsr-rreq-table.cc	Sun May 13 10:39:34 2012 -0700
+++ b/src/dsr/model/dsr-rreq-table.cc	Sun May 13 10:47:11 2012 -0700
@@ -67,7 +67,7 @@
   Ipv4Address firstExpire;
   Time max = Seconds (0.0);
   for (std::map<Ipv4Address, RreqTableEntry >::const_iterator i =
-      rreqDstMap.begin (); i != rreqDstMap.end (); ++i)
+         rreqDstMap.begin (); i != rreqDstMap.end (); ++i)
     {
       Ipv4Address dst = i->first;
       RreqTableEntry rreqTableEntry = i->second;
@@ -99,7 +99,7 @@
         }
       RreqTableEntry rreqTableEntry;
       rreqTableEntry.m_reqNo = 1;
-      rreqTableEntry.m_expire = Simulator::Now();
+      rreqTableEntry.m_expire = Simulator::Now ();
       m_rreqDstMap [dst] = rreqTableEntry;
     }
   else
@@ -109,7 +109,7 @@
       RreqTableEntry rreqTableEntry = i->second;
       NS_LOG_DEBUG ("The request count before incrementing " << rreqTableEntry.m_reqNo);
       rreqTableEntry.m_reqNo = (rreqTableEntry.m_reqNo + 1);
-      rreqTableEntry.m_expire = Simulator::Now();
+      rreqTableEntry.m_expire = Simulator::Now ();
       m_rreqDstMap [dst] = rreqTableEntry;
     }
 }
--- a/src/dsr/model/dsr-rreq-table.h	Sun May 13 10:39:34 2012 -0700
+++ b/src/dsr/model/dsr-rreq-table.h	Sun May 13 10:47:11 2012 -0700
@@ -177,7 +177,6 @@
   void PurgeNeighbor ();
 
 private:
-
   // / Timer for neighbor's list. Schedule Purge().
   Timer m_ntimer;
   // / The max # of requests to retransmit
--- a/src/dsr/model/dsr-rsendbuff.cc	Sun May 13 10:39:34 2012 -0700
+++ b/src/dsr/model/dsr-rsendbuff.cc	Sun May 13 10:47:11 2012 -0700
@@ -56,7 +56,7 @@
        != m_sendBuffer.end (); ++i)
     {
       NS_LOG_INFO ("packet id " << i->GetPacket ()->GetUid () << " " << entry.GetPacket ()->GetUid ()
-                   << " dst " << i->GetDestination () << " " << entry.GetDestination ());
+                                << " dst " << i->GetDestination () << " " << entry.GetDestination ());
 
       if ((i->GetPacket ()->GetUid () == entry.GetPacket ()->GetUid ())
           && (i->GetDestination () == entry.GetDestination ()))