point-to-point coding style changes
authorJosh Pelkey <jpelkey@gatech.edu>
Fri, 13 May 2011 14:58:47 -0400
changeset 7186 0a3931a51e3f
parent 7185 e27da23c35b5
child 7187 4b94384be695
point-to-point coding style changes
src/point-to-point/examples/main-attribute-value.cc
src/point-to-point/helper/point-to-point-helper.cc
src/point-to-point/helper/point-to-point-helper.h
src/point-to-point/model/point-to-point-channel.cc
src/point-to-point/model/point-to-point-channel.h
src/point-to-point/model/point-to-point-net-device.cc
src/point-to-point/model/point-to-point-net-device.h
src/point-to-point/model/ppp-header.cc
src/point-to-point/test/point-to-point-test.cc
--- a/src/point-to-point/examples/main-attribute-value.cc	Fri May 13 14:58:28 2011 -0400
+++ b/src/point-to-point/examples/main-attribute-value.cc	Fri May 13 14:58:47 2011 -0400
@@ -106,7 +106,7 @@
   UintegerValue limit;
   dtq->GetAttribute ("MaxPackets", limit);
   NS_LOG_INFO ("1.  dtq limit: " << limit.Get () << " packets");
-  
+
   // Note that the above downcast is not really needed; we could have
   // done the same using the Ptr<Queue> even though the attribute
   // is a member of the subclass
@@ -124,7 +124,7 @@
   // namespace.  Here, this attribute resides on a known path in this
   // namespace; this approach is useful if one doesn't have access to
   // the underlying pointers and would like to configure a specific
-  // attribute with a single statement.  
+  // attribute with a single statement.
   Config::Set ("/NodeList/0/DeviceList/0/TxQueue/MaxPackets", UintegerValue (25));
   txQueue->GetAttribute ("MaxPackets", limit); 
   NS_LOG_INFO ("4.  txQueue limit changed through namespace: " << 
--- a/src/point-to-point/helper/point-to-point-helper.cc	Fri May 13 14:58:28 2011 -0400
+++ b/src/point-to-point/helper/point-to-point-helper.cc	Fri May 13 14:58:47 2011 -0400
@@ -265,7 +265,7 @@
       devA->AggregateObject (mpiRecA);
       devB->AggregateObject (mpiRecB);
     }
-    
+
   devA->Attach (channel);
   devB->Attach (channel);
   container.Add (devA);
--- a/src/point-to-point/helper/point-to-point-helper.h	Fri May 13 14:58:28 2011 -0400
+++ b/src/point-to-point/helper/point-to-point-helper.h	Fri May 13 14:58:47 2011 -0400
@@ -172,10 +172,10 @@
    * \param nd Net device for which you want to enable tracing.
    */
   virtual void EnableAsciiInternal (
-                                    Ptr<OutputStreamWrapper> stream, 
-                                    std::string prefix, 
-                                    Ptr<NetDevice> nd,
-                                    bool explicitFilename);
+    Ptr<OutputStreamWrapper> stream,
+    std::string prefix,
+    Ptr<NetDevice> nd,
+    bool explicitFilename);
 
   ObjectFactory m_queueFactory;
   ObjectFactory m_channelFactory;
--- a/src/point-to-point/model/point-to-point-channel.cc	Fri May 13 14:58:28 2011 -0400
+++ b/src/point-to-point/model/point-to-point-channel.cc	Fri May 13 14:58:47 2011 -0400
@@ -42,7 +42,7 @@
     .AddTraceSource ("TxRxPointToPoint",
                      "Trace source indicating transmission of packet from the PointToPointChannel, used by the Animation interface.",
                      MakeTraceSourceAccessor (&PointToPointChannel::m_txrxPointToPoint))
-    ;
+  ;
   return tid;
 }
 
@@ -50,10 +50,10 @@
 // By default, you get a channel that 
 // has an "infitely" fast transmission speed and zero delay.
 PointToPointChannel::PointToPointChannel()
-: 
-  Channel (), 
-  m_delay (Seconds (0.)),
-  m_nDevices (0)
+  :
+    Channel (),
+    m_delay (Seconds (0.)),
+    m_nDevices (0)
 {
   NS_LOG_FUNCTION_NOARGS ();
 }
--- a/src/point-to-point/model/point-to-point-channel.h	Fri May 13 14:58:28 2011 -0400
+++ b/src/point-to-point/model/point-to-point-channel.h	Fri May 13 14:58:47 2011 -0400
@@ -144,22 +144,22 @@
                  > m_txrxPointToPoint;
 
   enum WireState
