diff --git a/src/point-to-point/examples/main-attribute-value.cc b/src/point-to-point/examples/main-attribute-value.cc index 91bd5311a..2fb0311ac 100644 --- a/src/point-to-point/examples/main-attribute-value.cc +++ b/src/point-to-point/examples/main-attribute-value.cc @@ -106,7 +106,7 @@ main (int argc, char *argv[]) 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 even though the attribute // is a member of the subclass @@ -124,7 +124,7 @@ main (int argc, char *argv[]) // 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: " << diff --git a/src/point-to-point/helper/point-to-point-helper.cc b/src/point-to-point/helper/point-to-point-helper.cc index c01b68414..450648752 100644 --- a/src/point-to-point/helper/point-to-point-helper.cc +++ b/src/point-to-point/helper/point-to-point-helper.cc @@ -265,7 +265,7 @@ PointToPointHelper::Install (Ptr a, Ptr b) devA->AggregateObject (mpiRecA); devB->AggregateObject (mpiRecB); } - + devA->Attach (channel); devB->Attach (channel); container.Add (devA); diff --git a/src/point-to-point/helper/point-to-point-helper.h b/src/point-to-point/helper/point-to-point-helper.h index 15fa39846..5a7f4adf6 100644 --- a/src/point-to-point/helper/point-to-point-helper.h +++ b/src/point-to-point/helper/point-to-point-helper.h @@ -172,10 +172,10 @@ private: * \param nd Net device for which you want to enable tracing. */ virtual void EnableAsciiInternal ( - Ptr stream, - std::string prefix, - Ptr nd, - bool explicitFilename); + Ptr stream, + std::string prefix, + Ptr nd, + bool explicitFilename); ObjectFactory m_queueFactory; ObjectFactory m_channelFactory; diff --git a/src/point-to-point/model/point-to-point-channel.cc b/src/point-to-point/model/point-to-point-channel.cc index 87ad931ca..38b6b62d4 100644 --- a/src/point-to-point/model/point-to-point-channel.cc +++ b/src/point-to-point/model/point-to-point-channel.cc @@ -42,7 +42,7 @@ PointToPointChannel::GetTypeId (void) .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 @@ PointToPointChannel::GetTypeId (void) // 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 (); } diff --git a/src/point-to-point/model/point-to-point-channel.h b/src/point-to-point/model/point-to-point-channel.h index 4834f9fd2..bf7fa5655 100644 --- a/src/point-to-point/model/point-to-point-channel.h +++ b/src/point-to-point/model/point-to-point-channel.h @@ -144,22 +144,22 @@ private: > 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 m_src; Ptr m_dst; }; - + Link m_link[N_DEVICES]; }; diff --git a/src/point-to-point/model/point-to-point-net-device.cc b/src/point-to-point/model/point-to-point-net-device.cc index 2e6a99ff3..85719b5ec 100644 --- a/src/point-to-point/model/point-to-point-net-device.cc +++ b/src/point-to-point/model/point-to-point-net-device.cc @@ -46,7 +46,7 @@ PointToPointNetDevice::GetTypeId (void) UintegerValue (DEFAULT_MTU), MakeUintegerAccessor (&PointToPointNetDevice::SetMtu, &PointToPointNetDevice::GetMtu), - MakeUintegerChecker ()) + MakeUintegerChecker ()) .AddAttribute ("Address", "The MAC address of this device.", Mac48AddressValue (Mac48Address ("ff:ff:ff:ff:ff:ff")), @@ -139,17 +139,17 @@ PointToPointNetDevice::GetTypeId (void) .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 @@ PointToPointNetDevice::~PointToPointNetDevice () NS_LOG_FUNCTION_NOARGS (); } - void +void PointToPointNetDevice::AddHeader(Ptr p, uint16_t protocolNumber) { NS_LOG_FUNCTION_NOARGS (); @@ -168,7 +168,7 @@ PointToPointNetDevice::AddHeader(Ptr p, uint16_t protocolNumber) p->AddHeader (ppp); } - bool +bool PointToPointNetDevice::ProcessHeader(Ptr p, uint16_t& param) { NS_LOG_FUNCTION_NOARGS (); @@ -178,7 +178,7 @@ PointToPointNetDevice::ProcessHeader(Ptr p, uint16_t& param) return true; } - void +void PointToPointNetDevice::DoDispose() { NS_LOG_FUNCTION_NOARGS (); @@ -189,21 +189,21 @@ PointToPointNetDevice::DoDispose() 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 p) { NS_LOG_FUNCTION (this << p); @@ -233,7 +233,7 @@ PointToPointNetDevice::TransmitStart (Ptr p) return result; } - void +void PointToPointNetDevice::TransmitComplete (void) { NS_LOG_FUNCTION_NOARGS (); @@ -269,7 +269,7 @@ PointToPointNetDevice::TransmitComplete (void) TransmitStart(p); } - bool +bool PointToPointNetDevice::Attach (Ptr ch) { NS_LOG_FUNCTION (this << &ch); @@ -287,21 +287,21 @@ PointToPointNetDevice::Attach (Ptr ch) return true; } - void +void PointToPointNetDevice::SetQueue (Ptr q) { NS_LOG_FUNCTION (this << q); m_queue = q; } - void +void PointToPointNetDevice::SetReceiveErrorModel (Ptr em) { NS_LOG_FUNCTION (this << em); m_receiveErrorModel = em; } - void +void PointToPointNetDevice::Receive (Ptr packet) { NS_LOG_FUNCTION (this << packet); @@ -345,33 +345,33 @@ PointToPointNetDevice::Receive (Ptr packet) } } - Ptr +Ptr 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 +Ptr PointToPointNetDevice::GetChannel (void) const { return m_channel; @@ -383,25 +383,25 @@ PointToPointNetDevice::GetChannel (void) const // 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 callback) { m_linkChangeCallbacks.ConnectWithoutContext (callback); @@ -411,7 +411,7 @@ PointToPointNetDevice::AddLinkChangeCallback (Callback callback) // 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 @@ PointToPointNetDevice::IsBroadcast (void) const // 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 @@ PointToPointNetDevice::GetMulticast (Ipv6Address addr) const 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, const Address &dest, @@ -526,25 +526,25 @@ PointToPointNetDevice::SendFrom (Ptr packet, return false; } - Ptr +Ptr PointToPointNetDevice::GetNode (void) const { return m_node; } - void +void PointToPointNetDevice::SetNode (Ptr 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 @@ PointToPointNetDevice::SetPromiscReceiveCallback (NetDevice::PromiscReceiveCallb m_promiscCallback = cb; } - bool +bool PointToPointNetDevice::SupportsSendFrom (void) const { return false; @@ -585,7 +585,7 @@ PointToPointNetDevice::GetRemote (void) const return Address (); } - bool +bool PointToPointNetDevice::SetMtu (uint16_t mtu) { NS_LOG_FUNCTION (this << mtu); @@ -593,33 +593,33 @@ PointToPointNetDevice::SetMtu (uint16_t mtu) 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; } diff --git a/src/point-to-point/model/point-to-point-net-device.h b/src/point-to-point/model/point-to-point-net-device.h index ef2748275..669b7bc67 100644 --- a/src/point-to-point/model/point-to-point-net-device.h +++ b/src/point-to-point/model/point-to-point-net-device.h @@ -44,7 +44,7 @@ class ErrorModel; * 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 @@ public: * 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 @@ public: void Receive (Ptr 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 @@ private: * 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 @@ private: /** * The trace source fired when a packet ends the transmission process on - * the medium. + * the medium. * * \see class CallBackTraceSource */ diff --git a/src/point-to-point/model/ppp-header.cc b/src/point-to-point/model/ppp-header.cc index 5a2ec273c..c34abdacd 100644 --- a/src/point-to-point/model/ppp-header.cc +++ b/src/point-to-point/model/ppp-header.cc @@ -37,17 +37,17 @@ PppHeader::~PppHeader () { } - TypeId +TypeId PppHeader::GetTypeId (void) { static TypeId tid = TypeId ("ns3::PppHeader") .SetParent
() .AddConstructor () - ; + ; return tid; } - TypeId +TypeId PppHeader::GetInstanceTypeId (void) const { return GetTypeId (); @@ -57,9 +57,9 @@ void PppHeader::Print (std::ostream &os) const { std::string proto; - + switch(m_protocol) - { + { case 0x0021: /* IPv4 */ proto = "IP (0x0021)"; break; @@ -68,36 +68,36 @@ PppHeader::Print (std::ostream &os) const 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; diff --git a/src/point-to-point/test/point-to-point-test.cc b/src/point-to-point/test/point-to-point-test.cc index cd34d31b8..5dc0892a0 100644 --- a/src/point-to-point/test/point-to-point-test.cc +++ b/src/point-to-point/test/point-to-point-test.cc @@ -19,7 +19,8 @@ private: PointToPointTest::PointToPointTest () : TestCase ("PointToPoint") -{} +{ +} void PointToPointTest::SendOnePacket (Ptr device)