src/devices/csma-cd/csma-cd-net-device.cc
changeset 997 d95ffcec6523
parent 995 22821dd9152e
child 1001 33cf9c56e3cd
--- a/src/devices/csma-cd/csma-cd-net-device.cc	Sat Jul 28 13:20:47 2007 +0200
+++ b/src/devices/csma-cd/csma-cd-net-device.cc	Sat Jul 28 13:22:47 2007 +0200
@@ -228,7 +228,9 @@
   if ((m_encapMode == IP_ARP) || (m_encapMode == LLC))
     {
       return true;
-    } else {
+    } 
+  else 
+    {
       return false;
     }
 }
@@ -248,22 +250,22 @@
   AddHeader(p, dest, protocolNumber);
 
   // Place the packet to be sent on the send queue
-    if (m_queue->Enqueue(p) == false )
-      {
-        return false;
-      }
-    // If the device is idle, we need to start a transmission. Otherwise,
-    // the transmission will be started when the current packet finished
-    // transmission (see TransmitCompleteEvent)
-    if (m_txMachineState == READY) 
-      {
-        // Store the next packet to be transmitted
-        if (m_queue->Dequeue (m_currentPkt))
-          {
-            TransmitStart();
-          }
-      }
-    return true;
+  if (m_queue->Enqueue(p) == false )
+    {
+      return false;
+    }
+  // If the device is idle, we need to start a transmission. Otherwise,
+  // the transmission will be started when the current packet finished
+  // transmission (see TransmitCompleteEvent)
+  if (m_txMachineState == READY) 
+    {
+      // Store the next packet to be transmitted
+      if (m_queue->Dequeue (m_currentPkt))
+        {
+          TransmitStart();
+        }
+    }
+  return true;
 }
 
 void
@@ -292,7 +294,9 @@
       if (m_backoff.MaxRetriesReached())
         { // Too many retries reached, abort transmission of packet
           TransmitAbort();
-        } else {
+        } 
+      else 
+        {
           m_backoff.IncrNumRetries();
           Time backoffTime = m_backoff.GetBackoffTime();
 
@@ -304,7 +308,9 @@
                                &CsmaCdNetDevice::TransmitStart, 
                                this);
         }
-    } else {
+    } 
+  else 
+    {
       // Channel is free, transmit packet
       m_txMachineState = BUSY;
       Time tEvent = Seconds (m_bps.CalculateTxTime(m_currentPkt.GetSize()));
@@ -322,7 +328,9 @@
                     "Channel transmit start did not work at " << 
                     tEvent.GetSeconds () << "sec");
           m_txMachineState = READY;
-        } else {
+        } 
+      else 
+        {
           // Transmission success, reset backoff time parameters.
           m_backoff.ResetBackoffTime();
         }