-    {
-      INITIALIZING,
-      IDLE,
-      TRANSMITTING,
-      PROPAGATING
-    };
+  {
+    INITIALIZING,
+    IDLE,
+    TRANSMITTING,
+    PROPAGATING
+  };
 
   class Link
   {
-  public:
+public:
     Link() : m_state (INITIALIZING), m_src (0), m_dst (0) {}
     WireState                  m_state;
     Ptr<PointToPointNetDevice> m_src;
     Ptr<PointToPointNetDevice> m_dst;
   };
-    
+
   Link    m_link[N_DEVICES];
 };
 
--- a/src/point-to-point/model/point-to-point-net-device.cc	Fri May 13 14:58:28 2011 -0400
+++ b/src/point-to-point/model/point-to-point-net-device.cc	Fri May 13 14:58:47 2011 -0400
@@ -46,7 +46,7 @@
                    UintegerValue (DEFAULT_MTU),
                    MakeUintegerAccessor (&PointToPointNetDevice::SetMtu,
                                          &PointToPointNetDevice::GetMtu),
-                   MakeUintegerChecker<uint16_t> ())                   
+                   MakeUintegerChecker<uint16_t> ())
     .AddAttribute ("Address", 
                    "The MAC address of this device.",
                    Mac48AddressValue (Mac48Address ("ff:ff:ff:ff:ff:ff")),
@@ -139,17 +139,17 @@
     .AddTraceSource ("PromiscSniffer", 
                      "Trace source simulating a promiscuous packet sniffer attached to the device",
                      MakeTraceSourceAccessor (&PointToPointNetDevice::m_promiscSnifferTrace))
-    ;
+  ;
   return tid;
 }
 
 
 PointToPointNetDevice::PointToPointNetDevice () 
-: 
-  m_txMachineState (READY),
-  m_channel (0), 
-  m_linkUp (false),
-  m_currentPkt (0)
+  :
+    m_txMachineState (READY),
+    m_channel (0),
+    m_linkUp (false),
+    m_currentPkt (0)
 {
   NS_LOG_FUNCTION (this);
 }
@@ -159,7 +159,7 @@
   NS_LOG_FUNCTION_NOARGS ();
 }
 
-  void 
+void
 PointToPointNetDevice::AddHeader(Ptr<Packet> p, uint16_t protocolNumber)
 {
   NS_LOG_FUNCTION_NOARGS ();
@@ -168,7 +168,7 @@
   p->AddHeader (ppp);
 }
 
-  bool 
+bool
 PointToPointNetDevice::ProcessHeader(Ptr<Packet> p, uint16_t& param)
 {
   NS_LOG_FUNCTION_NOARGS ();
@@ -178,7 +178,7 @@
   return true;
 }
 
-  void 
+void
 PointToPointNetDevice::DoDispose()
 {
   NS_LOG_FUNCTION_NOARGS ();
@@ -189,21 +189,21 @@
   NetDevice::DoDispose ();
 }
 
-  void 
+void
 PointToPointNetDevice::SetDataRate(DataRate bps)
 {
   NS_LOG_FUNCTION_NOARGS ();
   m_bps = bps;
 }
 
-  void 
+void
 PointToPointNetDevice::SetInterframeGap(Time t)
 {
   NS_LOG_FUNCTION_NOARGS ();
   m_tInterframeGap = t;
 }
 
-  bool
+bool
 PointToPointNetDevice::TransmitStart (Ptr<Packet> p)
 {
   NS_LOG_FUNCTION (this << p);
@@ -233,7 +233,7 @@
   return result;
 }
 
-  void 
+void
 PointToPointNetDevice::TransmitComplete (void)
 {
   NS_LOG_FUNCTION_NOARGS ();
@@ -269,7 +269,7 @@
   TransmitStart(p);
 }
 
-  bool 
+bool
 PointToPointNetDevice::Attach (Ptr<PointToPointChannel> ch)
 {
   NS_LOG_FUNCTION (this << &ch);
@@ -287,21 +287,21 @@
   return true;
 }
 
-  void
+void
 PointToPointNetDevice::SetQueue (Ptr<Queue> q)
 {
   NS_LOG_FUNCTION (this << q);
   m_queue = q;
 }
 
-  void
+void
 PointToPointNetDevice::SetReceiveErrorModel (Ptr<ErrorModel> em)
 {
   NS_LOG_FUNCTION (this << em);
   m_receiveErrorModel = em;
 }
 
- void
+void
 PointToPointNetDevice::Receive (Ptr<Packet> packet)
 {
   NS_LOG_FUNCTION (this << packet);
@@ -345,33 +345,33 @@
     }
 }
 
-  Ptr<Queue> 
+Ptr<Queue>
 PointToPointNetDevice::GetQueue(void) const 
 { 
   NS_LOG_FUNCTION_NOARGS ();
   return m_queue;
 }
 
-  void
+void
 PointToPointNetDevice::NotifyLinkUp (void)
 {
   m_linkUp = true;
   m_linkChangeCallbacks ();
 }
 
-  void 
+void
 PointToPointNetDevice::SetIfIndex(const uint32_t index)
 {
   m_ifIndex = index;
 }
 
-  uint32_t 
+uint32_t
 PointToPointNetDevice::GetIfIndex(void) const
 {
   return m_ifIndex;
 }
 
-  Ptr<Channel> 
+Ptr<Channel>
 PointToPointNetDevice::GetChannel (void) const
 {
   return m_channel;
@@ -383,25 +383,25 @@
 // methods to get and set the address.  Rather than be rude and assert, we let
 // clients get and set the address, but simply ignore them.
 
-  void 
+void
 PointToPointNetDevice::SetAddress (Address address)
 {
   m_address = Mac48Address::ConvertFrom (address);
 }
 
-  Address 
+Address
 PointToPointNetDevice::GetAddress (void) const
 {
   return m_address;
 }
 
-  bool 
+bool
 PointToPointNetDevice::IsLinkUp (void) const
 {
   return m_linkUp;
 }
 
-  void 
+void
 PointToPointNetDevice::AddLinkChangeCallback (Callback<void> callback)
 {
   m_linkChangeCallbacks.ConnectWithoutContext (callback);
@@ -411,7 +411,7 @@
 // This is a point-to-point device, so every transmission is a broadcast to
 // all of the devices on the network.
 //
-  bool 
+bool
 PointToPointNetDevice::IsBroadcast (void) const
 {
   return true;
@@ -422,19 +422,19 @@
 // point-to-point device.  The base class NetDevice wants us to return a
 // broadcast address, so we make up something reasonable.
 //
-  Address
+Address
 PointToPointNetDevice::GetBroadcast (void) const
 {
   return Mac48Address ("ff:ff:ff:ff:ff:ff");
 }
 
-  bool 
+bool
 PointToPointNetDevice::IsMulticast (void) const
 {
   return true;
 }
 
-  Address 
+Address
 PointToPointNetDevice::GetMulticast (Ipv4Address multicastGroup) const
 {
   return Mac48Address ("01:00:5e:00:00:00");
@@ -447,19 +447,19 @@
   return Mac48Address ("33:33:00:00:00:00");
 }
 
-  bool 
+bool
 PointToPointNetDevice::IsPointToPoint (void) const
 {
   return true;
 }
 
-  bool 
+bool
 PointToPointNetDevice::IsBridge (void) const
 {
   return false;
 }
 
-  bool 
+bool
 PointToPointNetDevice::Send(
   Ptr<Packet> packet, 
   const Address &dest, 
@@ -526,25 +526,25 @@
   return false;
 }
 
-  Ptr<Node> 
+Ptr<Node>
 PointToPointNetDevice::GetNode (void) const
 {
   return m_node;
 }
 
-  void 
+void
 PointToPointNetDevice::SetNode (Ptr<Node> node)
 {
   m_node = node;
 }
 
-  bool 
+bool
 PointToPointNetDevice::NeedsArp (void) const
 {
   return false;
 }
 
-  void 
+void
 PointToPointNetDevice::SetReceiveCallback (NetDevice::ReceiveCallback cb)
 {
   m_rxCallback = cb;
@@ -556,7 +556,7 @@
   m_promiscCallback = cb;
 }
 
-  bool
+bool
 PointToPointNetDevice::SupportsSendFrom (void) const
 {
   return false;
@@ -585,7 +585,7 @@
   return Address ();
 }
 
-  bool
+bool
 PointToPointNetDevice::SetMtu (uint16_t mtu)
 {
   NS_LOG_FUNCTION (this << mtu);
@@ -593,33 +593,33 @@
   return true;
 }
 
-  uint16_t
+uint16_t
 PointToPointNetDevice::GetMtu (void) const
 {
   NS_LOG_FUNCTION_NOARGS ();
   return m_mtu;
 }
 
-  uint16_t
+uint16_t
 PointToPointNetDevice::PppToEther(uint16_t proto)
 {
   switch(proto)
     {
-      case 0x0021: return 0x0800; //IPv4
-      case 0x0057: return 0x86DD; //IPv6
-      default: NS_ASSERT_MSG(false, "PPP Protocol number not defined!");
+    case 0x0021: return 0x0800;   //IPv4
+    case 0x0057: return 0x86DD;   //IPv6
+    default: NS_ASSERT_MSG(false, "PPP Protocol number not defined!");
     }
   return 0;
 }
 
-  uint16_t
+uint16_t
 PointToPointNetDevice::EtherToPpp(uint16_t proto)
 {
   switch(proto)
     {
-      case 0x0800: return 0x0021; //IPv4
-      case 0x86DD: return 0x0057; //IPv6
-      default: NS_ASSERT_MSG(false, "PPP Protocol number not defined!");
+    case 0x0800: return 0x0021;   //IPv4
+    case 0x86DD: return 0x0057;   //IPv6
+    default: NS_ASSERT_MSG(false, "PPP Protocol number not defined!");
     }
   return 0;
 }
--- a/src/point-to-point/model/point-to-point-net-device.h	Fri May 13 14:58:28 2011 -0400
+++ b/src/point-to-point/model/point-to-point-net-device.h	Fri May 13 14:58:47 2011 -0400
@@ -44,7 +44,7 @@
  * This PointToPointNetDevice class specializes the NetDevice abstract
  * base class.  Together with a PointToPointChannel (and a peer 
  * PointToPointNetDevice), the class models, with some level of 
- * abstraction, a generic point-to-point or serial link.  
+ * abstraction, a generic point-to-point or serial link.
  * Key parameters or objects that can be specified for this device 
  * include a queue, data rate, and interframe transmission gap (the 
  * propagation delay is set in the PointToPointChannel).
@@ -99,7 +99,7 @@
    * Attach a queue to the PointToPointNetDevice.
    *
    * The PointToPointNetDevice "owns" a queue that implements a queueing 
-   * method such as DropTail or RED.  
+   * method such as DropTail or RED.
    *
    * @see Queue
    * @see DropTailQueue
@@ -139,7 +139,7 @@
   void Receive (Ptr<Packet> p);
 
   // The remaining methods are documented in ns3::NetDevice*
-  
+
   virtual void SetIfIndex(const uint32_t index);
   virtual uint32_t GetIfIndex(void) const;
 
@@ -246,10 +246,10 @@
    * Enumeration of the states of the transmit machine of the net device.
    */
   enum TxMachineState
-    {
-      READY, /**< The transmitter is ready to begin transmission of a packet */
-      BUSY   /**< The transmitter is busy transmitting a packet */
-    };
+  {
+    READY,   /**< The transmitter is ready to begin transmission of a packet */
+    BUSY     /**< The transmitter is busy transmitting a packet */
+  };
   /**
    * The state of the Net Device transmit state machine.
    * @see TxMachineState
@@ -346,7 +346,7 @@
 
   /**
    * The trace source fired when a packet ends the transmission process on
-   * the medium.  
+   * the medium.
    *
    * \see class CallBackTraceSource
    */
--- a/src/point-to-point/model/ppp-header.cc	Fri May 13 14:58:28 2011 -0400
+++ b/src/point-to-point/model/ppp-header.cc	Fri May 13 14:58:47 2011 -0400
@@ -37,17 +37,17 @@
 {
 }
 
-  TypeId 
+TypeId
 PppHeader::GetTypeId (void)
 {
   static TypeId tid = TypeId ("ns3::PppHeader")
     .SetParent<Header> ()
     .AddConstructor<PppHeader> ()
-    ;
+  ;
   return tid;
 }
 
-  TypeId 
+TypeId
 PppHeader::GetInstanceTypeId (void) const
 {
   return GetTypeId ();
@@ -57,9 +57,9 @@
 PppHeader::Print (std::ostream &os) const
 {
   std::string proto;
-  
+
   switch(m_protocol)
-  {
+    {
     case 0x0021: /* IPv4 */
       proto = "IP (0x0021)";
       break;
@@ -68,36 +68,36 @@
       break;
     default:
       NS_ASSERT_MSG(false, "PPP Protocol number not defined!");
-  }
+    }
   os << "Point-to-Point Protocol: " << proto; 
 }
 
-  uint32_t
+uint32_t
 PppHeader::GetSerializedSize (void) const
 {
   return 2;
 }
 
-  void
+void
 PppHeader::Serialize (Buffer::Iterator start) const
 {
   start.WriteHtonU16 (m_protocol);
 }
 
-  uint32_t
+uint32_t
 PppHeader::Deserialize (Buffer::Iterator start)
 {
   m_protocol = start.ReadNtohU16 ();
   return GetSerializedSize();
 }
 
-  void
+void
 PppHeader::SetProtocol (uint16_t protocol)
 {
   m_protocol=protocol;
 }
 
-  uint16_t
+uint16_t
 PppHeader::GetProtocol (void)
 {
   return m_protocol;
--- a/src/point-to-point/test/point-to-point-test.cc	Fri May 13 14:58:28 2011 -0400
+++ b/src/point-to-point/test/point-to-point-test.cc	Fri May 13 14:58:47 2011 -0400
@@ -19,7 +19,8 @@
 
 PointToPointTest::PointToPointTest ()
   : TestCase ("PointToPoint")
-{}
+{
+}
 
 void
 PointToPointTest::SendOnePacket (Ptr<PointToPointNetDevice> device)