# HG changeset patch # User Josh Pelkey # Date 1305313063 14400 # Node ID 5ecfee5d17dea9c7d2d4ab921c86208fc86c6b56 # Parent 7ff8011cf487198c48def2437da00acfb9bf0ddf network coding style changes diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/bindings/scan-header.h --- a/src/network/bindings/scan-header.h Fri May 13 14:57:10 2011 -0400 +++ b/src/network/bindings/scan-header.h Fri May 13 14:57:43 2011 -0400 @@ -6,11 +6,11 @@ namespace { - void __foo () - { - static SequenceNumber32 a; - static SequenceNumber16 b; - } - +void __foo () +{ + static SequenceNumber32 a; + static SequenceNumber16 b; } +} + diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/examples/main-packet-header.cc --- a/src/network/examples/main-packet-header.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/examples/main-packet-header.cc Fri May 13 14:57:43 2011 -0400 @@ -34,24 +34,25 @@ // implicit or explicit, but never private. } MyHeader::~MyHeader () -{} +{ +} -TypeId +TypeId MyHeader::GetTypeId (void) { static TypeId tid = TypeId ("ns3::MyHeader") .SetParent
() .AddConstructor () - ; + ; return tid; } -TypeId +TypeId MyHeader::GetInstanceTypeId (void) const { return GetTypeId (); } -void +void MyHeader::Print (std::ostream &os) const { // This method is invoked by the packet printing @@ -111,7 +112,7 @@ // print the content of my packet on the standard output. p->Print (std::cout); - std::cout << std::endl; + std::cout << std::endl; // you can now remove the header from the packet: MyHeader destinationHeader; diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/examples/main-packet-tag.cc --- a/src/network/examples/main-packet-tag.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/examples/main-packet-tag.cc Fri May 13 14:57:43 2011 -0400 @@ -34,7 +34,7 @@ virtual void Serialize (TagBuffer i) const; virtual void Deserialize (TagBuffer i); virtual void Print (std::ostream &os) const; - + // these are our accessors to our tag structure void SetSimpleValue (uint8_t value); uint8_t GetSimpleValue (void) const; @@ -53,7 +53,7 @@ EmptyAttributeValue (), MakeUintegerAccessor (&MyTag::GetSimpleValue), MakeUintegerChecker ()) - ; + ; return tid; } TypeId diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/helper/application-container.cc --- a/src/network/helper/application-container.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/helper/application-container.cc Fri May 13 14:57:43 2011 -0400 @@ -24,7 +24,8 @@ namespace ns3 { ApplicationContainer::ApplicationContainer () -{} +{ +} ApplicationContainer::ApplicationContainer (Ptr app) { diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/helper/net-device-container.cc --- a/src/network/helper/net-device-container.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/helper/net-device-container.cc Fri May 13 14:57:43 2011 -0400 @@ -24,7 +24,8 @@ namespace ns3 { NetDeviceContainer::NetDeviceContainer () -{} +{ +} NetDeviceContainer::NetDeviceContainer (Ptr dev) { m_devices.push_back (dev); diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/helper/node-container.cc --- a/src/network/helper/node-container.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/helper/node-container.cc Fri May 13 14:57:43 2011 -0400 @@ -24,7 +24,8 @@ namespace ns3 { NodeContainer::NodeContainer () -{} +{ +} NodeContainer::NodeContainer (Ptr node) { diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/helper/node-container.h --- a/src/network/helper/node-container.h Fri May 13 14:57:10 2011 -0400 +++ b/src/network/helper/node-container.h Fri May 13 14:57:43 2011 -0400 @@ -287,7 +287,7 @@ */ static NodeContainer GetGlobal (void); - private: +private: std::vector > m_nodes; }; diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/helper/packet-socket-helper.cc --- a/src/network/helper/packet-socket-helper.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/helper/packet-socket-helper.cc Fri May 13 14:57:43 2011 -0400 @@ -29,7 +29,7 @@ { for (NodeContainer::Iterator i = c.Begin (); i != c.End (); ++i) { - Install (*i); + Install (*i); } } diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/helper/trace-helper.cc --- a/src/network/helper/trace-helper.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/helper/trace-helper.cc Fri May 13 14:57:43 2011 -0400 @@ -446,7 +446,7 @@ { continue; } - + NS_ABORT_MSG_IF (deviceid >= node->GetNDevices (), "PcapHelperForDevice::EnablePcap(): Unknown deviceid = " << deviceid); Ptr nd = node->GetDevice (deviceid); @@ -632,7 +632,7 @@ { continue; } - + NS_ABORT_MSG_IF (deviceid >= node->GetNDevices (), "AsciiTraceHelperForDevice::EnableAscii(): Unknown deviceid = " << deviceid); diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/helper/trace-helper.h --- a/src/network/helper/trace-helper.h Fri May 13 14:57:10 2011 -0400 +++ b/src/network/helper/trace-helper.h Fri May 13 14:57:43 2011 -0400 @@ -81,7 +81,7 @@ * @brief Create and initialize a pcap file. */ Ptr CreateFile (std::string filename, std::ios::openmode filemode, - uint32_t dataLinkType, uint32_t snapLen = 65535, int32_t tzCorrection = 0); + uint32_t dataLinkType, uint32_t snapLen = 65535, int32_t tzCorrection = 0); /** * @brief Hook a trace source to the default trace sink */ diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/model/address.cc --- a/src/network/model/address.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/model/address.cc Fri May 13 14:57:43 2011 -0400 @@ -30,7 +30,7 @@ : m_type (0), m_len (0) { - // Buffer left uninitialized + // Buffer left uninitialized } Address::Address (uint8_t type, const uint8_t *buffer, uint8_t len) @@ -95,7 +95,7 @@ m_len = len; return m_len; } - uint32_t +uint32_t Address::CopyAllFrom (const uint8_t *buffer, uint8_t len) { NS_ASSERT (len >= 2); @@ -201,13 +201,13 @@ for (uint8_t i = 0; i < a.GetLength(); i++) { if (a.m_data[i] < b.m_data[i]) - { - return true; - } + { + return true; + } else if (a.m_data[i] > b.m_data[i]) - { - return false; - } + { + return false; + } } return false; } @@ -259,17 +259,17 @@ std::string::size_type next; next = v.find (":", col); if (next == std::string::npos) - { - tmp = v.substr (col, v.size ()-col); - address.m_data[i] = AsInt (tmp); - break; - } + { + tmp = v.substr (col, v.size ()-col); + address.m_data[i] = AsInt (tmp); + break; + } else - { - tmp = v.substr (col, next-col); - address.m_data[i] = AsInt (tmp); - col = next + 1; - } + { + tmp = v.substr (col, next-col); + address.m_data[i] = AsInt (tmp); + col = next + 1; + } } return is; } diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/model/address.h --- a/src/network/model/address.h Fri May 13 14:57:10 2011 -0400 +++ b/src/network/model/address.h Fri May 13 14:57:43 2011 -0400 @@ -159,7 +159,7 @@ * \param len the length of the buffer * \returns the number of bytes copied. * - * The inverse of CopyAllTo(). + * The inverse of CopyAllTo(). * * \see CopyAllTo */ diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/model/application.cc --- a/src/network/model/application.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/model/application.cc Fri May 13 14:57:43 2011 -0400 @@ -48,24 +48,26 @@ TimeValue (TimeStep (0)), MakeTimeAccessor (&Application::m_stopTime), MakeTimeChecker ()) - ; + ; return tid; } // \brief Application Constructor Application::Application() -{} - +{ +} + // \brief Application Destructor Application::~Application() -{} +{ +} -void +void Application::SetStartTime (Time start) { m_startTime = start; } -void +void Application::SetStopTime (Time stop) { m_stopTime = stop; @@ -79,7 +81,7 @@ m_startEvent.Cancel (); m_stopEvent.Cancel (); Object::DoDispose (); -} +} void Application::DoStart (void) @@ -91,7 +93,7 @@ } Object::DoStart (); } - + Ptr Application::GetNode() const { return m_node; @@ -114,5 +116,5 @@ } } //namespace ns3 - - + + diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/model/application.h --- a/src/network/model/application.h Fri May 13 14:57:10 2011 -0400 +++ b/src/network/model/application.h Fri May 13 14:57:43 2011 -0400 @@ -50,14 +50,14 @@ * the previous blocking call would normally exit. THis is documented * in more detail Socket class in socket.h. * - * The main purpose of the base class application public API is to + * The main purpose of the base class application public API is to * provide a uniform way to start and stop applications. */ - /** - * \brief The base class for all ns3 applications - * - */ +/** +* \brief The base class for all ns3 applications +* +*/ class Application : public Object { public: @@ -77,7 +77,7 @@ * time specified, to cause the application to begin. */ void SetStartTime (Time start); - + /** * \brief Specify application stop time * \param stop Stop time for this application, relative to the @@ -90,7 +90,7 @@ * time has come. */ void SetStopTime (Time stop); - + /** * \returns the Node to which this Application object is attached. */ @@ -100,7 +100,7 @@ * \param node the node to which this Application object is attached. */ void SetNode (Ptr node); - + private: /** * \brief Application specific startup code diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/model/buffer.h --- a/src/network/model/buffer.h Fri May 13 14:57:10 2011 -0400 +++ b/src/network/model/buffer.h Fri May 13 14:57:43 2011 -0400 @@ -574,7 +574,7 @@ static struct Buffer::Data *Create (uint32_t size); static struct Buffer::Data *Allocate (uint32_t reqSize); static void Deallocate (struct Buffer::Data *data); - + struct Data *m_data; /* keep track of the maximum value of m_zeroAreaStart across diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/model/channel-list.cc --- a/src/network/model/channel-list.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/model/channel-list.cc Fri May 13 14:57:43 2011 -0400 @@ -47,7 +47,7 @@ uint32_t GetNChannels (void); static Ptr Get (void); - + private: static Ptr *DoGet (void); static void Delete (void); @@ -66,7 +66,7 @@ ObjectVectorValue (), MakeObjectVectorAccessor (&ChannelListPriv::m_channels), MakeObjectVectorChecker ()) - ; + ; return tid; } @@ -74,7 +74,7 @@ ChannelListPriv::Get (void) { return *DoGet (); -} +} Ptr * ChannelListPriv::DoGet (void) @@ -103,7 +103,8 @@ } ChannelListPriv::~ChannelListPriv () -{} +{ +} void ChannelListPriv::DoDispose (void) { @@ -125,7 +126,7 @@ uint32_t index = m_channels.size (); m_channels.push_back (channel); return index; - + } ChannelList::Iterator diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/model/channel-list.h --- a/src/network/model/channel-list.h Fri May 13 14:57:10 2011 -0400 +++ b/src/network/model/channel-list.h Fri May 13 14:57:43 2011 -0400 @@ -69,6 +69,6 @@ static uint32_t GetNChannels (void); }; -}//namespace ns3 +} //namespace ns3 #endif /* CHANNEL_LIST_H */ diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/model/chunk.cc --- a/src/network/model/chunk.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/model/chunk.cc Fri May 13 14:57:43 2011 -0400 @@ -9,7 +9,7 @@ { static TypeId tid = TypeId ("ns3::Chunk") .SetParent () - ; + ; return tid; } diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/model/chunk.h --- a/src/network/model/chunk.h Fri May 13 14:57:10 2011 -0400 +++ b/src/network/model/chunk.h Fri May 13 14:57:43 2011 -0400 @@ -13,7 +13,7 @@ */ class Chunk : public ObjectBase { - public: +public: static TypeId GetTypeId (void); virtual uint32_t Deserialize (Buffer::Iterator start) = 0; diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/model/header.cc --- a/src/network/model/header.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/model/header.cc Fri May 13 14:57:43 2011 -0400 @@ -5,14 +5,15 @@ NS_OBJECT_ENSURE_REGISTERED (Header); Header::~Header () -{} +{ +} -TypeId +TypeId Header::GetTypeId (void) { static TypeId tid = TypeId ("ns3::Header") .SetParent () - ; + ; return tid; } diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/model/net-device.cc --- a/src/network/model/net-device.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/model/net-device.cc Fri May 13 14:57:43 2011 -0400 @@ -33,7 +33,7 @@ { static TypeId tid = TypeId ("ns3::NetDevice") .SetParent () - ; + ; return tid; } diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/model/net-device.h --- a/src/network/model/net-device.h Fri May 13 14:57:10 2011 -0400 +++ b/src/network/model/net-device.h Fri May 13 14:57:43 2011 -0400 @@ -184,14 +184,14 @@ * \see NetDevice::IsMulticast */ virtual Address GetMulticast (Ipv4Address multicastGroup) const = 0; - - /** - * \brief Get the MAC multicast address corresponding - * to the IPv6 address provided. - * \param addr IPv6 address - * \return the MAC multicast address - * \warning Calling this method is invalid if IsMulticast returns not true. - */ + + /** +* \brief Get the MAC multicast address corresponding +* to the IPv6 address provided. +* \param addr IPv6 address +* \return the MAC multicast address +* \warning Calling this method is invalid if IsMulticast returns not true. +*/ virtual Address GetMulticast (Ipv6Address addr) const = 0; /** @@ -268,16 +268,16 @@ * which we do here. */ enum PacketType - { - PACKET_HOST = 1, /**< Packet addressed oo us */ - NS3_PACKET_HOST = PACKET_HOST, - PACKET_BROADCAST, /**< Packet addressed to all */ - NS3_PACKET_BROADCAST = PACKET_BROADCAST, - PACKET_MULTICAST, /**< Packet addressed to multicast group */ - NS3_PACKET_MULTICAST = PACKET_MULTICAST, - PACKET_OTHERHOST, /**< Packet addressed to someone else */ - NS3_PACKET_OTHERHOST = PACKET_OTHERHOST, - }; + { + PACKET_HOST = 1, /**< Packet addressed oo us */ + NS3_PACKET_HOST = PACKET_HOST, + PACKET_BROADCAST, /**< Packet addressed to all */ + NS3_PACKET_BROADCAST = PACKET_BROADCAST, + PACKET_MULTICAST, /**< Packet addressed to multicast group */ + NS3_PACKET_MULTICAST = PACKET_MULTICAST, + PACKET_OTHERHOST, /**< Packet addressed to someone else */ + NS3_PACKET_OTHERHOST = PACKET_OTHERHOST, + }; /** * \param device a pointer to the net device which is calling this callback diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/model/nix-vector.cc --- a/src/network/model/nix-vector.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/model/nix-vector.cc Fri May 13 14:57:43 2011 -0400 @@ -50,7 +50,8 @@ m_used (o.m_used), m_currentVectorBitSize (o.m_currentVectorBitSize), m_totalBitSize (o.m_totalBitSize) -{} +{ +} NixVector & NixVector::operator = (const NixVector &o) @@ -124,7 +125,7 @@ // there newBits = newBits >> (32 - m_currentVectorBitSize); m_nixVector.push_back (newBits); - + // also reset number of bits in // m_currentVectorBitSize // because we are working with a new @@ -142,7 +143,7 @@ // NixVector newBits = newBits << m_currentVectorBitSize; newBits |= m_nixVector.back (); - + // Now insert the new NixVector and // increment number of bits for // m_currentVectorBitSize and m_totalBitSize @@ -170,7 +171,7 @@ if (numberOfBits > totalRemainingBits) { NS_FATAL_ERROR ("You've tried to extract too many bits of the Nix-vector, " << this << ". NumberBits: " - << numberOfBits << " Remaining: " << totalRemainingBits); + << numberOfBits << " Remaining: " << totalRemainingBits); } if (numberOfBits <= 0) @@ -212,7 +213,7 @@ { uint32_t totalSizeInBytes = 0; totalSizeInBytes = sizeof (m_used) + sizeof (m_currentVectorBitSize) + - sizeof (m_totalBitSize) + (4 * m_nixVector.size ()); + sizeof (m_totalBitSize) + (4 * m_nixVector.size ()); return totalSizeInBytes; } @@ -323,7 +324,7 @@ // all this work just to get the nix // vector to print out neat - + // if it's not the first entry in the vector, // we may have to add some zeros and fill // out the vector @@ -365,7 +366,7 @@ // Given the numberOfNeighbors, return the number // of bits needed (essentially, log2(numberOfNeighbors-1) uint32_t bitCount = 0; - + if (numberOfNeighbors < 2) { return 1; diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/model/nix-vector.h --- a/src/network/model/nix-vector.h Fri May 13 14:57:10 2011 -0400 +++ b/src/network/model/nix-vector.h Fri May 13 14:57:43 2011 -0400 @@ -33,7 +33,7 @@ * \brief Neighbor-index data structure for nix-vector routing * * This data structure holds a vector of "neighbor-indexes" for - * a simulation specific routing protocol, nix-vector routing. + * a simulation specific routing protocol, nix-vector routing. * Theses neighbor-indexes correspond to the net-device which a * node should use to route a packet. A nix-vector is built * (or fetched from a cache) on-demand. The nix-vector is @@ -62,126 +62,126 @@ class NixVector : public SimpleRefCount { - public: - NixVector (); - ~NixVector (); - /** - * \return a copy of this nix-vector - */ - Ptr Copy (void) const; - /** - * \param o the NixVector to copy to a new NixVector - * using a constructor - */ - NixVector (const NixVector &o); - /** - * \param o the NixVector to copy to a new NixVector using the - * equals operator - */ - NixVector &operator = (const NixVector &o); - /** - * \param newBits the neighbor-index to be added to the vector - * \param numberOfBits the number of bits that newBits contains - * - * Adds the neighbor index to the vector using a fair amount of - * bit manipulation to pack everything in efficiently. - * - * Note: This function assumes that the number of bits to be added - * is always less than or equal to 32, ie., you can only span one - * entry of a nix-vector at a time. This is reasonable, since 32 - * bits gives you 2^32 possible neighbors. - */ - void AddNeighborIndex (uint32_t newBits, uint32_t numberOfBits); - /** - * \return the neighbor index - * - * \param numberOfBits the number of bits to extract from the vector - * - * Extracts the number of bits specified from - * the vector and returns the value extracted - * - * Note: This function assumes that the number of bits to be extracted - * is always less than or equal to 32, ie., you can only span one - * entry of a nix-vector at a time. This is reasonable, since 32 - * bits gives you 2^32 possible neighbors. - */ - uint32_t ExtractNeighborIndex (uint32_t numberOfBits); - /** - * \return number of bits remaining in the - * nix-vector (ie m_total - m_used) - */ - uint32_t GetRemainingBits (void); - /** - * \return the number of bytes required for serialization - */ - uint32_t GetSerializedSize (void) const; - /** - * \return zero if buffer not large enough - * - * \param buffer points to serialization buffer - * - * \param maxSize max number of bytes to write - * - * This nix-vector is serialized into the raw character - * buffer parameter. - */ - uint32_t Serialize (uint32_t* buffer, uint32_t maxSize) const; - /** - * \return zero if a complete nix-vector is not deserialized - * - * \param buffer points to buffer for deserialization - * - * \param size number of bytes to deserialize - * - * The raw character buffer containing all the nix-vector - * information is deserialized into this nix-vector. - */ - uint32_t Deserialize (const uint32_t* buffer, uint32_t size); - /** - * \return number of bits of numberOfNeighbors - * - * \param numberOfNeighbors the total number of neighbors - * - * This function is used to determine the number of bits of - * numberOfNeighbors so that this value can be passed in to - * AddNeighborIndex or ExtractNeighborIndex. - */ - uint32_t BitCount (uint32_t numberOfNeighbors) const; +public: + NixVector (); + ~NixVector (); + /** + * \return a copy of this nix-vector + */ + Ptr Copy (void) const; + /** + * \param o the NixVector to copy to a new NixVector + * using a constructor + */ + NixVector (const NixVector &o); + /** + * \param o the NixVector to copy to a new NixVector using the + * equals operator + */ + NixVector &operator = (const NixVector &o); + /** + * \param newBits the neighbor-index to be added to the vector + * \param numberOfBits the number of bits that newBits contains + * + * Adds the neighbor index to the vector using a fair amount of + * bit manipulation to pack everything in efficiently. + * + * Note: This function assumes that the number of bits to be added + * is always less than or equal to 32, ie., you can only span one + * entry of a nix-vector at a time. This is reasonable, since 32 + * bits gives you 2^32 possible neighbors. + */ + void AddNeighborIndex (uint32_t newBits, uint32_t numberOfBits); + /** + * \return the neighbor index + * + * \param numberOfBits the number of bits to extract from the vector + * + * Extracts the number of bits specified from + * the vector and returns the value extracted + * + * Note: This function assumes that the number of bits to be extracted + * is always less than or equal to 32, ie., you can only span one + * entry of a nix-vector at a time. This is reasonable, since 32 + * bits gives you 2^32 possible neighbors. + */ + uint32_t ExtractNeighborIndex (uint32_t numberOfBits); + /** + * \return number of bits remaining in the + * nix-vector (ie m_total - m_used) + */ + uint32_t GetRemainingBits (void); + /** + * \return the number of bytes required for serialization + */ + uint32_t GetSerializedSize (void) const; + /** + * \return zero if buffer not large enough + * + * \param buffer points to serialization buffer + * + * \param maxSize max number of bytes to write + * + * This nix-vector is serialized into the raw character + * buffer parameter. + */ + uint32_t Serialize (uint32_t* buffer, uint32_t maxSize) const; + /** + * \return zero if a complete nix-vector is not deserialized + * + * \param buffer points to buffer for deserialization + * + * \param size number of bytes to deserialize + * + * The raw character buffer containing all the nix-vector + * information is deserialized into this nix-vector. + */ + uint32_t Deserialize (const uint32_t* buffer, uint32_t size); + /** + * \return number of bits of numberOfNeighbors + * + * \param numberOfNeighbors the total number of neighbors + * + * This function is used to determine the number of bits of + * numberOfNeighbors so that this value can be passed in to + * AddNeighborIndex or ExtractNeighborIndex. + */ + uint32_t BitCount (uint32_t numberOfNeighbors) const; - private: - typedef std::vector NixBits_t; +private: + typedef std::vector NixBits_t; + + /* for printing of nix-vector */ + void DumpNixVector (std::ostream &os) const; + /* for printing of nix-vector */ + friend std::ostream & operator <<( std::ostream &outs, const NixVector &nix); - /* for printing of nix-vector */ - void DumpNixVector (std::ostream &os) const; - /* for printing of nix-vector */ - friend std::ostream & operator <<( std::ostream &outs, const NixVector &nix); + /* the actual nix-vector */ + NixBits_t m_nixVector; - /* the actual nix-vector */ - NixBits_t m_nixVector; + /* for tracking where we are + * in the nix-vector + */ + uint32_t m_used; - /* for tracking where we are - * in the nix-vector - */ - uint32_t m_used; - - /* for tracking how many bits we - * have used in the current vector - * entry. need this in order to - * expand the vector passed 32bits - */ - uint32_t m_currentVectorBitSize; + /* for tracking how many bits we + * have used in the current vector + * entry. need this in order to + * expand the vector passed 32bits + */ + uint32_t m_currentVectorBitSize; - /* a counter of how total bits are in - * the nix-vector - */ - uint32_t m_totalBitSize; + /* a counter of how total bits are in + * the nix-vector + */ + uint32_t m_totalBitSize; - /* internal for pretty printing of nix-vector */ - void PrintDec2BinNixFill (uint32_t, uint32_t, std::ostream &os) const; + /* internal for pretty printing of nix-vector */ + void PrintDec2BinNixFill (uint32_t, uint32_t, std::ostream &os) const; - /* internal for pretty printing of nix-vector */ - void PrintDec2BinNix (uint32_t, uint32_t, std::ostream &os) const; + /* internal for pretty printing of nix-vector */ + void PrintDec2BinNix (uint32_t, uint32_t, std::ostream &os) const; }; } // namespace ns3 diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/model/node-list.cc --- a/src/network/model/node-list.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/model/node-list.cc Fri May 13 14:57:43 2011 -0400 @@ -48,7 +48,7 @@ uint32_t GetNNodes (void); static Ptr Get (void); - + private: virtual void DoDispose (void); static Ptr *DoGet (void); @@ -67,7 +67,7 @@ ObjectVectorValue (), MakeObjectVectorAccessor (&NodeListPriv::m_nodes), MakeObjectVectorChecker ()) - ; + ; return tid; } @@ -75,7 +75,7 @@ NodeListPriv::Get (void) { return *DoGet (); -} +} Ptr * NodeListPriv::DoGet (void) { @@ -102,7 +102,8 @@ NS_LOG_FUNCTION_NOARGS (); } NodeListPriv::~NodeListPriv () -{} +{ +} void NodeListPriv::DoDispose (void) { @@ -126,7 +127,7 @@ m_nodes.push_back (node); Simulator::ScheduleWithContext (index, TimeStep (0), &Node::Start, node); return index; - + } NodeList::Iterator NodeListPriv::Begin (void) const @@ -187,4 +188,4 @@ return NodeListPriv::Get ()->GetNNodes (); } -}//namespace ns3 +} //namespace ns3 diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/model/node-list.h --- a/src/network/model/node-list.h Fri May 13 14:57:10 2011 -0400 +++ b/src/network/model/node-list.h Fri May 13 14:57:43 2011 -0400 @@ -71,7 +71,7 @@ static uint32_t GetNNodes (void); }; -}//namespace ns3 +} //namespace ns3 #endif /* NODE_LIST_H */ diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/model/node.cc --- a/src/network/model/node.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/model/node.cc Fri May 13 14:57:43 2011 -0400 @@ -34,7 +34,7 @@ NS_LOG_COMPONENT_DEFINE ("Node"); -namespace ns3{ +namespace ns3 { NS_OBJECT_ENSURE_REGISTERED (Node); @@ -62,7 +62,7 @@ UintegerValue (0), MakeUintegerAccessor (&Node::m_id), MakeUintegerChecker ()) - ; + ; return tid; } @@ -85,23 +85,24 @@ { m_id = NodeList::Add (this); } - + Node::~Node () -{} +{ +} -uint32_t +uint32_t Node::GetId (void) const { return m_id; } -uint32_t +uint32_t Node::GetSystemId (void) const { return m_sid; } -uint32_t +uint32_t Node::AddDevice (Ptr device) { uint32_t index = m_devices.size (); @@ -187,7 +188,7 @@ Ptr application = *i; application->Start (); } - + Object::DoStart (); } @@ -274,8 +275,8 @@ "make sure the channels in use are correctly updating events context " << "when transfering events from one node to another."); NS_LOG_DEBUG("Node " << GetId () << " ReceiveFromDevice: dev " - << device->GetIfIndex () << " (type=" << device->GetInstanceTypeId ().GetName () - << ") Packet UID " << packet->GetUid ()); + << device->GetIfIndex () << " (type=" << device->GetInstanceTypeId ().GetName () + << ") Packet UID " << packet->GetUid ()); bool found = false; for (ProtocolHandlerList::iterator i = m_handlers.begin (); @@ -298,4 +299,4 @@ return found; } -}//namespace ns3 +} //namespace ns3 diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/model/node.h --- a/src/network/model/node.h Fri May 13 14:57:10 2011 -0400 +++ b/src/network/model/node.h Fri May 13 14:57:43 2011 -0400 @@ -145,7 +145,7 @@ * \param packetType type of packet received * (broadcast/multicast/unicast/otherhost); Note: * this value is only valid for promiscuous mode - * protocol handlers. + * protocol handlers. */ typedef Callback, Ptr,uint16_t,const Address &, const Address &, NetDevice::PacketType> ProtocolHandler; @@ -174,7 +174,7 @@ */ void UnregisterProtocolHandler (ProtocolHandler handler); - + /** * \returns true if checksums are enabled, false otherwise. */ diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/model/socket-factory.cc --- a/src/network/model/socket-factory.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/model/socket-factory.cc Fri May 13 14:57:43 2011 -0400 @@ -31,6 +31,7 @@ } SocketFactory::SocketFactory () -{} +{ +} } // namespace ns3 diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/model/socket-factory.h --- a/src/network/model/socket-factory.h Fri May 13 14:57:10 2011 -0400 +++ b/src/network/model/socket-factory.h Fri May 13 14:57:43 2011 -0400 @@ -33,14 +33,14 @@ * \brief Object to create transport layer instances that provide a * socket API to applications. * - * This base class defines the API for creating sockets. + * This base class defines the API for creating sockets. * The socket factory also can hold the global variables used to * initialize newly created sockets, such as values that are * set through the sysctl or proc interfaces in Linux. * If you want to write a new transport protocol accessible through * sockets, you need to subclass this factory class, implement CreateSocket, - * instantiate the object, and aggregate it to the node. + * instantiate the object, and aggregate it to the node. * * \see Udp * \see UdpImpl diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/model/socket.cc --- a/src/network/model/socket.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/model/socket.cc Fri May 13 14:57:43 2011 -0400 @@ -289,7 +289,7 @@ void Socket::DoDispose (void) { - + m_connectionSucceeded = MakeNullCallback > (); m_connectionFailed = MakeNullCallback > (); m_connectionRequest = MakeNullCallback, const Address &> (); @@ -313,7 +313,7 @@ break; } } - NS_ASSERT_MSG (found, "Socket cannot be bound to a NetDevice not existing on the Node"); + NS_ASSERT_MSG (found, "Socket cannot be bound to a NetDevice not existing on the Node"); } m_boundnetdevice = netdevice; return; @@ -336,7 +336,7 @@ * Socket Tags ***************************************************************/ -SocketAddressTag::SocketAddressTag () +SocketAddressTag::SocketAddressTag () { } @@ -360,7 +360,7 @@ static TypeId tid = TypeId ("ns3::SocketAddressTag") .SetParent () .AddConstructor () - ; + ; return tid; } TypeId @@ -389,7 +389,7 @@ os << "address=" << m_address; } -SocketIpTtlTag::SocketIpTtlTag () +SocketIpTtlTag::SocketIpTtlTag () { } @@ -413,7 +413,7 @@ static TypeId tid = TypeId ("ns3::SocketIpTtlTag") .SetParent () .AddConstructor () - ; + ; return tid; } TypeId @@ -445,18 +445,19 @@ SocketSetDontFragmentTag::SocketSetDontFragmentTag () -{} -void +{ +} +void SocketSetDontFragmentTag::Enable (void) { m_dontFragment = true; } -void +void SocketSetDontFragmentTag::Disable (void) { m_dontFragment = false; } -bool +bool SocketSetDontFragmentTag::IsEnabled (void) const { return m_dontFragment; @@ -470,7 +471,7 @@ static TypeId tid = TypeId ("ns3::SocketSetDontFragmentTag") .SetParent () .AddConstructor () - ; + ; return tid; } TypeId @@ -486,17 +487,17 @@ void SocketSetDontFragmentTag::Serialize (TagBuffer i) const { - i.WriteU8 (m_dontFragment?1:0); + i.WriteU8 (m_dontFragment ? 1 : 0); } void SocketSetDontFragmentTag::Deserialize (TagBuffer i) { - m_dontFragment = (i.ReadU8 () == 1)?true:false; + m_dontFragment = (i.ReadU8 () == 1) ? true : false; } void SocketSetDontFragmentTag::Print (std::ostream &os) const { - os << (m_dontFragment?"true":"false"); + os << (m_dontFragment ? "true" : "false"); } -}//namespace ns3 +} //namespace ns3 diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/model/socket.h --- a/src/network/model/socket.h Fri May 13 14:57:10 2011 -0400 +++ b/src/network/model/socket.h Fri May 13 14:57:43 2011 -0400 @@ -54,11 +54,11 @@ * must make use of the callbacks provided. * - It also uses class ns3::Packet as a fancy byte buffer, allowing * data to be passed across the API using an ns-3 Packet instead of - * a raw data pointer. + * a raw data pointer. * - Not all of the full POSIX sockets API is supported * * Other than that, it tries to stick to the BSD API to make it - * easier for those who know the BSD API to use this API. + * easier for those who know the BSD API to use this API. * More details are provided in the ns-3 tutorial. */ class Socket : public Object @@ -130,21 +130,21 @@ */ void SetConnectCallback (Callback > connectionSucceeded, Callback > connectionFailed); - /** - * \brief Detect socket recv() events such as graceful shutdown or error. - * - * For connection-oriented sockets, the first callback is used to signal - * that the remote side has gracefully shut down the connection, and the - * second callback denotes an error corresponding to cases in which - * a traditional recv() socket call might return -1 (error), such - * as a connection reset. For datagram sockets, these callbacks may - * never be invoked. - * - * \param normalClose this callback is invoked when the - * peer closes the connection gracefully - * \param errorClose this callback is invoked when the - * connection closes abnormally - */ + /** + * \brief Detect socket recv() events such as graceful shutdown or error. + * + * For connection-oriented sockets, the first callback is used to signal + * that the remote side has gracefully shut down the connection, and the + * second callback denotes an error corresponding to cases in which + * a traditional recv() socket call might return -1 (error), such + * as a connection reset. For datagram sockets, these callbacks may + * never be invoked. + * + * \param normalClose this callback is invoked when the + * peer closes the connection gracefully + * \param errorClose this callback is invoked when the + * connection closes abnormally + */ void SetCloseCallbacks (Callback > normalClose, Callback > errorClose); /** @@ -165,9 +165,9 @@ * port number of the connection originator. */ void SetAcceptCallback (Callback, - const Address &> connectionRequest, + const Address &> connectionRequest, Callback, - const Address&> newConnectionCreated); + const Address&> newConnectionCreated); /** * \brief Notify application when a packet has been sent from transport * protocol (non-standard socket call) @@ -176,14 +176,14 @@ * pointer to the socket, and the number of bytes sent. */ void SetDataSentCallback (Callback, - uint32_t> dataSent); + uint32_t> dataSent); /** * \brief Notify application when space in transmit buffer is added * * This callback is intended to notify a * socket that would have been blocked in a blocking socket model * that space is available in the transmit buffer and that it - * can call Send() again. + * can call Send() again. * * \param sendCb Callback for the event that the socket transmit buffer * fill level has decreased. This callback is passed a pointer to @@ -245,7 +245,7 @@ * \param address Address of remote. */ virtual int Connect (const Address &address) = 0; - + /** * \brief Listen for incoming connections. * \returns 0 on success, -1 on error (in which case errno is set). @@ -282,12 +282,12 @@ * I/O model for send(). * * This variant of Send() uses class ns3::Packet to encapsulate - * data, rather than providing a raw pointer and length field. + * data, rather than providing a raw pointer and length field. * This allows an ns-3 application to attach tags if desired (such * as a flow ID) and may allow the simulator to avoid some data * copies. Despite the appearance of sending Packets on a stream * socket, just think of it as a fancy byte buffer with streaming - * semantics. + * semantics. * * If either the message buffer within the Packet is too long to pass * atomically through the underlying protocol (for datagram sockets), @@ -297,10 +297,10 @@ * split the Packet (based on information obtained from * GetTxAvailable) and reattempt to send the data. * - * The flags argument is formed by or'ing one or more of the values: + * The flags argument is formed by or'ing one or more of the values: * MSG_OOB process out-of-band data * MSG_DONTROUTE bypass routing, use direct interface - * These flags are _unsupported_ as of ns-3.1. + * These flags are _unsupported_ as of ns-3.1. * * \param p ns3::Packet to send * \param flags Socket control flags @@ -325,7 +325,7 @@ * internal buffer and accepted for transmission. */ virtual int SendTo (Ptr p, uint32_t flags, - const Address &toAddress) = 0; + const Address &toAddress) = 0; /** * Return number of bytes which can be returned from one or @@ -346,7 +346,7 @@ * * This method is normally used only on a connected socket. * In a typical blocking sockets model, this call would block until - * at least one byte is returned or the connection closes. + * at least one byte is returned or the connection closes. * In ns-3 at this API, the call returns immediately in such a case * and returns 0 if nothing is available to be read. * However, an application can set a callback, ns3::SetRecvCallback, @@ -355,20 +355,20 @@ * I/O model for recv(). * * This variant of Recv() uses class ns3::Packet to encapsulate - * data, rather than providing a raw pointer and length field. + * data, rather than providing a raw pointer and length field. * This allows an ns-3 application to attach tags if desired (such * as a flow ID) and may allow the simulator to avoid some data * copies. Despite the appearance of receiving Packets on a stream * socket, just think of it as a fancy byte buffer with streaming - * semantics. + * semantics. * * The semantics depend on the type of socket. For a datagram socket, * each Recv() returns the data from at most one Send(), and order * is not necessarily preserved. For a stream socket, the bytes * are delivered in order, and on-the-wire packet boundaries are - * not preserved. + * not preserved. * - * The flags argument is formed by or'ing one or more of the values: + * The flags argument is formed by or'ing one or more of the values: * MSG_OOB process out-of-band data * MSG_PEEK peek at incoming message * None of these flags are supported for now. @@ -394,8 +394,8 @@ * Calls Recv(maxSize, flags) with maxSize * implicitly set to maximum sized integer, and flags set to zero. * - * This method has similar semantics to Recv () but subclasses may - * want to provide checks on socket state, so the implementation is + * This method has similar semantics to Recv () but subclasses may + * want to provide checks on socket state, so the implementation is * pushed to subclasses. * * \param maxSize reader will accept packet up to maxSize @@ -406,8 +406,8 @@ * \returns Ptr of the next in-sequence packet. Returns * 0 if the socket cannot return a next in-sequence packet. */ - virtual Ptr RecvFrom (uint32_t maxSize, uint32_t flags, - Address &fromAddress) = 0; + virtual Ptr RecvFrom (uint32_t maxSize, uint32_t flags, + Address &fromAddress) = 0; ///////////////////////////////////////////////////////////////////// // The remainder of these public methods are overloaded methods // @@ -429,7 +429,7 @@ * \brief Send data (or dummy data) to the remote host * * This method is provided so as to have an API which is closer in - * appearance to that of real network or BSD sockets. + * appearance to that of real network or BSD sockets. * * \param buf A pointer to a raw byte buffer of some data to send. If * this buffer is 0, we send dummy data whose size is specified by the @@ -438,15 +438,15 @@ * \param flags Socket control flags */ int Send (const uint8_t* buf, uint32_t size, uint32_t flags); - + /** * \brief Send data to a specified peer. * * This method is provided so as to have an API which is closer in - * appearance to that of real network or BSD sockets. + * appearance to that of real network or BSD sockets. * - * \param buf A pointer to a raw byte buffer of some data to send. + * \param buf A pointer to a raw byte buffer of some data to send. * If this is 0, we send dummy data whose size is specified by the * third parameter * \param size the number of bytes to copy from the buffer @@ -468,13 +468,13 @@ * \returns Ptr of the next in-sequence packet. Returns * 0 if the socket cannot return a next in-sequence packet. */ - Ptr Recv (void); + Ptr Recv (void); /** * \brief Recv data (or dummy data) from the remote host * * This method is provided so as to have an API which is closer in - * appearance to that of real network or BSD sockets. + * appearance to that of real network or BSD sockets. * * If the underlying packet was carring null (fake) data, this buffer * will be zeroed up to the length specified by the return value. @@ -506,7 +506,7 @@ * address. * * This method is provided so as to have an API which is closer in - * appearance to that of real network or BSD sockets. + * appearance to that of real network or BSD sockets. * * \param buf A pointer to a raw byte buffer to write the data to. * If the underlying packet was carring null (fake) data, this buffer @@ -551,7 +551,7 @@ * \brief Returns socket's bound netdevice, if any. * * This method corresponds to using getsockopt() SO_BINDTODEVICE - * of real network or BSD sockets. + * of real network or BSD sockets. * * * \returns Pointer to interface. @@ -630,7 +630,7 @@ void SetAddress (Address addr); Address GetAddress (void) const; - static TypeId GetTypeId (void); + static TypeId GetTypeId (void); virtual TypeId GetInstanceTypeId (void) const; virtual uint32_t GetSerializedSize (void) const; virtual void Serialize (TagBuffer i) const; @@ -652,7 +652,7 @@ void SetTtl (uint8_t ttl); uint8_t GetTtl (void) const; - static TypeId GetTypeId (void); + static TypeId GetTypeId (void); virtual TypeId GetInstanceTypeId (void) const; virtual uint32_t GetSerializedSize (void) const; virtual void Serialize (TagBuffer i) const; @@ -676,7 +676,7 @@ void Disable (void); bool IsEnabled (void) const; - static TypeId GetTypeId (void); + static TypeId GetTypeId (void); virtual TypeId GetInstanceTypeId (void) const; virtual uint32_t GetSerializedSize (void) const; virtual void Serialize (TagBuffer i) const; diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/model/tag-buffer.cc --- a/src/network/model/tag-buffer.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/model/tag-buffer.cc Fri May 13 14:57:43 2011 -0400 @@ -49,7 +49,7 @@ } -uint8_t +uint8_t TagBuffer::ReadU8 (void) { NS_ASSERT (m_current + 1 <= m_end); @@ -169,16 +169,17 @@ TagBuffer::TagBuffer (uint8_t *start, uint8_t *end) : m_current (start), m_end (end) -{} +{ +} -void +void TagBuffer::TrimAtEnd (uint32_t trim) { NS_ASSERT (m_current <= (m_end - trim)); m_end -= trim; } -void +void TagBuffer::CopyFrom (TagBuffer o) { NS_ASSERT (o.m_end >= o.m_current); diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/model/tag-buffer.h --- a/src/network/model/tag-buffer.h Fri May 13 14:57:10 2011 -0400 +++ b/src/network/model/tag-buffer.h Fri May 13 14:57:43 2011 -0400 @@ -139,7 +139,7 @@ */ void Read (uint8_t *buffer, uint32_t size); private: - + uint8_t *m_current; uint8_t *m_end; }; @@ -175,7 +175,7 @@ WriteU8 ((data >> 24) & 0xff); } -uint8_t +uint8_t TagBuffer::ReadU8 (void) { NS_ASSERT (m_current + 1 <= m_end); diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/model/tag.cc --- a/src/network/model/tag.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/model/tag.cc Fri May 13 14:57:43 2011 -0400 @@ -28,7 +28,7 @@ { static TypeId tid = TypeId ("ns3::Tag") .SetParent () - ; + ; return tid; } diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/model/trailer.cc --- a/src/network/model/trailer.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/model/trailer.cc Fri May 13 14:57:43 2011 -0400 @@ -5,14 +5,15 @@ NS_OBJECT_ENSURE_REGISTERED (Trailer); Trailer::~Trailer () -{} +{ +} -TypeId +TypeId Trailer::GetTypeId (void) { static TypeId tid = TypeId ("ns3::Trailer") .SetParent () - ; + ; return tid; } diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/test/buffer-test.cc --- a/src/network/test/buffer-test.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/test/buffer-test.cc Fri May 13 14:57:43 2011 -0400 @@ -61,10 +61,10 @@ * available which is the case for gcc. * XXX */ -#define ENSURE_WRITTEN_BYTES(buffer, n, ...) \ - { \ - uint8_t bytes[] = {__VA_ARGS__}; \ - EnsureWrittenBytes (buffer, n, bytes, __FILE__, __LINE__); \ +#define ENSURE_WRITTEN_BYTES(buffer, n, ...) \ + { \ + uint8_t bytes[] = { __VA_ARGS__}; \ + EnsureWrittenBytes (buffer, n, bytes, __FILE__, __LINE__); \ } void diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/test/drop-tail-queue-test-suite.cc --- a/src/network/test/drop-tail-queue-test-suite.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/test/drop-tail-queue-test-suite.cc Fri May 13 14:57:43 2011 -0400 @@ -31,14 +31,15 @@ DropTailQueueTestCase::DropTailQueueTestCase () : TestCase ("Sanity check on the drop tail queue implementation") -{} -void +{ +} +void DropTailQueueTestCase::DoRun (void) { Ptr queue = CreateObject (); - NS_TEST_EXPECT_MSG_EQ (queue->SetAttributeFailSafe ("MaxPackets", UintegerValue (3)), true, + NS_TEST_EXPECT_MSG_EQ (queue->SetAttributeFailSafe ("MaxPackets", UintegerValue (3)), true, "Verify that we can actually set the attribute"); - + Ptr p1, p2, p3, p4; p1 = Create (); p2 = Create (); diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/test/packet-metadata-test.cc --- a/src/network/test/packet-metadata-test.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/test/packet-metadata-test.cc Fri May 13 14:57:43 2011 -0400 @@ -47,20 +47,21 @@ { static TypeId tid = TypeId ("ns3::HistoryHeaderBase") .SetParent
() - ; + ; return tid; } HistoryHeaderBase::HistoryHeaderBase () : m_ok (true) -{} +{ +} -bool +bool HistoryHeaderBase::IsOk (void) const { return m_ok; } -void +void HistoryHeaderBase::ReportError (void) { m_ok = false; @@ -83,7 +84,8 @@ template HistoryHeader::HistoryHeader () : HistoryHeaderBase () -{} +{ +} template TypeId @@ -94,7 +96,7 @@ static TypeId tid = TypeId (oss.str ().c_str ()) .SetParent () .AddConstructor > () - ; + ; return tid; } @@ -153,18 +155,19 @@ { static TypeId tid = TypeId ("ns3::HistoryTrailerBase") .SetParent () - ; + ; return tid; } HistoryTrailerBase::HistoryTrailerBase () : m_ok (true) -{} -bool +{ +} +bool HistoryTrailerBase::IsOk (void) const { return m_ok; } -void +void HistoryTrailerBase::ReportError (void) { m_ok = false; @@ -189,7 +192,8 @@ template HistoryTrailer::HistoryTrailer () -{} +{ +} template TypeId @@ -200,7 +204,7 @@ static TypeId tid = TypeId (oss.str ().c_str ()) .SetParent () .AddConstructor > () - ; + ; return tid; } @@ -260,10 +264,12 @@ PacketMetadataTest::PacketMetadataTest () : TestCase ("Packet metadata") -{} +{ +} PacketMetadataTest::~PacketMetadataTest () -{} +{ +} void PacketMetadataTest::CheckHistory (Ptr p, const char *file, int line, uint32_t n, ...) @@ -324,7 +330,7 @@ } for (std::list::iterator i = got.begin (), - j = expected.begin (); + j = expected.begin (); i != got.end (); i++, j++) { NS_ASSERT (j != expected.end ()); @@ -334,7 +340,7 @@ } } return; - error: +error: std::ostringstream failure; failure << "PacketMetadata error. Got:\""; for (std::list::iterator i = got.begin (); @@ -403,7 +409,7 @@ ADD_TRAILER (p, 100); CHECK_HISTORY (p, 2, 10, 100); - + p = Create (10); ADD_HEADER (p, 1); ADD_HEADER (p, 2); @@ -598,7 +604,7 @@ p = Create (2000); CHECK_HISTORY (p, 1, 2000); - + p = Create (); ADD_TRAILER (p, 10); ADD_HEADER (p, 5); @@ -712,7 +718,7 @@ REM_TRAILER (p1, 5); NS_TEST_EXPECT_MSG_EQ (p->GetSize (), 1015, "Correct size"); - + p = Create (1510); ADD_HEADER (p, 8); ADD_HEADER (p, 25); @@ -829,4 +835,4 @@ } PacketMetadataTestSuite g_packetMetadataTest; -}//namespace ns3 +} //namespace ns3 diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/test/packetbb-test-suite.cc --- a/src/network/test/packetbb-test-suite.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/test/packetbb-test-suite.cc Fri May 13 14:57:43 2011 -0400 @@ -33,7 +33,7 @@ { public: PbbTestCase (std::string name, Ptr packet, - uint8_t * buffer, uint32_t size); + uint8_t * buffer, uint32_t size); virtual ~PbbTestCase (void); protected: @@ -48,7 +48,7 @@ }; PbbTestCase::PbbTestCase (std::string name, Ptr packet, - uint8_t * buffer, uint32_t size) + uint8_t * buffer, uint32_t size) : TestCase (name) { m_refPacket = packet; @@ -66,9 +66,9 @@ PbbTestCase::DoRun (void) { NS_TEST_ASSERT_MSG_EQ (TestSerialize (), false, - "serialization failed"); + "serialization failed"); NS_TEST_ASSERT_MSG_EQ (TestDeserialize (), false, - "deserialization failed"); + "deserialization failed"); } bool @@ -79,13 +79,13 @@ m_refPacket->Serialize (newBuffer.Begin ()); NS_TEST_ASSERT_MSG_EQ_RETURNS_BOOL (newBuffer.GetSize (), m_refBuffer.GetSize (), - "serialization failed, buffers have different sizes"); + "serialization failed, buffers have different sizes"); int memrv = memcmp (newBuffer.PeekData (), m_refBuffer.PeekData (), - newBuffer.GetSize ()); + newBuffer.GetSize ()); NS_TEST_ASSERT_MSG_EQ_RETURNS_BOOL (memrv, 0, - "serialization faled, buffers differ"); + "serialization faled, buffers differ"); return GetErrorStatus (); } @@ -97,10 +97,10 @@ uint32_t numbytes = newPacket->Deserialize (m_refBuffer.Begin ()); NS_TEST_ASSERT_MSG_EQ_RETURNS_BOOL (numbytes, m_refBuffer.GetSize (), - "deserialization failed, did not use all bytes"); + "deserialization failed, did not use all bytes"); NS_TEST_ASSERT_MSG_EQ_RETURNS_BOOL (*newPacket, *m_refPacket, - "deserialization failed, objects do not match"); + "deserialization failed, objects do not match"); return GetErrorStatus (); } @@ -115,16 +115,16 @@ : TestSuite ("packetbb-test-suite", UNIT) { /* Test 1 - * ,------------------ - * | PACKET - * |------------------ - * | * Packet version: 0 - * | * Packet flags: 0 - * `------------------ + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 0 + * `------------------ */ { Ptr packet = Create (); - uint8_t buffer[] = {0x00}; + uint8_t buffer[] = { 0x00}; AddTestCase (new PbbTestCase ("1", packet, buffer, sizeof(buffer))); } @@ -140,18 +140,18 @@ { Ptr packet = Create (); packet->SetSequenceNumber (2); - uint8_t buffer[] = {0x08, 0x00, 0x02}; + uint8_t buffer[] = { 0x08, 0x00, 0x02}; AddTestCase (new PbbTestCase ("2", packet, buffer, sizeof(buffer))); } /* Test 3 * ,------------------ - * | PACKET - * |------------------ - * | * Packet version: 0 - * | * Packet flags: 12 - * | * Packet seq number: 3 - * `------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 3 + * `------------------ * This test has the phastlv flag set to 1 with no tlvs. * I'll come back to this one later. */ @@ -159,23 +159,23 @@ { Ptr packet = Create (); packet->SetSequenceNumber (3); - uint8_t buffer[] = {0x0c, 0x00, 0x03, 0x00, 0x00}; + uint8_t buffer[] = { 0x0c, 0x00, 0x03, 0x00, 0x00}; AddTestCase (new PbbTestCase ("3", packet, buffer, sizeof(buffer))); } #endif /* Test 4 * ,------------------ - * | PACKET - * |------------------ - * | * Packet version: 0 - * | * Packet flags: 12 - * | * Packet seq number: 4 - * | | * Packet TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * `------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 4 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * `------------------ */ { Ptr packet = Create (); @@ -193,20 +193,20 @@ } /* Test 5 - * ,------------------ - * | PACKET - * |------------------ - * | * Packet version: 0 - * | * Packet flags: 12 - * | * Packet seq number: 5 - * | | * Packet TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | | - TLV - * | | Flags = 128 - * | | Type = 2; Type ext. = 100; Value = (warning: parameter is NULL) - * `------------------ + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 5 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | | - TLV + * | | Flags = 128 + * | | Type = 2; Type ext. = 100; Value = (warning: parameter is NULL) + * `------------------ */ { Ptr packet = Create (); @@ -230,21 +230,21 @@ } /* Test 6 - * ,------------------ - * | PACKET - * |------------------ - * | * Packet version: 0 - * | * Packet flags: 12 - * | * Packet seq number: 6 - * | | * Packet TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | | - TLV - * | | Flags = 144 - * | | Type = 2; Type ext. = 100; Value = 01 02 03 04 - * | | - * `------------------ + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 6 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | | - TLV + * | | Flags = 144 + * | | Type = 2; Type ext. = 100; Value = 01 02 03 04 + * | | + * `------------------ */ { Ptr packet = Create (); @@ -258,7 +258,7 @@ tlv2->SetType (2); tlv2->SetTypeExt (100); - uint8_t tlv2val[] = {1, 2, 3, 4}; + uint8_t tlv2val[] = { 1, 2, 3, 4}; tlv2->SetValue(tlv2val, sizeof(tlv2val)); packet->TlvPushBack (tlv2); @@ -273,95 +273,95 @@ } /* Test 7 - * ,------------------ - * | PACKET - * |------------------ - * | * Packet version: 0 - * | * Packet flags: 12 - * | * Packet seq number: 7 - * | | * Packet TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | | - TLV - * | | Flags = 152 - * | | Type = 2; Type ext. = 100; Value = 00 01 02 03 - * | | 04 05 06 07 - * | | 08 09 0a 0b - * | | 0c 0d 0e 0f - * | | 10 11 12 13 - * | | 14 15 16 17 - * | | 18 19 1a 1b - * | | 1c 1d 1e 1f - * | | 20 21 22 23 - * | | 24 25 26 27 - * | | 28 29 2a 2b - * | | 2c 2d 2e 2f - * | | 30 31 32 33 - * | | 34 35 36 37 - * | | 38 39 3a 3b - * | | 3c 3d 3e 3f - * | | 40 41 42 43 - * | | 44 45 46 47 - * | | 48 49 4a 4b - * | | 4c 4d 4e 4f - * | | 50 51 52 53 - * | | 54 55 56 57 - * | | 58 59 5a 5b - * | | 5c 5d 5e 5f - * | | 60 61 62 63 - * | | 64 65 66 67 - * | | 68 69 6a 6b - * | | 6c 6d 6e 6f - * | | 70 71 72 73 - * | | 74 75 76 77 - * | | 78 79 7a 7b - * | | 7c 7d 7e 7f - * | | 80 81 82 83 - * | | 84 85 86 87 - * | | 88 89 8a 8b - * | | 8c 8d 8e 8f - * | | 90 91 92 93 - * | | 94 95 96 97 - * | | 98 99 9a 9b - * | | 9c 9d 9e 9f - * | | a0 a1 a2 a3 - * | | a4 a5 a6 a7 - * | | a8 a9 aa ab - * | | ac ad ae af - * | | b0 b1 b2 b3 - * | | b4 b5 b6 b7 - * | | b8 b9 ba bb - * | | bc bd be bf - * | | c0 c1 c2 c3 - * | | c4 c5 c6 c7 - * | | c8 c9 ca cb - * | | cc cd ce cf - * | | d0 d1 d2 d3 - * | | d4 d5 d6 d7 - * | | d8 d9 da db - * | | dc dd de df - * | | e0 e1 e2 e3 - * | | e4 e5 e6 e7 - * | | e8 e9 ea eb - * | | ec ed ee ef - * | | f0 f1 f2 f3 - * | | f4 f5 f6 f7 - * | | f8 f9 fa fb - * | | fc fd fe 00 - * | | 01 02 03 04 - * | | 05 06 07 08 - * | | 09 0a 0b 0c - * | | 0d 0e 0f 10 - * | | 11 12 13 14 - * | | 15 16 17 18 - * | | 19 1a 1b 1c - * | | 1d 1e 1f 20 - * | | 21 22 23 24 - * | | 25 26 27 28 - * | | 29 2a 2b 2c - * | | - * `------------------ + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 7 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | | - TLV + * | | Flags = 152 + * | | Type = 2; Type ext. = 100; Value = 00 01 02 03 + * | | 04 05 06 07 + * | | 08 09 0a 0b + * | | 0c 0d 0e 0f + * | | 10 11 12 13 + * | | 14 15 16 17 + * | | 18 19 1a 1b + * | | 1c 1d 1e 1f + * | | 20 21 22 23 + * | | 24 25 26 27 + * | | 28 29 2a 2b + * | | 2c 2d 2e 2f + * | | 30 31 32 33 + * | | 34 35 36 37 + * | | 38 39 3a 3b + * | | 3c 3d 3e 3f + * | | 40 41 42 43 + * | | 44 45 46 47 + * | | 48 49 4a 4b + * | | 4c 4d 4e 4f + * | | 50 51 52 53 + * | | 54 55 56 57 + * | | 58 59 5a 5b + * | | 5c 5d 5e 5f + * | | 60 61 62 63 + * | | 64 65 66 67 + * | | 68 69 6a 6b + * | | 6c 6d 6e 6f + * | | 70 71 72 73 + * | | 74 75 76 77 + * | | 78 79 7a 7b + * | | 7c 7d 7e 7f + * | | 80 81 82 83 + * | | 84 85 86 87 + * | | 88 89 8a 8b + * | | 8c 8d 8e 8f + * | | 90 91 92 93 + * | | 94 95 96 97 + * | | 98 99 9a 9b + * | | 9c 9d 9e 9f + * | | a0 a1 a2 a3 + * | | a4 a5 a6 a7 + * | | a8 a9 aa ab + * | | ac ad ae af + * | | b0 b1 b2 b3 + * | | b4 b5 b6 b7 + * | | b8 b9 ba bb + * | | bc bd be bf + * | | c0 c1 c2 c3 + * | | c4 c5 c6 c7 + * | | c8 c9 ca cb + * | | cc cd ce cf + * | | d0 d1 d2 d3 + * | | d4 d5 d6 d7 + * | | d8 d9 da db + * | | dc dd de df + * | | e0 e1 e2 e3 + * | | e4 e5 e6 e7 + * | | e8 e9 ea eb + * | | ec ed ee ef + * | | f0 f1 f2 f3 + * | | f4 f5 f6 f7 + * | | f8 f9 fa fb + * | | fc fd fe 00 + * | | 01 02 03 04 + * | | 05 06 07 08 + * | | 09 0a 0b 0c + * | | 0d 0e 0f 10 + * | | 11 12 13 14 + * | | 15 16 17 18 + * | | 19 1a 1b 1c + * | | 1d 1e 1f 20 + * | | 21 22 23 24 + * | | 25 26 27 28 + * | | 29 2a 2b 2c + * | | + * `------------------ */ { Ptr packet = Create (); @@ -540,24 +540,24 @@ } /* Test 8 - * ,------------------ - * | PACKET - * |------------------ - * | * Packet version: 0 - * | * Packet flags: 12 - * | * Packet seq number: 8 - * | | * Packet TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 1 - * | | * Message flags: 0 - * | `------------------- - * | - * `------------------ + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 8 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | `------------------- + * | + * `------------------ */ { Ptr packet = Create (); @@ -581,32 +581,32 @@ } /* Test 9 - * ,------------------ - * | PACKET - * |------------------ - * | * Packet version: 0 - * | * Packet flags: 12 - * | * Packet seq number: 9 - * | | * Packet TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 1 - * | | * Message flags: 0 - * | `------------------- - * | - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 2 - * | | * Message flags: 128 - * | | * Originator address: 10.0.0.1 - * | `------------------- - * | - * `------------------ + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 9 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 128 + * | | * Originator address: 10.0.0.1 + * | `------------------- + * | + * `------------------ */ { Ptr packet = Create (); @@ -637,33 +637,33 @@ } /* Test 10 - * ,------------------ - * | PACKET - * |------------------ - * | * Packet version: 0 - * | * Packet flags: 12 - * | * Packet seq number: 10 - * | | * Packet TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 1 - * | | * Message flags: 0 - * | `------------------- - * | - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 2 - * | | * Message flags: 160 - * | | * Originator address: 10.0.0.1 - * | | * Hop count: 1 - * | `------------------- - * | - * `------------------ + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 10 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 160 + * | | * Originator address: 10.0.0.1 + * | | * Hop count: 1 + * | `------------------- + * | + * `------------------ */ { Ptr packet = Create (); @@ -695,34 +695,34 @@ } /* Test 11 - * ,------------------ - * | PACKET - * |------------------ - * | * Packet version: 0 - * | * Packet flags: 12 - * | * Packet seq number: 11 - * | | * Packet TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 1 - * | | * Message flags: 0 - * | `------------------- - * | - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 2 - * | | * Message flags: 224 - * | | * Originator address: 10.0.0.1 - * | | * Hop limit: 255 - * | | * Hop count: 1 - * | `------------------- - * | - * `------------------ + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 11 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 224 + * | | * Originator address: 10.0.0.1 + * | | * Hop limit: 255 + * | | * Hop count: 1 + * | `------------------- + * | + * `------------------ */ { Ptr packet = Create (); @@ -756,35 +756,35 @@ } /* Test 12 - * ,------------------ - * | PACKET - * |------------------ - * | * Packet version: 0 - * | * Packet flags: 12 - * | * Packet seq number: 12 - * | | * Packet TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 1 - * | | * Message flags: 0 - * | `------------------- - * | - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 2 - * | | * Message flags: 240 - * | | * Originator address: 10.0.0.1 - * | | * Hop limit: 255 - * | | * Hop count: 1 - * | | * Message seq number: 12345 - * | `------------------- - * | - * `------------------ + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 12 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 240 + * | | * Originator address: 10.0.0.1 + * | | * Hop limit: 255 + * | | * Hop count: 1 + * | | * Message seq number: 12345 + * | `------------------- + * | + * `------------------ */ { Ptr packet = Create (); @@ -819,35 +819,35 @@ } /* Test 13 - * ,------------------ - * | PACKET - * |------------------ - * | * Packet version: 0 - * | * Packet flags: 12 - * | * Packet seq number: 13 - * | | * Packet TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 1 - * | | * Message flags: 0 - * | `------------------- - * | - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 2 - * | | * Message flags: 240 - * | | * Originator address: 10.0.0.1 - * | | * Hop limit: 255 - * | | * Hop count: 1 - * | | * Message seq number: 12345 - * | `------------------- - * | - * `------------------ + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 13 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 240 + * | | * Originator address: 10.0.0.1 + * | | * Hop limit: 255 + * | | * Hop count: 1 + * | | * Message seq number: 12345 + * | `------------------- + * | + * `------------------ */ { Ptr packet = Create (); @@ -882,39 +882,39 @@ } /* Test 14 - * ,------------------ - * | PACKET - * |------------------ - * | * Packet version: 0 - * | * Packet flags: 12 - * | * Packet seq number: 14 - * | | * Packet TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 1 - * | | * Message flags: 0 - * | | * Message TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | `------------------- - * | - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 2 - * | | * Message flags: 240 - * | | * Originator address: 10.0.0.1 - * | | * Hop limit: 255 - * | | * Hop count: 1 - * | | * Message seq number: 12345 - * | `------------------- - * | - * `------------------ + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 14 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | | * Message TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 240 + * | | * Originator address: 10.0.0.1 + * | | * Hop limit: 255 + * | | * Hop count: 1 + * | | * Message seq number: 12345 + * | `------------------- + * | + * `------------------ */ { Ptr packet = Create (); @@ -955,43 +955,43 @@ } /* Test 15 - * ,------------------ - * | PACKET - * |------------------ - * | * Packet version: 0 - * | * Packet flags: 12 - * | * Packet seq number: 15 - * | | * Packet TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 1 - * | | * Message flags: 0 - * | | * Message TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | `------------------- - * | - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 2 - * | | * Message flags: 240 - * | | * Originator address: 10.0.0.1 - * | | * Hop limit: 255 - * | | * Hop count: 1 - * | | * Message seq number: 12345 - * | | - Address block (1 addresses) - * | | - 0.0.0.0/32 - * | | - Flags = 0 - * | | - ADDRESS TLV block (0 TLVs) - * | `------------------- - * | - * `------------------ + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 15 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | | * Message TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 240 + * | | * Originator address: 10.0.0.1 + * | | * Hop limit: 255 + * | | * Hop count: 1 + * | | * Message seq number: 12345 + * | | - Address block (1 addresses) + * | | - 0.0.0.0/32 + * | | - Flags = 0 + * | | - ADDRESS TLV block (0 TLVs) + * | `------------------- + * | + * `------------------ */ { Ptr packet = Create (); @@ -1039,43 +1039,43 @@ } /* Test 16 - * ,------------------ - * | PACKET - * |------------------ - * | * Packet version: 0 - * | * Packet flags: 12 - * | * Packet seq number: 16 - * | | * Packet TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 1 - * | | * Message flags: 0 - * | | * Message TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | `------------------- - * | - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 2 - * | | * Message flags: 240 - * | | * Originator address: 10.0.0.1 - * | | * Hop limit: 255 - * | | * Hop count: 1 - * | | * Message seq number: 12345 - * | | - Address block (1 addresses) - * | | - 255.255.255.255/32 - * | | - Flags = 0 - * | | - ADDRESS TLV block (0 TLVs) - * | `------------------- - * | - * `------------------ + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 16 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | | * Message TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 240 + * | | * Originator address: 10.0.0.1 + * | | * Hop limit: 255 + * | | * Hop count: 1 + * | | * Message seq number: 12345 + * | | - Address block (1 addresses) + * | | - 255.255.255.255/32 + * | | - Flags = 0 + * | | - ADDRESS TLV block (0 TLVs) + * | `------------------- + * | + * `------------------ */ { Ptr packet = Create (); @@ -1123,43 +1123,43 @@ } /* Test 17 - * ,------------------ - * | PACKET - * |------------------ - * | * Packet version: 0 - * | * Packet flags: 12 - * | * Packet seq number: 17 - * | | * Packet TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 1 - * | | * Message flags: 0 - * | | * Message TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | `------------------- - * | - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 2 - * | | * Message flags: 240 - * | | * Originator address: 10.0.0.1 - * | | * Hop limit: 255 - * | | * Hop count: 1 - * | | * Message seq number: 12345 - * | | - Address block (1 addresses) - * | | - 0.0.0.1/32 - * | | - Flags = 0 - * | | - ADDRESS TLV block (0 TLVs) - * | `------------------- - * | - * `------------------ + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 17 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | | * Message TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 240 + * | | * Originator address: 10.0.0.1 + * | | * Hop limit: 255 + * | | * Hop count: 1 + * | | * Message seq number: 12345 + * | | - Address block (1 addresses) + * | | - 0.0.0.1/32 + * | | - Flags = 0 + * | | - ADDRESS TLV block (0 TLVs) + * | `------------------- + * | + * `------------------ */ { Ptr packet = Create (); @@ -1207,43 +1207,43 @@ } /* Test 18 - * ,------------------ - * | PACKET - * |------------------ - * | * Packet version: 0 - * | * Packet flags: 12 - * | * Packet seq number: 18 - * | | * Packet TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 1 - * | | * Message flags: 0 - * | | * Message TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | `------------------- - * | - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 2 - * | | * Message flags: 240 - * | | * Originator address: 10.0.0.1 - * | | * Hop limit: 255 - * | | * Hop count: 1 - * | | * Message seq number: 12345 - * | | - Address block (1 addresses) - * | | - 10.0.0.0/32 - * | | - Flags = 0 - * | | - ADDRESS TLV block (0 TLVs) - * | `------------------- - * | - * `------------------ + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 18 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | | * Message TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 240 + * | | * Originator address: 10.0.0.1 + * | | * Hop limit: 255 + * | | * Hop count: 1 + * | | * Message seq number: 12345 + * | | - Address block (1 addresses) + * | | - 10.0.0.0/32 + * | | - Flags = 0 + * | | - ADDRESS TLV block (0 TLVs) + * | `------------------- + * | + * `------------------ */ { Ptr packet = Create (); @@ -1291,43 +1291,43 @@ } /* Test 19 - * ,------------------ - * | PACKET - * |------------------ - * | * Packet version: 0 - * | * Packet flags: 12 - * | * Packet seq number: 19 - * | | * Packet TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 1 - * | | * Message flags: 0 - * | | * Message TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | `------------------- - * | - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 2 - * | | * Message flags: 240 - * | | * Originator address: 10.0.0.1 - * | | * Hop limit: 255 - * | | * Hop count: 1 - * | | * Message seq number: 12345 - * | | - Address block (1 addresses) - * | | - 10.0.0.1/32 - * | | - Flags = 0 - * | | - ADDRESS TLV block (0 TLVs) - * | `------------------- - * | - * `------------------ + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 19 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | | * Message TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 240 + * | | * Originator address: 10.0.0.1 + * | | * Hop limit: 255 + * | | * Hop count: 1 + * | | * Message seq number: 12345 + * | | - Address block (1 addresses) + * | | - 10.0.0.1/32 + * | | - Flags = 0 + * | | - ADDRESS TLV block (0 TLVs) + * | `------------------- + * | + * `------------------ */ { Ptr packet = Create (); @@ -1375,44 +1375,44 @@ } /* Test 20 - * ,------------------ - * | PACKET - * |------------------ - * | * Packet version: 0 - * | * Packet flags: 12 - * | * Packet seq number: 20 - * | | * Packet TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 1 - * | | * Message flags: 0 - * | | * Message TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | `------------------- - * | - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 2 - * | | * Message flags: 240 - * | | * Originator address: 10.0.0.1 - * | | * Hop limit: 255 - * | | * Hop count: 1 - * | | * Message seq number: 12345 - * | | - Address block (2 addresses) - * | | - 10.0.0.1/32 - * | | - 10.0.0.2/32 - * | | - Flags = 128 - * | | - ADDRESS TLV block (0 TLVs) - * | `------------------- - * | - * `------------------ + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 20 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | | * Message TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 240 + * | | * Originator address: 10.0.0.1 + * | | * Hop limit: 255 + * | | * Hop count: 1 + * | | * Message seq number: 12345 + * | | - Address block (2 addresses) + * | | - 10.0.0.1/32 + * | | - 10.0.0.2/32 + * | | - Flags = 128 + * | | - ADDRESS TLV block (0 TLVs) + * | `------------------- + * | + * `------------------ */ { Ptr packet = Create (); @@ -1461,44 +1461,44 @@ } /* Test 21 - * ,------------------ - * | PACKET - * |------------------ - * | * Packet version: 0 - * | * Packet flags: 12 - * | * Packet seq number: 21 - * | | * Packet TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 1 - * | | * Message flags: 0 - * | | * Message TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | `------------------- - * | - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 2 - * | | * Message flags: 240 - * | | * Originator address: 10.0.0.1 - * | | * Hop limit: 255 - * | | * Hop count: 1 - * | | * Message seq number: 12345 - * | | - Address block (2 addresses) - * | | - 10.0.0.2/32 - * | | - 10.1.1.2/32 - * | | - Flags = 192 - * | | - ADDRESS TLV block (0 TLVs) - * | `------------------- - * | - * `------------------ + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 21 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | | * Message TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 240 + * | | * Originator address: 10.0.0.1 + * | | * Hop limit: 255 + * | | * Hop count: 1 + * | | * Message seq number: 12345 + * | | - Address block (2 addresses) + * | | - 10.0.0.2/32 + * | | - 10.1.1.2/32 + * | | - Flags = 192 + * | | - ADDRESS TLV block (0 TLVs) + * | `------------------- + * | + * `------------------ */ { Ptr packet = Create (); @@ -1548,49 +1548,49 @@ } /* Test 22 - * ,------------------ - * | PACKET - * |------------------ - * | * Packet version: 0 - * | * Packet flags: 12 - * | * Packet seq number: 22 - * | | * Packet TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 1 - * | | * Message flags: 0 - * | | * Message TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | `------------------- - * | - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 2 - * | | * Message flags: 240 - * | | * Originator address: 10.0.0.1 - * | | * Hop limit: 255 - * | | * Hop count: 1 - * | | * Message seq number: 12345 - * | | - Address block (2 addresses) - * | | - 10.0.0.2/32 - * | | - 10.1.1.2/32 - * | | - Flags = 192 - * | | - ADDRESS TLV block (0 TLVs) - * | | - Address block (2 addresses) - * | | - 10.0.0.0/32 - * | | - 11.0.0.0/32 - * | | - Flags = 32 - * | | - ADDRESS TLV block (0 TLVs) - * | `------------------- - * | - * `------------------ + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 22 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | | * Message TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 240 + * | | * Originator address: 10.0.0.1 + * | | * Hop limit: 255 + * | | * Hop count: 1 + * | | * Message seq number: 12345 + * | | - Address block (2 addresses) + * | | - 10.0.0.2/32 + * | | - 10.1.1.2/32 + * | | - Flags = 192 + * | | - ADDRESS TLV block (0 TLVs) + * | | - Address block (2 addresses) + * | | - 10.0.0.0/32 + * | | - 11.0.0.0/32 + * | | - Flags = 32 + * | | - ADDRESS TLV block (0 TLVs) + * | `------------------- + * | + * `------------------ */ { Ptr packet = Create (); @@ -1646,51 +1646,51 @@ } /* Test 23 - * ,------------------ - * | PACKET - * |------------------ - * | * Packet version: 0 - * | * Packet flags: 12 - * | * Packet seq number: 23 - * | | * Packet TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 1 - * | | * Message flags: 0 - * | | * Message TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | `------------------- - * | - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 2 - * | | * Message flags: 240 - * | | * Originator address: 10.0.0.1 - * | | * Hop limit: 255 - * | | * Hop count: 1 - * | | * Message seq number: 12345 - * | | - Address block (2 addresses) - * | | - 10.0.0.2/32 - * | | - 10.1.1.2/32 - * | | - Flags = 192 - * | | - ADDRESS TLV block (0 TLVs) - * | | - Address block (4 addresses) - * | | - 10.0.0.0/32 - * | | - 11.0.0.0/32 - * | | - 10.0.0.5/16 - * | | - 10.0.0.6/24 - * | | - Flags = 8 - * | | - ADDRESS TLV block (0 TLVs) - * | `------------------- - * | - * `------------------ + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 23 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | | * Message TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 240 + * | | * Originator address: 10.0.0.1 + * | | * Hop limit: 255 + * | | * Hop count: 1 + * | | * Message seq number: 12345 + * | | - Address block (2 addresses) + * | | - 10.0.0.2/32 + * | | - 10.1.1.2/32 + * | | - Flags = 192 + * | | - ADDRESS TLV block (0 TLVs) + * | | - Address block (4 addresses) + * | | - 10.0.0.0/32 + * | | - 11.0.0.0/32 + * | | - 10.0.0.5/16 + * | | - 10.0.0.6/24 + * | | - Flags = 8 + * | | - ADDRESS TLV block (0 TLVs) + * | `------------------- + * | + * `------------------ */ { Ptr packet = Create (); @@ -1759,54 +1759,54 @@ } /* Test 24 - * ,------------------ - * | PACKET - * |------------------ - * | * Packet version: 0 - * | * Packet flags: 12 - * | * Packet seq number: 24 - * | | * Packet TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 1 - * | | * Message flags: 0 - * | | * Message TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | `------------------- - * | - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 2 - * | | * Message flags: 240 - * | | * Originator address: 10.0.0.1 - * | | * Hop limit: 255 - * | | * Hop count: 1 - * | | * Message seq number: 12345 - * | | - Address block (2 addresses) - * | | - 10.0.0.2/32 - * | | - 10.1.1.2/32 - * | | - Flags = 192 - * | | - ADDRESS TLV block (0 TLVs) - * | | - Address block (4 addresses) - * | | - 10.0.0.0/32 - * | | - 11.0.0.0/32 - * | | - 10.0.0.5/16 - * | | - 10.0.0.6/24 - * | | - Flags = 8 - * | | - ADDRESS TLV block (1 TLVs) - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | `------------------- - * | - * `------------------ + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 24 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | | * Message TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 240 + * | | * Originator address: 10.0.0.1 + * | | * Hop limit: 255 + * | | * Hop count: 1 + * | | * Message seq number: 12345 + * | | - Address block (2 addresses) + * | | - 10.0.0.2/32 + * | | - 10.1.1.2/32 + * | | - Flags = 192 + * | | - ADDRESS TLV block (0 TLVs) + * | | - Address block (4 addresses) + * | | - 10.0.0.0/32 + * | | - 11.0.0.0/32 + * | | - 10.0.0.5/16 + * | | - 10.0.0.6/24 + * | | - Flags = 8 + * | | - ADDRESS TLV block (1 TLVs) + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | `------------------- + * | + * `------------------ */ { Ptr packet = Create (); @@ -1879,55 +1879,55 @@ } /* Test 25 - * ,------------------ - * | PACKET - * |------------------ - * | * Packet version: 0 - * | * Packet flags: 12 - * | * Packet seq number: 25 - * | | * Packet TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 1 - * | | * Message flags: 0 - * | | * Message TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | `------------------- - * | - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 2 - * | | * Message flags: 240 - * | | * Originator address: 10.0.0.1 - * | | * Hop limit: 255 - * | | * Hop count: 1 - * | | * Message seq number: 12345 - * | | - Address block (2 addresses) - * | | - 10.0.0.2/32 - * | | - 10.1.1.2/32 - * | | - Flags = 192 - * | | - ADDRESS TLV block (0 TLVs) - * | | - Address block (4 addresses) - * | | - 10.0.0.0/32 - * | | - 11.0.0.0/32 - * | | - 10.0.0.5/16 - * | | - 10.0.0.6/24 - * | | - Flags = 8 - * | | - ADDRESS TLV block (1 TLVs) - * | | - TLV - * | | Flags = 64 - * | | Index-start = 1 - * | | Type = 1; Value = (warning: parameter is NULL) - * | `------------------- - * | - * `------------------ + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 25 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | | * Message TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 240 + * | | * Originator address: 10.0.0.1 + * | | * Hop limit: 255 + * | | * Hop count: 1 + * | | * Message seq number: 12345 + * | | - Address block (2 addresses) + * | | - 10.0.0.2/32 + * | | - 10.1.1.2/32 + * | | - Flags = 192 + * | | - ADDRESS TLV block (0 TLVs) + * | | - Address block (4 addresses) + * | | - 10.0.0.0/32 + * | | - 11.0.0.0/32 + * | | - 10.0.0.5/16 + * | | - 10.0.0.6/24 + * | | - Flags = 8 + * | | - ADDRESS TLV block (1 TLVs) + * | | - TLV + * | | Flags = 64 + * | | Index-start = 1 + * | | Type = 1; Value = (warning: parameter is NULL) + * | `------------------- + * | + * `------------------ */ { Ptr packet = Create (); @@ -2001,56 +2001,56 @@ } /* Test 26 - * ,------------------ - * | PACKET - * |------------------ - * | * Packet version: 0 - * | * Packet flags: 12 - * | * Packet seq number: 26 - * | | * Packet TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 1 - * | | * Message flags: 0 - * | | * Message TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | `------------------- - * | - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 2 - * | | * Message flags: 240 - * | | * Originator address: 10.0.0.1 - * | | * Hop limit: 255 - * | | * Hop count: 1 - * | | * Message seq number: 12345 - * | | - Address block (2 addresses) - * | | - 10.0.0.2/32 - * | | - 10.1.1.2/32 - * | | - Flags = 192 - * | | - ADDRESS TLV block (0 TLVs) - * | | - Address block (4 addresses) - * | | - 10.0.0.0/32 - * | | - 11.0.0.0/32 - * | | - 10.0.0.5/16 - * | | - 10.0.0.6/24 - * | | - Flags = 8 - * | | - ADDRESS TLV block (1 TLVs) - * | | - TLV - * | | Flags = 32 - * | | Index-start = 1 - * | | Index-stop = 3 - * | | Type = 1; Value = (warning: parameter is NULL) - * | `------------------- - * | - * `------------------ + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 26 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | | * Message TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 240 + * | | * Originator address: 10.0.0.1 + * | | * Hop limit: 255 + * | | * Hop count: 1 + * | | * Message seq number: 12345 + * | | - Address block (2 addresses) + * | | - 10.0.0.2/32 + * | | - 10.1.1.2/32 + * | | - Flags = 192 + * | | - ADDRESS TLV block (0 TLVs) + * | | - Address block (4 addresses) + * | | - 10.0.0.0/32 + * | | - 11.0.0.0/32 + * | | - 10.0.0.5/16 + * | | - 10.0.0.6/24 + * | | - Flags = 8 + * | | - ADDRESS TLV block (1 TLVs) + * | | - TLV + * | | Flags = 32 + * | | Index-start = 1 + * | | Index-stop = 3 + * | | Type = 1; Value = (warning: parameter is NULL) + * | `------------------- + * | + * `------------------ */ { Ptr packet = Create (); @@ -2126,56 +2126,56 @@ } /* Test 27 - * ,------------------ - * | PACKET - * |------------------ - * | * Packet version: 0 - * | * Packet flags: 12 - * | * Packet seq number: 27 - * | | * Packet TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 1 - * | | * Message flags: 0 - * | | * Message TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | `------------------- - * | - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 2 - * | | * Message flags: 240 - * | | * Originator address: 10.0.0.1 - * | | * Hop limit: 255 - * | | * Hop count: 1 - * | | * Message seq number: 12345 - * | | - Address block (2 addresses) - * | | - 10.0.0.2/32 - * | | - 10.1.1.2/32 - * | | - Flags = 192 - * | | - ADDRESS TLV block (0 TLVs) - * | | - Address block (4 addresses) - * | | - 10.0.0.0/32 - * | | - 11.0.0.0/32 - * | | - 10.0.0.5/16 - * | | - 10.0.0.6/24 - * | | - Flags = 8 - * | | - ADDRESS TLV block (1 TLVs) - * | | - TLV - * | | Flags = 52 - * | | Index-start = 1 - * | | Index-stop = 3 - * | | Type = 1; Value = 01 02 03 - * | `------------------- - * | - * `------------------ + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 27 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | | * Message TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 240 + * | | * Originator address: 10.0.0.1 + * | | * Hop limit: 255 + * | | * Hop count: 1 + * | | * Message seq number: 12345 + * | | - Address block (2 addresses) + * | | - 10.0.0.2/32 + * | | - 10.1.1.2/32 + * | | - Flags = 192 + * | | - ADDRESS TLV block (0 TLVs) + * | | - Address block (4 addresses) + * | | - 10.0.0.0/32 + * | | - 11.0.0.0/32 + * | | - 10.0.0.5/16 + * | | - 10.0.0.6/24 + * | | - Flags = 8 + * | | - ADDRESS TLV block (1 TLVs) + * | | - TLV + * | | Flags = 52 + * | | Index-start = 1 + * | | Index-stop = 3 + * | | Type = 1; Value = 01 02 03 + * | `------------------- + * | + * `------------------ */ { Ptr packet = Create (); @@ -2222,7 +2222,7 @@ msg2a2tlv1->SetIndexStart (1); msg2a2tlv1->SetIndexStop (3); - uint8_t value[] = {1, 2, 3}; + uint8_t value[] = { 1, 2, 3}; msg2a2tlv1->SetValue(value, sizeof (value)); msg2a2tlv1->SetMultivalue (true); @@ -2257,131 +2257,131 @@ } /* Test 28 - * ,------------------ - * | PACKET - * |------------------ - * | * Packet version: 0 - * | * Packet flags: 12 - * | * Packet seq number: 28 - * | | * Packet TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 1 - * | | * Message flags: 0 - * | | * Message TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | `------------------- - * | - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 2 - * | | * Message flags: 240 - * | | * Originator address: 10.0.0.1 - * | | * Hop limit: 255 - * | | * Hop count: 1 - * | | * Message seq number: 12345 - * | | - Address block (2 addresses) - * | | - 10.0.0.2/32 - * | | - 10.1.1.2/32 - * | | - Flags = 192 - * | | - ADDRESS TLV block (0 TLVs) - * | | - Address block (4 addresses) - * | | - 10.0.0.0/32 - * | | - 11.0.0.0/32 - * | | - 10.0.0.5/16 - * | | - 10.0.0.6/24 - * | | - Flags = 8 - * | | - ADDRESS TLV block (1 TLVs) - * | | - TLV - * | | Flags = 56 - * | | Index-start = 1 - * | | Index-stop = 3 - * | | Type = 1; Value = 00 01 02 03 - * | | 04 05 06 07 - * | | 08 09 0a 0b - * | | 0c 0d 0e 0f - * | | 10 11 12 13 - * | | 14 15 16 17 - * | | 18 19 1a 1b - * | | 1c 1d 1e 1f - * | | 20 21 22 23 - * | | 24 25 26 27 - * | | 28 29 2a 2b - * | | 2c 2d 2e 2f - * | | 30 31 32 33 - * | | 34 35 36 37 - * | | 38 39 3a 3b - * | | 3c 3d 3e 3f - * | | 40 41 42 43 - * | | 44 45 46 47 - * | | 48 49 4a 4b - * | | 4c 4d 4e 4f - * | | 50 51 52 53 - * | | 54 55 56 57 - * | | 58 59 5a 5b - * | | 5c 5d 5e 5f - * | | 60 61 62 63 - * | | 64 65 66 67 - * | | 68 69 6a 6b - * | | 6c 6d 6e 6f - * | | 70 71 72 73 - * | | 74 75 76 77 - * | | 78 79 7a 7b - * | | 7c 7d 7e 7f - * | | 80 81 82 83 - * | | 84 85 86 87 - * | | 88 89 8a 8b - * | | 8c 8d 8e 8f - * | | 90 91 92 93 - * | | 94 95 96 97 - * | | 98 99 9a 9b - * | | 9c 9d 9e 9f - * | | a0 a1 a2 a3 - * | | a4 a5 a6 a7 - * | | a8 a9 aa ab - * | | ac ad ae af - * | | b0 b1 b2 b3 - * | | b4 b5 b6 b7 - * | | b8 b9 ba bb - * | | bc bd be bf - * | | c0 c1 c2 c3 - * | | c4 c5 c6 c7 - * | | c8 c9 ca cb - * | | cc cd ce cf - * | | d0 d1 d2 d3 - * | | d4 d5 d6 d7 - * | | d8 d9 da db - * | | dc dd de df - * | | e0 e1 e2 e3 - * | | e4 e5 e6 e7 - * | | e8 e9 ea eb - * | | ec ed ee ef - * | | f0 f1 f2 f3 - * | | f4 f5 f6 f7 - * | | f8 f9 fa fb - * | | fc fd fe 00 - * | | 01 02 03 04 - * | | 05 06 07 08 - * | | 09 0a 0b 0c - * | | 0d 0e 0f 10 - * | | 11 12 13 14 - * | | 15 16 17 18 - * | | 19 1a 1b 1c - * | | 1d 1e 1f 20 - * | | 21 22 23 24 - * | | 25 26 27 28 - * | | 29 2a 2b 2c - * | | - * | `------------------- - * | - * `------------------ + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 28 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | | * Message TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 240 + * | | * Originator address: 10.0.0.1 + * | | * Hop limit: 255 + * | | * Hop count: 1 + * | | * Message seq number: 12345 + * | | - Address block (2 addresses) + * | | - 10.0.0.2/32 + * | | - 10.1.1.2/32 + * | | - Flags = 192 + * | | - ADDRESS TLV block (0 TLVs) + * | | - Address block (4 addresses) + * | | - 10.0.0.0/32 + * | | - 11.0.0.0/32 + * | | - 10.0.0.5/16 + * | | - 10.0.0.6/24 + * | | - Flags = 8 + * | | - ADDRESS TLV block (1 TLVs) + * | | - TLV + * | | Flags = 56 + * | | Index-start = 1 + * | | Index-stop = 3 + * | | Type = 1; Value = 00 01 02 03 + * | | 04 05 06 07 + * | | 08 09 0a 0b + * | | 0c 0d 0e 0f + * | | 10 11 12 13 + * | | 14 15 16 17 + * | | 18 19 1a 1b + * | | 1c 1d 1e 1f + * | | 20 21 22 23 + * | | 24 25 26 27 + * | | 28 29 2a 2b + * | | 2c 2d 2e 2f + * | | 30 31 32 33 + * | | 34 35 36 37 + * | | 38 39 3a 3b + * | | 3c 3d 3e 3f + * | | 40 41 42 43 + * | | 44 45 46 47 + * | | 48 49 4a 4b + * | | 4c 4d 4e 4f + * | | 50 51 52 53 + * | | 54 55 56 57 + * | | 58 59 5a 5b + * | | 5c 5d 5e 5f + * | | 60 61 62 63 + * | | 64 65 66 67 + * | | 68 69 6a 6b + * | | 6c 6d 6e 6f + * | | 70 71 72 73 + * | | 74 75 76 77 + * | | 78 79 7a 7b + * | | 7c 7d 7e 7f + * | | 80 81 82 83 + * | | 84 85 86 87 + * | | 88 89 8a 8b + * | | 8c 8d 8e 8f + * | | 90 91 92 93 + * | | 94 95 96 97 + * | | 98 99 9a 9b + * | | 9c 9d 9e 9f + * | | a0 a1 a2 a3 + * | | a4 a5 a6 a7 + * | | a8 a9 aa ab + * | | ac ad ae af + * | | b0 b1 b2 b3 + * | | b4 b5 b6 b7 + * | | b8 b9 ba bb + * | | bc bd be bf + * | | c0 c1 c2 c3 + * | | c4 c5 c6 c7 + * | | c8 c9 ca cb + * | | cc cd ce cf + * | | d0 d1 d2 d3 + * | | d4 d5 d6 d7 + * | | d8 d9 da db + * | | dc dd de df + * | | e0 e1 e2 e3 + * | | e4 e5 e6 e7 + * | | e8 e9 ea eb + * | | ec ed ee ef + * | | f0 f1 f2 f3 + * | | f4 f5 f6 f7 + * | | f8 f9 fa fb + * | | fc fd fe 00 + * | | 01 02 03 04 + * | | 05 06 07 08 + * | | 09 0a 0b 0c + * | | 0d 0e 0f 10 + * | | 11 12 13 14 + * | | 15 16 17 18 + * | | 19 1a 1b 1c + * | | 1d 1e 1f 20 + * | | 21 22 23 24 + * | | 25 26 27 28 + * | | 29 2a 2b 2c + * | | + * | `------------------- + * | + * `------------------ */ { Ptr packet = Create (); @@ -2612,19 +2612,19 @@ } /* Test 29 - * ,------------------ - * | PACKET - * |------------------ - * | * Packet version: 0 - * | * Packet flags: 0 - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 1 - * | | * Message flags: 1 - * | `------------------- - * | - * `------------------ + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 0 + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 1 + * | `------------------- + * | + * `------------------ */ { Ptr packet = Create (); @@ -2642,20 +2642,20 @@ } /* Test 30 - * ,------------------ - * | PACKET - * |------------------ - * | * Packet version: 0 - * | * Packet flags: 0 - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 1 - * | | * Message flags: 129 - * | | * Originator address: abcd::1 - * | `------------------- - * | - * `------------------ + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 0 + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 129 + * | | * Originator address: abcd::1 + * | `------------------- + * | + * `------------------ */ { Ptr packet = Create (); @@ -2678,24 +2678,24 @@ } /* Test 31 - * ,------------------ - * | PACKET - * |------------------ - * | * Packet version: 0 - * | * Packet flags: 0 - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 1 - * | | * Message flags: 129 - * | | * Originator address: abcd::1 - * | | - Address block (1 addresses) - * | | - 10::1/128 - * | | - Flags = 0 - * | | - ADDRESS TLV block (0 TLVs) - * | `------------------- - * | - * `------------------ + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 0 + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 129 + * | | * Originator address: abcd::1 + * | | - Address block (1 addresses) + * | | - 10::1/128 + * | | - Flags = 0 + * | | - ADDRESS TLV block (0 TLVs) + * | `------------------- + * | + * `------------------ */ { Ptr packet = Create (); @@ -2727,25 +2727,25 @@ } /* Test 32 - * ,------------------ - * | PACKET - * |------------------ - * | * Packet version: 0 - * | * Packet flags: 0 - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 1 - * | | * Message flags: 129 - * | | * Originator address: abcd::1 - * | | - Address block (2 addresses) - * | | - 10::1/128 - * | | - 10::2/128 - * | | - Flags = 128 - * | | - ADDRESS TLV block (0 TLVs) - * | `------------------- - * | - * `------------------ + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 0 + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 129 + * | | * Originator address: abcd::1 + * | | - Address block (2 addresses) + * | | - 10::1/128 + * | | - 10::2/128 + * | | - Flags = 128 + * | | - ADDRESS TLV block (0 TLVs) + * | `------------------- + * | + * `------------------ */ { Ptr packet = Create (); @@ -2779,25 +2779,25 @@ } /* Test 33 - * ,------------------ - * | PACKET - * |------------------ - * | * Packet version: 0 - * | * Packet flags: 0 - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 1 - * | | * Message flags: 129 - * | | * Originator address: abcd::1 - * | | - Address block (2 addresses) - * | | - 10::2/128 - * | | - 10::11:2/128 - * | | - Flags = 192 - * | | - ADDRESS TLV block (0 TLVs) - * | `------------------- - * | - * `------------------ + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 0 + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 129 + * | | * Originator address: abcd::1 + * | | - Address block (2 addresses) + * | | - 10::2/128 + * | | - 10::11:2/128 + * | | - Flags = 192 + * | | - ADDRESS TLV block (0 TLVs) + * | `------------------- + * | + * `------------------ */ { Ptr packet = Create (); @@ -2831,30 +2831,30 @@ } /* Test 34 - * ,------------------ - * | PACKET - * |------------------ - * | * Packet version: 0 - * | * Packet flags: 0 - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 1 - * | | * Message flags: 129 - * | | * Originator address: abcd::1 - * | | - Address block (2 addresses) - * | | - 10::2/128 - * | | - 10::11:2/128 - * | | - Flags = 192 - * | | - ADDRESS TLV block (0 TLVs) - * | | - Address block (2 addresses) - * | | - 10::/128 - * | | - 11::/128 - * | | - Flags = 160 - * | | - ADDRESS TLV block (0 TLVs) - * | `------------------- - * | - * `------------------ + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 0 + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 129 + * | | * Originator address: abcd::1 + * | | - Address block (2 addresses) + * | | - 10::2/128 + * | | - 10::11:2/128 + * | | - Flags = 192 + * | | - ADDRESS TLV block (0 TLVs) + * | | - Address block (2 addresses) + * | | - 10::/128 + * | | - 11::/128 + * | | - Flags = 160 + * | | - ADDRESS TLV block (0 TLVs) + * | `------------------- + * | + * `------------------ */ { Ptr packet = Create (); @@ -2895,32 +2895,32 @@ } /* Test 35 - * ,------------------ - * | PACKET - * |------------------ - * | * Packet version: 0 - * | * Packet flags: 0 - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 1 - * | | * Message flags: 129 - * | | * Originator address: abcd::1 - * | | - Address block (2 addresses) - * | | - 10::2/128 - * | | - 10::11:2/128 - * | | - Flags = 192 - * | | - ADDRESS TLV block (0 TLVs) - * | | - Address block (4 addresses) - * | | - 10::/128 - * | | - 11::/128 - * | | - 10::5/64 - * | | - 10::6/48 - * | | - Flags = 136 - * | | - ADDRESS TLV block (0 TLVs) - * | `------------------- - * | - * `------------------ + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 0 + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 129 + * | | * Originator address: abcd::1 + * | | - Address block (2 addresses) + * | | - 10::2/128 + * | | - 10::11:2/128 + * | | - Flags = 192 + * | | - ADDRESS TLV block (0 TLVs) + * | | - Address block (4 addresses) + * | | - 10::/128 + * | | - 11::/128 + * | | - 10::5/64 + * | | - 10::6/48 + * | | - Flags = 136 + * | | - ADDRESS TLV block (0 TLVs) + * | `------------------- + * | + * `------------------ */ { Ptr packet = Create (); @@ -2982,151 +2982,151 @@ } /* Test 36 - * ,------------------ - * | PACKET - * |------------------ - * | * Packet version: 0 - * | * Packet flags: 12 - * | * Packet seq number: 29 - * | | * Packet TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 1 - * | | * Message flags: 0 - * | | * Message TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | `------------------- - * | - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 2 - * | | * Message flags: 240 - * | | * Originator address: 10.0.0.1 - * | | * Hop limit: 255 - * | | * Hop count: 1 - * | | * Message seq number: 12345 - * | | - Address block (2 addresses) - * | | - 10.0.0.2/32 - * | | - 10.1.1.2/32 - * | | - Flags = 192 - * | | - ADDRESS TLV block (0 TLVs) - * | | - Address block (4 addresses) - * | | - 10.0.0.0/32 - * | | - 11.0.0.0/32 - * | | - 10.0.0.5/16 - * | | - 10.0.0.6/24 - * | | - Flags = 8 - * | | - ADDRESS TLV block (1 TLVs) - * | | - TLV - * | | Flags = 56 - * | | Index-start = 1 - * | | Index-stop = 3 - * | | Type = 1; Value = 00 01 02 03 - * | | 04 05 06 07 - * | | 08 09 0a 0b - * | | 0c 0d 0e 0f - * | | 10 11 12 13 - * | | 14 15 16 17 - * | | 18 19 1a 1b - * | | 1c 1d 1e 1f - * | | 20 21 22 23 - * | | 24 25 26 27 - * | | 28 29 2a 2b - * | | 2c 2d 2e 2f - * | | 30 31 32 33 - * | | 34 35 36 37 - * | | 38 39 3a 3b - * | | 3c 3d 3e 3f - * | | 40 41 42 43 - * | | 44 45 46 47 - * | | 48 49 4a 4b - * | | 4c 4d 4e 4f - * | | 50 51 52 53 - * | | 54 55 56 57 - * | | 58 59 5a 5b - * | | 5c 5d 5e 5f - * | | 60 61 62 63 - * | | 64 65 66 67 - * | | 68 69 6a 6b - * | | 6c 6d 6e 6f - * | | 70 71 72 73 - * | | 74 75 76 77 - * | | 78 79 7a 7b - * | | 7c 7d 7e 7f - * | | 80 81 82 83 - * | | 84 85 86 87 - * | | 88 89 8a 8b - * | | 8c 8d 8e 8f - * | | 90 91 92 93 - * | | 94 95 96 97 - * | | 98 99 9a 9b - * | | 9c 9d 9e 9f - * | | a0 a1 a2 a3 - * | | a4 a5 a6 a7 - * | | a8 a9 aa ab - * | | ac ad ae af - * | | b0 b1 b2 b3 - * | | b4 b5 b6 b7 - * | | b8 b9 ba bb - * | | bc bd be bf - * | | c0 c1 c2 c3 - * | | c4 c5 c6 c7 - * | | c8 c9 ca cb - * | | cc cd ce cf - * | | d0 d1 d2 d3 - * | | d4 d5 d6 d7 - * | | d8 d9 da db - * | | dc dd de df - * | | e0 e1 e2 e3 - * | | e4 e5 e6 e7 - * | | e8 e9 ea eb - * | | ec ed ee ef - * | | f0 f1 f2 f3 - * | | f4 f5 f6 f7 - * | | f8 f9 fa fb - * | | fc fd fe 00 - * | | 01 02 03 04 - * | | 05 06 07 08 - * | | 09 0a 0b 0c - * | | 0d 0e 0f 10 - * | | 11 12 13 14 - * | | 15 16 17 18 - * | | 19 1a 1b 1c - * | | 1d 1e 1f 20 - * | | 21 22 23 24 - * | | 25 26 27 28 - * | | 29 2a 2b 2c - * | | - * | `------------------- - * | - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 1 - * | | * Message flags: 129 - * | | * Originator address: abcd::1 - * | | - Address block (2 addresses) - * | | - 10::2/128 - * | | - 10::11:2/128 - * | | - Flags = 192 - * | | - ADDRESS TLV block (0 TLVs) - * | | - Address block (4 addresses) - * | | - 10::/128 - * | | - 11::/128 - * | | - 10::5/64 - * | | - 10::6/48 - * | | - Flags = 136 - * | | - ADDRESS TLV block (0 TLVs) - * | `------------------- - * | - * `------------------ + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 29 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | | * Message TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 240 + * | | * Originator address: 10.0.0.1 + * | | * Hop limit: 255 + * | | * Hop count: 1 + * | | * Message seq number: 12345 + * | | - Address block (2 addresses) + * | | - 10.0.0.2/32 + * | | - 10.1.1.2/32 + * | | - Flags = 192 + * | | - ADDRESS TLV block (0 TLVs) + * | | - Address block (4 addresses) + * | | - 10.0.0.0/32 + * | | - 11.0.0.0/32 + * | | - 10.0.0.5/16 + * | | - 10.0.0.6/24 + * | | - Flags = 8 + * | | - ADDRESS TLV block (1 TLVs) + * | | - TLV + * | | Flags = 56 + * | | Index-start = 1 + * | | Index-stop = 3 + * | | Type = 1; Value = 00 01 02 03 + * | | 04 05 06 07 + * | | 08 09 0a 0b + * | | 0c 0d 0e 0f + * | | 10 11 12 13 + * | | 14 15 16 17 + * | | 18 19 1a 1b + * | | 1c 1d 1e 1f + * | | 20 21 22 23 + * | | 24 25 26 27 + * | | 28 29 2a 2b + * | | 2c 2d 2e 2f + * | | 30 31 32 33 + * | | 34 35 36 37 + * | | 38 39 3a 3b + * | | 3c 3d 3e 3f + * | | 40 41 42 43 + * | | 44 45 46 47 + * | | 48 49 4a 4b + * | | 4c 4d 4e 4f + * | | 50 51 52 53 + * | | 54 55 56 57 + * | | 58 59 5a 5b + * | | 5c 5d 5e 5f + * | | 60 61 62 63 + * | | 64 65 66 67 + * | | 68 69 6a 6b + * | | 6c 6d 6e 6f + * | | 70 71 72 73 + * | | 74 75 76 77 + * | | 78 79 7a 7b + * | | 7c 7d 7e 7f + * | | 80 81 82 83 + * | | 84 85 86 87 + * | | 88 89 8a 8b + * | | 8c 8d 8e 8f + * | | 90 91 92 93 + * | | 94 95 96 97 + * | | 98 99 9a 9b + * | | 9c 9d 9e 9f + * | | a0 a1 a2 a3 + * | | a4 a5 a6 a7 + * | | a8 a9 aa ab + * | | ac ad ae af + * | | b0 b1 b2 b3 + * | | b4 b5 b6 b7 + * | | b8 b9 ba bb + * | | bc bd be bf + * | | c0 c1 c2 c3 + * | | c4 c5 c6 c7 + * | | c8 c9 ca cb + * | | cc cd ce cf + * | | d0 d1 d2 d3 + * | | d4 d5 d6 d7 + * | | d8 d9 da db + * | | dc dd de df + * | | e0 e1 e2 e3 + * | | e4 e5 e6 e7 + * | | e8 e9 ea eb + * | | ec ed ee ef + * | | f0 f1 f2 f3 + * | | f4 f5 f6 f7 + * | | f8 f9 fa fb + * | | fc fd fe 00 + * | | 01 02 03 04 + * | | 05 06 07 08 + * | | 09 0a 0b 0c + * | | 0d 0e 0f 10 + * | | 11 12 13 14 + * | | 15 16 17 18 + * | | 19 1a 1b 1c + * | | 1d 1e 1f 20 + * | | 21 22 23 24 + * | | 25 26 27 28 + * | | 29 2a 2b 2c + * | | + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 129 + * | | * Originator address: abcd::1 + * | | - Address block (2 addresses) + * | | - 10::2/128 + * | | - 10::11:2/128 + * | | - Flags = 192 + * | | - ADDRESS TLV block (0 TLVs) + * | | - Address block (4 addresses) + * | | - 10::/128 + * | | - 11::/128 + * | | - 10::5/64 + * | | - 10::6/48 + * | | - Flags = 136 + * | | - ADDRESS TLV block (0 TLVs) + * | `------------------- + * | + * `------------------ */ { Ptr packet = Create (); @@ -3404,151 +3404,151 @@ } /* Test 37 - * ,------------------ - * | PACKET - * |------------------ - * | * Packet version: 0 - * | * Packet flags: 12 - * | * Packet seq number: 30 - * | | * Packet TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 1 - * | | * Message flags: 0 - * | | * Message TLV Block - * | | - TLV - * | | Flags = 0 - * | | Type = 1; Value = (warning: parameter is NULL) - * | `------------------- - * | - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 2 - * | | * Message flags: 240 - * | | * Originator address: 10.0.0.1 - * | | * Hop limit: 255 - * | | * Hop count: 1 - * | | * Message seq number: 12345 - * | | - Address block (2 addresses) - * | | - 10.0.0.2/32 - * | | - 10.1.1.2/32 - * | | - Flags = 192 - * | | - ADDRESS TLV block (0 TLVs) - * | | - Address block (4 addresses) - * | | - 10.0.0.0/32 - * | | - 11.0.0.0/32 - * | | - 10.0.0.5/16 - * | | - 10.0.0.6/24 - * | | - Flags = 8 - * | | - ADDRESS TLV block (1 TLVs) - * | | - TLV - * | | Flags = 56 - * | | Index-start = 1 - * | | Index-stop = 3 - * | | Type = 1; Value = 00 01 02 03 - * | | 04 05 06 07 - * | | 08 09 0a 0b - * | | 0c 0d 0e 0f - * | | 10 11 12 13 - * | | 14 15 16 17 - * | | 18 19 1a 1b - * | | 1c 1d 1e 1f - * | | 20 21 22 23 - * | | 24 25 26 27 - * | | 28 29 2a 2b - * | | 2c 2d 2e 2f - * | | 30 31 32 33 - * | | 34 35 36 37 - * | | 38 39 3a 3b - * | | 3c 3d 3e 3f - * | | 40 41 42 43 - * | | 44 45 46 47 - * | | 48 49 4a 4b - * | | 4c 4d 4e 4f - * | | 50 51 52 53 - * | | 54 55 56 57 - * | | 58 59 5a 5b - * | | 5c 5d 5e 5f - * | | 60 61 62 63 - * | | 64 65 66 67 - * | | 68 69 6a 6b - * | | 6c 6d 6e 6f - * | | 70 71 72 73 - * | | 74 75 76 77 - * | | 78 79 7a 7b - * | | 7c 7d 7e 7f - * | | 80 81 82 83 - * | | 84 85 86 87 - * | | 88 89 8a 8b - * | | 8c 8d 8e 8f - * | | 90 91 92 93 - * | | 94 95 96 97 - * | | 98 99 9a 9b - * | | 9c 9d 9e 9f - * | | a0 a1 a2 a3 - * | | a4 a5 a6 a7 - * | | a8 a9 aa ab - * | | ac ad ae af - * | | b0 b1 b2 b3 - * | | b4 b5 b6 b7 - * | | b8 b9 ba bb - * | | bc bd be bf - * | | c0 c1 c2 c3 - * | | c4 c5 c6 c7 - * | | c8 c9 ca cb - * | | cc cd ce cf - * | | d0 d1 d2 d3 - * | | d4 d5 d6 d7 - * | | d8 d9 da db - * | | dc dd de df - * | | e0 e1 e2 e3 - * | | e4 e5 e6 e7 - * | | e8 e9 ea eb - * | | ec ed ee ef - * | | f0 f1 f2 f3 - * | | f4 f5 f6 f7 - * | | f8 f9 fa fb - * | | fc fd fe 00 - * | | 01 02 03 04 - * | | 05 06 07 08 - * | | 09 0a 0b 0c - * | | 0d 0e 0f 10 - * | | 11 12 13 14 - * | | 15 16 17 18 - * | | 19 1a 1b 1c - * | | 1d 1e 1f 20 - * | | 21 22 23 24 - * | | 25 26 27 28 - * | | 29 2a 2b 2c - * | | - * | `------------------- - * | - * | ,------------------- - * | | MESSAGE - * | |------------------- - * | | * Message type: 1 - * | | * Message flags: 129 - * | | * Originator address: abcd::1 - * | | - Address block (2 addresses) - * | | - 10::2/128 - * | | - 10::11:2/128 - * | | - Flags = 192 - * | | - ADDRESS TLV block (0 TLVs) - * | | - Address block (4 addresses) - * | | - 10::/128 - * | | - 11::/128 - * | | - 10::5/64 - * | | - 10::6/48 - * | | - Flags = 136 - * | | - ADDRESS TLV block (0 TLVs) - * | `------------------- - * | - * `------------------ + * ,------------------ + * | PACKET + * |------------------ + * | * Packet version: 0 + * | * Packet flags: 12 + * | * Packet seq number: 30 + * | | * Packet TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 0 + * | | * Message TLV Block + * | | - TLV + * | | Flags = 0 + * | | Type = 1; Value = (warning: parameter is NULL) + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 2 + * | | * Message flags: 240 + * | | * Originator address: 10.0.0.1 + * | | * Hop limit: 255 + * | | * Hop count: 1 + * | | * Message seq number: 12345 + * | | - Address block (2 addresses) + * | | - 10.0.0.2/32 + * | | - 10.1.1.2/32 + * | | - Flags = 192 + * | | - ADDRESS TLV block (0 TLVs) + * | | - Address block (4 addresses) + * | | - 10.0.0.0/32 + * | | - 11.0.0.0/32 + * | | - 10.0.0.5/16 + * | | - 10.0.0.6/24 + * | | - Flags = 8 + * | | - ADDRESS TLV block (1 TLVs) + * | | - TLV + * | | Flags = 56 + * | | Index-start = 1 + * | | Index-stop = 3 + * | | Type = 1; Value = 00 01 02 03 + * | | 04 05 06 07 + * | | 08 09 0a 0b + * | | 0c 0d 0e 0f + * | | 10 11 12 13 + * | | 14 15 16 17 + * | | 18 19 1a 1b + * | | 1c 1d 1e 1f + * | | 20 21 22 23 + * | | 24 25 26 27 + * | | 28 29 2a 2b + * | | 2c 2d 2e 2f + * | | 30 31 32 33 + * | | 34 35 36 37 + * | | 38 39 3a 3b + * | | 3c 3d 3e 3f + * | | 40 41 42 43 + * | | 44 45 46 47 + * | | 48 49 4a 4b + * | | 4c 4d 4e 4f + * | | 50 51 52 53 + * | | 54 55 56 57 + * | | 58 59 5a 5b + * | | 5c 5d 5e 5f + * | | 60 61 62 63 + * | | 64 65 66 67 + * | | 68 69 6a 6b + * | | 6c 6d 6e 6f + * | | 70 71 72 73 + * | | 74 75 76 77 + * | | 78 79 7a 7b + * | | 7c 7d 7e 7f + * | | 80 81 82 83 + * | | 84 85 86 87 + * | | 88 89 8a 8b + * | | 8c 8d 8e 8f + * | | 90 91 92 93 + * | | 94 95 96 97 + * | | 98 99 9a 9b + * | | 9c 9d 9e 9f + * | | a0 a1 a2 a3 + * | | a4 a5 a6 a7 + * | | a8 a9 aa ab + * | | ac ad ae af + * | | b0 b1 b2 b3 + * | | b4 b5 b6 b7 + * | | b8 b9 ba bb + * | | bc bd be bf + * | | c0 c1 c2 c3 + * | | c4 c5 c6 c7 + * | | c8 c9 ca cb + * | | cc cd ce cf + * | | d0 d1 d2 d3 + * | | d4 d5 d6 d7 + * | | d8 d9 da db + * | | dc dd de df + * | | e0 e1 e2 e3 + * | | e4 e5 e6 e7 + * | | e8 e9 ea eb + * | | ec ed ee ef + * | | f0 f1 f2 f3 + * | | f4 f5 f6 f7 + * | | f8 f9 fa fb + * | | fc fd fe 00 + * | | 01 02 03 04 + * | | 05 06 07 08 + * | | 09 0a 0b 0c + * | | 0d 0e 0f 10 + * | | 11 12 13 14 + * | | 15 16 17 18 + * | | 19 1a 1b 1c + * | | 1d 1e 1f 20 + * | | 21 22 23 24 + * | | 25 26 27 28 + * | | 29 2a 2b 2c + * | | + * | `------------------- + * | + * | ,------------------- + * | | MESSAGE + * | |------------------- + * | | * Message type: 1 + * | | * Message flags: 129 + * | | * Originator address: abcd::1 + * | | - Address block (2 addresses) + * | | - 10::2/128 + * | | - 10::11:2/128 + * | | - Flags = 192 + * | | - ADDRESS TLV block (0 TLVs) + * | | - Address block (4 addresses) + * | | - 10::/128 + * | | - 11::/128 + * | | - 10::5/64 + * | | - 10::6/48 + * | | - Flags = 136 + * | | - ADDRESS TLV block (0 TLVs) + * | `------------------- + * | + * `------------------ */ { Ptr packet = Create (); diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/test/pcap-file-test-suite.cc --- a/src/network/test/pcap-file-test-suite.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/test/pcap-file-test-suite.cc Fri May 13 14:57:43 2011 -0400 @@ -51,7 +51,7 @@ { return false; } - + fclose (p); return true; } @@ -65,7 +65,7 @@ { return false; } - + fseek (p, 0, SEEK_END); uint64_t sizeActual = ftell (p); @@ -451,7 +451,7 @@ f.Open (m_testFilename, std::ios::out); NS_TEST_ASSERT_MSG_EQ (f.Fail (), false, "Open (" << m_testFilename << ", \"std::ios::out\") returns error"); - + // // Initialize the pcap file header. // @@ -553,7 +553,7 @@ NS_TEST_ASSERT_MSG_EQ (f.GetSnapLen (), 5678, "Read back snap len incorrectly"); NS_TEST_ASSERT_MSG_EQ (f.GetDataLinkType (), 1234, "Read back data link type incorrectly"); f.Close (); - + // // Re-open the file to erase its contents. // @@ -595,7 +595,7 @@ result = fread (&val32, sizeof(val32), 1, p); NS_TEST_ASSERT_MSG_EQ (result, 1, "Unable to fread() time zone correction"); NS_TEST_ASSERT_MSG_EQ (val32, Swap(uint32_t (7)), "Version minor written incorrectly"); - + result = fread (&val32, sizeof(val32), 1, p); NS_TEST_ASSERT_MSG_EQ (result, 1, "Unable to fread() sig figs"); NS_TEST_ASSERT_MSG_EQ (val32, 0, "Sig figs written incorrectly"); @@ -631,7 +631,7 @@ NS_TEST_ASSERT_MSG_EQ (f.GetSigFigs (), 0, "Read back sig figs incorrectly"); NS_TEST_ASSERT_MSG_EQ (f.GetSnapLen (), 5678, "Read back snap len incorrectly"); NS_TEST_ASSERT_MSG_EQ (f.GetDataLinkType (), 1234, "Read back data link type incorrectly"); - + f.Close (); } @@ -986,18 +986,18 @@ } PacketEntry; PacketEntry knownPackets[] = { - {2, 3696, 46, 46, {0x0001, 0x0800, 0x0604, 0x0001, 0x0000, 0x0000, 0x0003, 0x0a01, - 0x0201, 0xffff, 0xffff, 0xffff, 0x0a01, 0x0204, 0x0000, 0x0000}}, - {2, 3707, 46, 46, {0x0001, 0x0800, 0x0604, 0x0002, 0x0000, 0x0000, 0x0006, 0x0a01, - 0x0204, 0x0000, 0x0000, 0x0003, 0x0a01, 0x0201, 0x0000, 0x0000}}, - {2, 3801, 1070, 1070, {0x4500, 0x041c, 0x0000, 0x0000, 0x3f11, 0x0000, 0x0a01, 0x0101, - 0x0a01, 0x0204, 0xc001, 0x0009, 0x0408, 0x0000, 0x0000, 0x0000}}, - {2, 3811, 46, 46, {0x0001, 0x0800, 0x0604, 0x0001, 0x0000, 0x0000, 0x0006, 0x0a01, - 0x0204, 0xffff, 0xffff, 0xffff, 0x0a01, 0x0201, 0x0000, 0x0000}}, - {2, 3822, 46, 46, {0x0001, 0x0800, 0x0604, 0x0002, 0x0000, 0x0000, 0x0003, 0x0a01, - 0x0201, 0x0000, 0x0000, 0x0006, 0x0a01, 0x0204, 0x0000, 0x0000}}, - {2, 3915, 1070, 1070, {0x4500, 0x041c, 0x0000, 0x0000, 0x4011, 0x0000, 0x0a01, 0x0204, - 0x0a01, 0x0101, 0x0009, 0xc001, 0x0408, 0x0000, 0x0000, 0x0000}} + { 2, 3696, 46, 46, { 0x0001, 0x0800, 0x0604, 0x0001, 0x0000, 0x0000, 0x0003, 0x0a01, + 0x0201, 0xffff, 0xffff, 0xffff, 0x0a01, 0x0204, 0x0000, 0x0000}}, + { 2, 3707, 46, 46, { 0x0001, 0x0800, 0x0604, 0x0002, 0x0000, 0x0000, 0x0006, 0x0a01, + 0x0204, 0x0000, 0x0000, 0x0003, 0x0a01, 0x0201, 0x0000, 0x0000}}, + { 2, 3801, 1070, 1070, { 0x4500, 0x041c, 0x0000, 0x0000, 0x3f11, 0x0000, 0x0a01, 0x0101, + 0x0a01, 0x0204, 0xc001, 0x0009, 0x0408, 0x0000, 0x0000, 0x0000}}, + { 2, 3811, 46, 46, { 0x0001, 0x0800, 0x0604, 0x0001, 0x0000, 0x0000, 0x0006, 0x0a01, + 0x0204, 0xffff, 0xffff, 0xffff, 0x0a01, 0x0201, 0x0000, 0x0000}}, + { 2, 3822, 46, 46, { 0x0001, 0x0800, 0x0604, 0x0002, 0x0000, 0x0000, 0x0003, 0x0a01, + 0x0201, 0x0000, 0x0000, 0x0006, 0x0a01, 0x0204, 0x0000, 0x0000}}, + { 2, 3915, 1070, 1070, { 0x4500, 0x041c, 0x0000, 0x0000, 0x4011, 0x0000, 0x0a01, 0x0204, + 0x0a01, 0x0101, 0x0009, 0xc001, 0x0408, 0x0000, 0x0000, 0x0000}} }; @@ -1080,16 +1080,16 @@ // std::string filename2 = "different.pcap"; PcapFile f; - + f.Open (filename2, std::ios::out); NS_TEST_ASSERT_MSG_EQ (f.Fail (), false, "Open (" << filename2 << ", \"std::ios::out\") returns error"); f.Init (1, N_PACKET_BYTES); NS_TEST_ASSERT_MSG_EQ (f.Fail (), false, "Init (1, " << N_PACKET_BYTES << ") returns error"); - + for (uint32_t i = 0; i < N_KNOWN_PACKETS; ++i) { PacketEntry const & p = knownPackets[i]; - + f.Write (p.tsSec, p.tsUsec, (uint8_t const *)p.data, p.origLen); NS_TEST_EXPECT_MSG_EQ (f.Fail (), false, "Write must not fail"); } diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/test/sequence-number-test-suite.cc --- a/src/network/test/sequence-number-test-suite.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/test/sequence-number-test-suite.cc Fri May 13 14:57:43 2011 -0400 @@ -37,7 +37,7 @@ { m_testTracedSequenceNumber = SequenceNumber32 (0); } - + static TypeId GetTypeId (void) { static TypeId tid = TypeId("ns3::SequenceNumberTestObj") @@ -46,10 +46,10 @@ "A traceable sequence number", MakeTraceSourceAccessor (&SequenceNumberTestObj::m_testTracedSequenceNumber)) .AddConstructor () - ; + ; return tid; } - + TypeId GetInstanceTypeId (void) const { return GetTypeId (); @@ -59,7 +59,7 @@ { m_testTracedSequenceNumber += 1; } - + }; @@ -85,10 +85,11 @@ } SequenceNumberTestCase::~SequenceNumberTestCase () -{} +{ +} void -SequenceNumberTestCase::SequenceNumberTracer (SequenceNumber32 oldval, SequenceNumber32 newval) +SequenceNumberTestCase::SequenceNumberTracer (SequenceNumber32 oldval, SequenceNumber32 newval) { m_oldval = oldval; m_newval = newval; @@ -100,55 +101,55 @@ #define NS_TEST_ASSERT(a) NS_TEST_ASSERT_MSG_EQ(bool(a), true, "foo") { - SequenceNumber32 num1 (3), num2 (5); - uint32_t value; + SequenceNumber32 num1 (3), num2 (5); + uint32_t value; - value = (num1 + num2).GetValue (); - NS_TEST_ASSERT_EQUAL (value, 8); + value = (num1 + num2).GetValue (); + NS_TEST_ASSERT_EQUAL (value, 8); + + num1 += num2.GetValue (); + NS_TEST_ASSERT_EQUAL (num1, SequenceNumber32 (8)); - num1 += num2.GetValue (); - NS_TEST_ASSERT_EQUAL (num1, SequenceNumber32 (8)); - - ++num1; - NS_TEST_ASSERT_EQUAL (num1, SequenceNumber32 (9)); + ++num1; + NS_TEST_ASSERT_EQUAL (num1, SequenceNumber32 (9)); + + --num1; + NS_TEST_ASSERT_EQUAL (num1, SequenceNumber32 (8)); - --num1; - NS_TEST_ASSERT_EQUAL (num1, SequenceNumber32 (8)); + num1++; + NS_TEST_ASSERT_EQUAL (num1, SequenceNumber32 (9)); - num1++; - NS_TEST_ASSERT_EQUAL (num1, SequenceNumber32 (9)); + num1--; + NS_TEST_ASSERT_EQUAL (num1, SequenceNumber32 (8)); - num1--; - NS_TEST_ASSERT_EQUAL (num1, SequenceNumber32 (8)); - } { - SequenceNumber16 num1 (60900), num2 (5), num3 (10000); + SequenceNumber16 num1 (60900), num2 (5), num3 (10000); - NS_TEST_ASSERT (num1 == num1); + NS_TEST_ASSERT (num1 == num1); - NS_TEST_ASSERT (num2 != num1); + NS_TEST_ASSERT (num2 != num1); - NS_TEST_ASSERT (num3 > num2); - NS_TEST_ASSERT (num3 >= num2); - NS_TEST_ASSERT (num1 < num3); - NS_TEST_ASSERT (num1 <= num3); + NS_TEST_ASSERT (num3 > num2); + NS_TEST_ASSERT (num3 >= num2); + NS_TEST_ASSERT (num1 < num3); + NS_TEST_ASSERT (num1 <= num3); - NS_TEST_ASSERT (num1 < num2); - NS_TEST_ASSERT (num1 <= num2); - NS_TEST_ASSERT (num2 > num1); - NS_TEST_ASSERT (num2 >= num1); + NS_TEST_ASSERT (num1 < num2); + NS_TEST_ASSERT (num1 <= num2); + NS_TEST_ASSERT (num2 > num1); + NS_TEST_ASSERT (num2 >= num1); - NS_TEST_ASSERT (num1+num2 > num1); - NS_TEST_ASSERT (num1+num2 >= num1); - NS_TEST_ASSERT (num1 < num1+num2); - NS_TEST_ASSERT (num1 <= num1+num2); + NS_TEST_ASSERT (num1+num2 > num1); + NS_TEST_ASSERT (num1+num2 >= num1); + NS_TEST_ASSERT (num1 < num1+num2); + NS_TEST_ASSERT (num1 <= num1+num2); - NS_TEST_ASSERT (num1 < num1+num3); - NS_TEST_ASSERT (num1 <= num1+num3); - NS_TEST_ASSERT (num1+num3 > num1); - NS_TEST_ASSERT (num1+num3 >= num1); + NS_TEST_ASSERT (num1 < num1+num3); + NS_TEST_ASSERT (num1 <= num1+num3); + NS_TEST_ASSERT (num1+num3 > num1); + NS_TEST_ASSERT (num1+num3 >= num1); } { @@ -157,14 +158,14 @@ NS_TEST_ASSERT_EQUAL (SequenceNumber16 (1000) - SequenceNumber16 (6000), -5000); NS_TEST_ASSERT_EQUAL ((SequenceNumber16 (60000) + SequenceNumber16 (1000)) - SequenceNumber16 (65000), -4000); } - + { SequenceNumber32 num1 (3); - + NS_TEST_ASSERT_EQUAL (num1 + 10, SequenceNumber32 (13)); num1 += -1; NS_TEST_ASSERT_EQUAL (num1, SequenceNumber32 (2)); - + NS_TEST_ASSERT_EQUAL (num1 - (num1 - 100), 100); } @@ -176,7 +177,7 @@ NS_TEST_ASSERT_EQUAL (m_newval, SequenceNumber32 (1)); obj->Dispose (); } - + } static class SequenceNumberTestSuite : public TestSuite diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/utils/address-utils.h --- a/src/network/utils/address-utils.h Fri May 13 14:57:10 2011 -0400 +++ b/src/network/utils/address-utils.h Fri May 13 14:57:43 2011 -0400 @@ -44,7 +44,7 @@ * \brief Address family-independent test for a multicast address */ bool IsMulticast (const Address &ad); -}; +}; }; diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/utils/data-rate.cc --- a/src/network/utils/data-rate.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/utils/data-rate.cc Fri May 13 14:57:43 2011 -0400 @@ -28,148 +28,148 @@ { std::string::size_type n = s.find_first_not_of("0123456789."); if (n != std::string::npos) - { // Found non-numeric - std::istringstream iss; - iss.str (s.substr(0, n)); - double r; - iss >> r; - std::string trailer = s.substr(n, std::string::npos); - if (trailer == "bps") - { - // bit/s - *v = (uint64_t)r; - } - else if (trailer == "b/s") - { - // bit/s - *v = (uint64_t)r; - } - else if (trailer == "Bps") - { - // byte/s - *v = (uint64_t)(r * 8); - } - else if (trailer == "B/s") - { - // byte/s - *v = (uint64_t)(r * 8); - } - else if (trailer == "kbps") - { - // kilobits/s - *v = (uint64_t)(r * 1000); - } - else if (trailer == "kb/s") - { - // kilobits/s - *v = (uint64_t)(r * 1000); - } - else if (trailer == "Kbps") - { - // kilobits/s - *v = (uint64_t)(r * 1000); - } - else if (trailer == "Kb/s") - { - // kilobits/s - *v = (uint64_t)(r * 1000); - } - else if (trailer == "kBps") - { - // kiloByte/s - *v = (uint64_t)(r * 8000); - } - else if (trailer == "kB/s") - { - // KiloByte/s - *v = (uint64_t)(r * 8000); - } - else if (trailer == "KBps") - { - // kiloByte/s - *v = (uint64_t)(r * 8000); - } - else if (trailer == "KB/s") - { - // KiloByte/s - *v = (uint64_t)(r * 8000); - } - else if (trailer == "Kib/s") - { - // kibibit/s - *v = (uint64_t)(r * 1024); - } - else if (trailer == "KiB/s") - { - // kibibyte/s - *v = (uint64_t)(r * 8192); - } - else if (trailer == "Mbps") - { - // MegaBits/s - *v = (uint64_t)(r * 1000000); - } - else if (trailer == "Mb/s") - { - // MegaBits/s - *v = (uint64_t)(r * 1000000); - } - else if (trailer == "MBps") - { - // MegaBytes/s - *v = (uint64_t)(r * 8000000); - } - else if (trailer == "MB/s") - { - // MegaBytes/s - *v = (uint64_t)(r * 8000000); - } - else if (trailer == "Mib/s") - { - // MebiBits/s - *v = (uint64_t)(r * 1048576); - } - else if (trailer == "MiB/s") - { - // MebiByte/s - *v = (uint64_t)(r * 1048576 * 8); - } - else if (trailer == "Gbps") - { - // GigaBit/s - *v = (uint64_t)(r * 1000000000); - } - else if (trailer == "Gb/s") - { - // GigaBit/s - *v = (uint64_t)(r * 1000000000); - } - else if (trailer == "GBps") - { - // GigaByte/s - *v = (uint64_t)(r * 8*1000000000); - } - else if (trailer == "GB/s") - { - // GigaByte/s - *v = (uint64_t)(r * 8*1000000000); - } - else if (trailer == "Gib/s") - { - // GibiBits/s - *v = (uint64_t)(r * 1048576 * 1024); - } - else if (trailer == "GiB/s") - { - // GibiByte/s - *v = (uint64_t)(r * 1048576 * 1024 * 8); - } - else - { - return false; - } - return true; - } + { // Found non-numeric + std::istringstream iss; + iss.str (s.substr(0, n)); + double r; + iss >> r; + std::string trailer = s.substr(n, std::string::npos); + if (trailer == "bps") + { + // bit/s + *v = (uint64_t)r; + } + else if (trailer == "b/s") + { + // bit/s + *v = (uint64_t)r; + } + else if (trailer == "Bps") + { + // byte/s + *v = (uint64_t)(r * 8); + } + else if (trailer == "B/s") + { + // byte/s + *v = (uint64_t)(r * 8); + } + else if (trailer == "kbps") + { + // kilobits/s + *v = (uint64_t)(r * 1000); + } + else if (trailer == "kb/s") + { + // kilobits/s + *v = (uint64_t)(r * 1000); + } + else if (trailer == "Kbps") + { + // kilobits/s + *v = (uint64_t)(r * 1000); + } + else if (trailer == "Kb/s") + { + // kilobits/s + *v = (uint64_t)(r * 1000); + } + else if (trailer == "kBps") + { + // kiloByte/s + *v = (uint64_t)(r * 8000); + } + else if (trailer == "kB/s") + { + // KiloByte/s + *v = (uint64_t)(r * 8000); + } + else if (trailer == "KBps") + { + // kiloByte/s + *v = (uint64_t)(r * 8000); + } + else if (trailer == "KB/s") + { + // KiloByte/s + *v = (uint64_t)(r * 8000); + } + else if (trailer == "Kib/s") + { + // kibibit/s + *v = (uint64_t)(r * 1024); + } + else if (trailer == "KiB/s") + { + // kibibyte/s + *v = (uint64_t)(r * 8192); + } + else if (trailer == "Mbps") + { + // MegaBits/s + *v = (uint64_t)(r * 1000000); + } + else if (trailer == "Mb/s") + { + // MegaBits/s + *v = (uint64_t)(r * 1000000); + } + else if (trailer == "MBps") + { + // MegaBytes/s + *v = (uint64_t)(r * 8000000); + } + else if (trailer == "MB/s") + { + // MegaBytes/s + *v = (uint64_t)(r * 8000000); + } + else if (trailer == "Mib/s") + { + // MebiBits/s + *v = (uint64_t)(r * 1048576); + } + else if (trailer == "MiB/s") + { + // MebiByte/s + *v = (uint64_t)(r * 1048576 * 8); + } + else if (trailer == "Gbps") + { + // GigaBit/s + *v = (uint64_t)(r * 1000000000); + } + else if (trailer == "Gb/s") + { + // GigaBit/s + *v = (uint64_t)(r * 1000000000); + } + else if (trailer == "GBps") + { + // GigaByte/s + *v = (uint64_t)(r * 8*1000000000); + } + else if (trailer == "GB/s") + { + // GigaByte/s + *v = (uint64_t)(r * 8*1000000000); + } + else if (trailer == "Gib/s") + { + // GibiBits/s + *v = (uint64_t)(r * 1048576 * 1024); + } + else if (trailer == "GiB/s") + { + // GibiByte/s + *v = (uint64_t)(r * 1048576 * 1024 * 8); + } + else + { + return false; + } + return true; + } std::istringstream iss; iss.str (s); iss >> *v; @@ -183,40 +183,42 @@ DataRate::DataRate () : m_bps (0) -{} +{ +} DataRate::DataRate(uint64_t bps) - :m_bps(bps) -{} + : m_bps(bps) +{ +} bool DataRate::operator < (const DataRate& rhs) const { - return m_bps (const DataRate& rhs) const { - return m_bps>rhs.m_bps; + return m_bps>rhs.m_bps; } bool DataRate::operator >= (const DataRate& rhs) const { - return m_bps>=rhs.m_bps; + return m_bps>=rhs.m_bps; } bool DataRate::operator == (const DataRate& rhs) const { - return m_bps==rhs.m_bps; + return m_bps==rhs.m_bps; } bool DataRate::operator != (const DataRate& rhs) const { - return m_bps!=rhs.m_bps; + return m_bps!=rhs.m_bps; } double DataRate::CalculateTxTime(uint32_t bytes) const diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/utils/data-rate.h --- a/src/network/utils/data-rate.h Fri May 13 14:57:10 2011 -0400 +++ b/src/network/utils/data-rate.h Fri May 13 14:57:43 2011 -0400 @@ -82,14 +82,14 @@ */ DataRate (uint64_t bps); DataRate (std::string rate); - + bool operator < (const DataRate& rhs) const; bool operator <= (const DataRate& rhs) const; bool operator > (const DataRate& rhs) const; bool operator >= (const DataRate& rhs) const; bool operator == (const DataRate& rhs) const; bool operator != (const DataRate& rhs) const; - + /** * \brief Calculate transmission time * @@ -98,7 +98,7 @@ * \return The transmission time in seconds for the number of bytes specified */ double CalculateTxTime(uint32_t bytes) const; - + /** * Get the underlying bitrate * \return The underlying bitrate in bits per second diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/utils/drop-tail-queue.cc --- a/src/network/utils/drop-tail-queue.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/utils/drop-tail-queue.cc Fri May 13 14:57:43 2011 -0400 @@ -48,8 +48,8 @@ UintegerValue (100 * 65535), MakeUintegerAccessor (&DropTailQueue::m_maxBytes), MakeUintegerChecker ()) - ; - + ; + return tid; } @@ -66,20 +66,20 @@ NS_LOG_FUNCTION_NOARGS (); } - void +void DropTailQueue::SetMode (enum Mode mode) { NS_LOG_FUNCTION (mode); m_mode = mode; } - DropTailQueue::Mode +DropTailQueue::Mode DropTailQueue::GetMode (void) { NS_LOG_FUNCTION_NOARGS (); return m_mode; } - + bool DropTailQueue::DoEnqueue (Ptr p) { diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/utils/drop-tail-queue.h --- a/src/network/utils/drop-tail-queue.h Fri May 13 14:57:10 2011 -0400 +++ b/src/network/utils/drop-tail-queue.h Fri May 13 14:57:43 2011 -0400 @@ -51,7 +51,7 @@ enum Mode { ILLEGAL, /**< Mode not set */ PACKETS, /**< Use number of packets for maximum queue size */ - BYTES, /**< Use number of bytes for maximum queue size */ + BYTES, /**< Use number of bytes for maximum queue size */ }; /** diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/utils/error-model.cc --- a/src/network/utils/error-model.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/utils/error-model.cc Fri May 13 14:57:43 2011 -0400 @@ -45,7 +45,7 @@ BooleanValue (true), MakeBooleanAccessor (&ErrorModel::m_enable), MakeBooleanChecker ()) - ; + ; return tid; } @@ -124,7 +124,7 @@ RandomVariableValue (UniformVariable (0.0, 1.0)), MakeRandomVariableAccessor (&RateErrorModel::m_ranvar), MakeRandomVariableChecker ()) - ; + ; return tid; } @@ -180,7 +180,7 @@ NS_LOG_FUNCTION_NOARGS (); if (!IsEnabled ()) { - return false; + return false; } switch (m_unit) { @@ -240,11 +240,11 @@ static TypeId tid = TypeId ("ns3::ListErrorModel") .SetParent () .AddConstructor () - ; + ; return tid; } -ListErrorModel::ListErrorModel () +ListErrorModel::ListErrorModel () { NS_LOG_FUNCTION_NOARGS (); } @@ -277,16 +277,16 @@ NS_LOG_FUNCTION_NOARGS (); if (!IsEnabled ()) { - return false; + return false; } uint32_t uid = p->GetUid (); for (PacketListCI i = m_packetList.begin (); - i != m_packetList.end (); i++) + i != m_packetList.end (); i++) { if (uid == *i) - { - return true; - } + { + return true; + } } return false; } @@ -309,7 +309,7 @@ static TypeId tid = TypeId ("ns3::ReceiveListErrorModel") .SetParent () .AddConstructor () - ; + ; return tid; } @@ -345,16 +345,16 @@ NS_LOG_FUNCTION_NOARGS (); if (!IsEnabled ()) { - return false; + return false; } m_timesInvoked += 1; for (PacketListCI i = m_packetList.begin (); - i != m_packetList.end (); i++) + i != m_packetList.end (); i++) { if (m_timesInvoked - 1 == *i) - { - return true; - } + { + return true; + } } return false; } diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/utils/error-model.h --- a/src/network/utils/error-model.h Fri May 13 14:57:10 2011 -0400 +++ b/src/network/utils/error-model.h Fri May 13 14:57:43 2011 -0400 @@ -47,7 +47,7 @@ * data buffer errored or not, or side information may be returned to * the client in the form of a packet tag. (Note: No such error models * that actually error the bits in a packet presently exist). - * The object can have state (resettable by Reset()). + * The object can have state (resettable by Reset()). * The object can also be enabled and disabled via two public member functions. * * Typical code (simplified) to use an ErrorModel may look something like @@ -66,36 +66,36 @@ * } * \endcode * - * Two practical error models, a ListErrorModel and a RateErrorModel, + * Two practical error models, a ListErrorModel and a RateErrorModel, * are currently implemented. */ class ErrorModel : public Object { public: static TypeId GetTypeId (void); - + ErrorModel (); virtual ~ErrorModel (); - /** - * Note: Depending on the error model, this function may or may not - * alter the contents of the packet upon returning true. - * - * \returns true if the Packet is to be considered as errored/corrupted - * \param pkt Packet to apply error model to - */ + /** + * Note: Depending on the error model, this function may or may not + * alter the contents of the packet upon returning true. + * + * \returns true if the Packet is to be considered as errored/corrupted + * \param pkt Packet to apply error model to + */ bool IsCorrupt (Ptr pkt); - /** - * Reset any state associated with the error model - */ + /** + * Reset any state associated with the error model + */ void Reset (void); - /** - * Enable the error model - */ + /** + * Enable the error model + */ void Enable (void); - /** - * Disable the error model - */ + /** + * Disable the error model + */ void Disable (void); /** * \return true if error model is enabled; false otherwise @@ -113,11 +113,11 @@ }; enum ErrorUnit - { - EU_BIT, - EU_BYTE, - EU_PKT - }; +{ + EU_BIT, + EU_BYTE, + EU_PKT +}; /** * \brief Determine which packets are errored corresponding to an underlying @@ -226,7 +226,7 @@ typedef std::list::const_iterator PacketListCI; PacketList m_packetList; - + }; /** @@ -268,7 +268,7 @@ PacketList m_packetList; uint32_t m_timesInvoked; - + }; diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/utils/ethernet-header.cc --- a/src/network/utils/ethernet-header.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/utils/ethernet-header.cc Fri May 13 14:57:43 2011 -0400 @@ -35,36 +35,38 @@ EthernetHeader::EthernetHeader (bool hasPreamble) : m_enPreambleSfd (hasPreamble), m_lengthType (0) -{} +{ +} EthernetHeader::EthernetHeader () : m_enPreambleSfd (false), m_lengthType (0) -{} +{ +} -void +void EthernetHeader::SetLengthType (uint16_t lengthType) { m_lengthType = lengthType; } -uint16_t +uint16_t EthernetHeader::GetLengthType (void) const { return m_lengthType; } -void +void EthernetHeader::SetPreambleSfd (uint64_t preambleSfd) { m_preambleSfd = preambleSfd; } -uint64_t +uint64_t EthernetHeader::GetPreambleSfd (void) const { return m_preambleSfd; } -void +void EthernetHeader::SetSource (Mac48Address source) { m_source = source; @@ -105,7 +107,7 @@ static TypeId tid = TypeId ("ns3::EthernetHeader") .SetParent
() .AddConstructor () - ; + ; return tid; } TypeId @@ -143,7 +145,7 @@ EthernetHeader::Serialize (Buffer::Iterator start) const { Buffer::Iterator i = start; - + if (m_enPreambleSfd) { i.WriteU64(m_preambleSfd); diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/utils/ethernet-header.h --- a/src/network/utils/ethernet-header.h Fri May 13 14:57:10 2011 -0400 +++ b/src/network/utils/ethernet-header.h Fri May 13 14:57:43 2011 -0400 @@ -27,16 +27,16 @@ namespace ns3 { - /** - * Types of ethernet packets. Indicates the type of the current - * header. - */ - enum ethernet_header_t { - LENGTH, /**< Basic ethernet packet, no tags, type/length field +/** + * Types of ethernet packets. Indicates the type of the current + * header. + */ +enum ethernet_header_t { + LENGTH, /**< Basic ethernet packet, no tags, type/length field indicates packet length or IP/ARP packet */ - VLAN, /**< Single tagged packet. Header includes VLAN tag */ - QINQ /**< Double tagged packet. Header includes two VLAN tags */ - }; + VLAN, /**< Single tagged packet. Header includes VLAN tag */ + QINQ /**< Double tagged packet. Header includes two VLAN tags */ +}; /** * \ingroup network * @@ -93,7 +93,7 @@ /** * \return The destination address of this packet */ - Mac48Address GetDestination (void) const; + Mac48Address GetDestination (void) const; /** * \return The value of the PreambleSfd field */ diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/utils/ethernet-trailer.cc --- a/src/network/utils/ethernet-trailer.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/utils/ethernet-trailer.cc Fri May 13 14:57:43 2011 -0400 @@ -32,9 +32,10 @@ EthernetTrailer::EthernetTrailer () : m_calcFcs (false), m_fcs (0) -{} +{ +} -void +void EthernetTrailer::EnableFcs (bool enable) { m_calcFcs = enable; @@ -100,7 +101,7 @@ static TypeId tid = TypeId ("ns3::EthernetTrailer") .SetParent () .AddConstructor () - ; + ; return tid; } TypeId @@ -124,7 +125,7 @@ { Buffer::Iterator i = end; i.Prev(GetSerializedSize()); - + i.WriteU32 (m_fcs); } uint32_t @@ -152,8 +153,8 @@ crc ^= *buffer++; for (i = 0; i < 8; i++) { - crc = (crc >> 1) ^ ((crc & 1) ? 0xedb88320 : 0); - } + crc = (crc >> 1) ^ ((crc & 1) ? 0xedb88320 : 0); + } } return ~crc; } diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/utils/flow-id-tag.cc --- a/src/network/utils/flow-id-tag.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/utils/flow-id-tag.cc Fri May 13 14:57:43 2011 -0400 @@ -29,7 +29,7 @@ static TypeId tid = TypeId ("ns3::FlowIdTag") .SetParent () .AddConstructor () - ; + ; return tid; } TypeId @@ -59,12 +59,14 @@ } FlowIdTag::FlowIdTag () : Tag () -{} +{ +} FlowIdTag::FlowIdTag (uint32_t id) : Tag (), m_flowId (id) -{} +{ +} void FlowIdTag::SetFlowId (uint32_t id) diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/utils/inet-socket-address.cc --- a/src/network/utils/inet-socket-address.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/utils/inet-socket-address.cc Fri May 13 14:57:43 2011 -0400 @@ -26,29 +26,34 @@ InetSocketAddress::InetSocketAddress (Ipv4Address ipv4, uint16_t port) : m_ipv4 (ipv4), m_port (port) -{} +{ +} InetSocketAddress::InetSocketAddress (Ipv4Address ipv4) : m_ipv4 (ipv4), m_port (0) -{} +{ +} InetSocketAddress::InetSocketAddress (const char *ipv4, uint16_t port) : m_ipv4 (Ipv4Address (ipv4)), m_port (port) -{} +{ +} InetSocketAddress::InetSocketAddress (const char * ipv4) : m_ipv4 (Ipv4Address (ipv4)), m_port (0) -{} +{ +} InetSocketAddress::InetSocketAddress (uint16_t port) : m_ipv4 (Ipv4Address::GetAny ()), m_port (port) -{} -uint16_t +{ +} +uint16_t InetSocketAddress::GetPort (void) const { return m_port; } -Ipv4Address +Ipv4Address InetSocketAddress::GetIpv4 (void) const { return m_ipv4; @@ -59,13 +64,13 @@ { m_port = port; } -void +void InetSocketAddress::SetIpv4 (Ipv4Address address) { m_ipv4 = address; } -bool +bool InetSocketAddress::IsMatchingType (const Address &address) { return address.CheckCompatible (GetType (), 6); diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/utils/inet6-socket-address.cc --- a/src/network/utils/inet6-socket-address.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/utils/inet6-socket-address.cc Fri May 13 14:57:43 2011 -0400 @@ -27,31 +27,31 @@ Inet6SocketAddress::Inet6SocketAddress (Ipv6Address ipv6, uint16_t port) : m_ipv6(ipv6), - m_port(port) + m_port(port) { } Inet6SocketAddress::Inet6SocketAddress (Ipv6Address ipv6) : m_ipv6(ipv6), - m_port(0) + m_port(0) { } Inet6SocketAddress::Inet6SocketAddress (const char* ipv6, uint16_t port) : m_ipv6(Ipv6Address(ipv6)), - m_port(port) + m_port(port) { } Inet6SocketAddress::Inet6SocketAddress (const char* ipv6) : m_ipv6(Ipv6Address(ipv6)), - m_port(0) + m_port(0) { } Inet6SocketAddress::Inet6SocketAddress (uint16_t port) : m_ipv6(Ipv6Address::GetAny()), - m_port(port) + m_port(port) { } diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/utils/ipv4-address.cc --- a/src/network/utils/ipv4-address.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/utils/ipv4-address.cc Fri May 13 14:57:43 2011 -0400 @@ -55,18 +55,20 @@ return host; } -}//namespace ns3 +} //namespace ns3 namespace ns3 { - + Ipv4Mask::Ipv4Mask () : m_mask (0x66666666) -{} +{ +} Ipv4Mask::Ipv4Mask (uint32_t mask) : m_mask (mask) -{} +{ +} Ipv4Mask::Ipv4Mask (char const *mask) { @@ -93,20 +95,20 @@ Ipv4Mask::IsEqual (Ipv4Mask other) const { if (other.m_mask == m_mask) { - return true; - } else { - return false; - } + return true; + } else { + return false; + } } bool Ipv4Mask::IsMatch (Ipv4Address a, Ipv4Address b) const { if ((a.Get () & m_mask) == (b.Get () & m_mask)) { - return true; - } else { - return false; - } + return true; + } else { + return false; + } } uint32_t @@ -160,17 +162,18 @@ uint16_t tmp = 0; uint32_t mask = m_mask; while (mask != 0 ) - { - mask = mask << 1; - tmp++; - } + { + mask = mask << 1; + tmp++; + } return tmp; } Ipv4Address::Ipv4Address () : m_address (0x66666666) -{} +{ +} Ipv4Address::Ipv4Address (uint32_t address) { m_address = address; diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/utils/ipv6-address.cc --- a/src/network/utils/ipv6-address.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/utils/ipv6-address.cc Fri May 13 14:57:43 2011 -0400 @@ -47,15 +47,15 @@ { #define mix(a, b, c) \ ({ \ - (a) -= (b); (a) -= (c); (a) ^= ((c) >> 13); \ - (b) -= (c); (b) -= (a); (b) ^= ((a) << 8); \ - (c) -= (a); (c) -= (b); (c) ^= ((b) >> 13); \ - (a) -= (b); (a) -= (c); (a) ^= ((c) >> 12); \ - (b) -= (c); (b) -= (a); (b) ^= ((a) << 16); \ - (c) -= (a); (c) -= (b); (c) ^= ((b) >> 5); \ - (a) -= (b); (a) -= (c); (a) ^= ((c) >> 3); \ - (b) -= (c); (b) -= (a); (b) ^= ((a) << 10); \ - (c) -= (a); (c) -= (b); (c) ^= ((b) >> 15); \ + (a) -= (b); (a) -= (c); (a) ^= ((c) >> 13); \ + (b) -= (c); (b) -= (a); (b) ^= ((a) << 8); \ + (c) -= (a); (c) -= (b); (c) ^= ((b) >> 13); \ + (a) -= (b); (a) -= (c); (a) ^= ((c) >> 12); \ + (b) -= (c); (b) -= (a); (b) ^= ((a) << 16); \ + (c) -= (a); (c) -= (b); (c) ^= ((b) >> 5); \ + (a) -= (b); (a) -= (c); (a) ^= ((c) >> 3); \ + (b) -= (c); (b) -= (a); (b) ^= ((a) << 10); \ + (c) -= (a); (c) -= (b); (c) ^= ((b) >> 15); \ }) typedef uint32_t ub4; /* unsigned 4-byte quantities */ @@ -87,16 +87,16 @@ { case 11: c += ((ub4)k[10] << 24); case 10: c += ((ub4)k[9] << 16); - case 9 : c += ((ub4)k[8] << 8); /* the first byte of c is reserved for the length */ - case 8 : b += ((ub4)k[7] << 24); - case 7 : b += ((ub4)k[6] << 16); - case 6 : b += ((ub4)k[5] << 8); - case 5 : b += k[4]; - case 4 : a += ((ub4)k[3] << 24); - case 3 : a += ((ub4)k[2] << 16); - case 2 : a += ((ub4)k[1] << 8); - case 1 : a += k[0]; - /* case 0: nothing left to add */ + case 9: c += ((ub4)k[8] << 8); /* the first byte of c is reserved for the length */ + case 8: b += ((ub4)k[7] << 24); + case 7: b += ((ub4)k[6] << 16); + case 6: b += ((ub4)k[5] << 8); + case 5: b += k[4]; + case 4: a += ((ub4)k[3] << 24); + case 3: a += ((ub4)k[2] << 16); + case 2: a += ((ub4)k[1] << 8); + case 1: a += k[0]; + /* case 0: nothing left to add */ } mix (a, b, c); @@ -180,7 +180,7 @@ return (0); } - *tp++ = (unsigned char) (val >> 8) & 0xff; + *tp++ = (unsigned char)(val >> 8) & 0xff; *tp++ = (unsigned char) val & 0xff; seen_xdigits = 0; val = 0; @@ -194,7 +194,7 @@ { tp += 4 /*NS_INADDRSZ*/; seen_xdigits = 0; - break;/* '\0' was seen by inet_pton4(). */ + break; /* '\0' was seen by inet_pton4(). */ } #endif return (0); @@ -206,7 +206,7 @@ { return (0); } - *tp++ = (unsigned char) (val >> 8) & 0xff; + *tp++ = (unsigned char)(val >> 8) & 0xff; *tp++ = (unsigned char) val & 0xff; } @@ -226,7 +226,7 @@ for (i = 1; i <= n; i++) { - endp[- i] = colonp[n - i]; + endp[-i] = colonp[n - i]; colonp[n - i] = 0; } @@ -359,22 +359,22 @@ void Ipv6Address::Print (std::ostream& os) const { os << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_address[0] - << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_address[1] << ":" - << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_address[2] - << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_address[3] << ":" - << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_address[4] - << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_address[5] << ":" - << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_address[6] - << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_address[7] << ":" - << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_address[8] - << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_address[9] << ":" - << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_address[10] - << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_address[11] << ":" - << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_address[12] - << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_address[13] << ":" - << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_address[14] - << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_address[15] - << std::dec << std::setfill (' '); + << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_address[1] << ":" + << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_address[2] + << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_address[3] << ":" + << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_address[4] + << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_address[5] << ":" + << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_address[6] + << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_address[7] << ":" + << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_address[8] + << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_address[9] << ":" + << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_address[10] + << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_address[11] << ":" + << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_address[12] + << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_address[13] << ":" + << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_address[14] + << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_address[15] + << std::dec << std::setfill (' '); } bool Ipv6Address::IsLocalhost () const @@ -645,21 +645,21 @@ void Ipv6Prefix::Print (std::ostream &os) const { os << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[0] - << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[1] << ":" - << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[2] - << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[3] << ":" - << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[4] - << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[5] << ":" - << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[6] - << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[7] << ":" - << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[8] - << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[9] << ":" - << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[10] - << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[11] << ":" - << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[12] - << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[13] << ":" - << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[14] - << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[15]; + << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[1] << ":" + << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[2] + << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[3] << ":" + << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[4] + << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[5] << ":" + << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[6] + << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[7] << ":" + << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[8] + << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[9] << ":" + << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[10] + << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[11] << ":" + << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[12] + << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[13] << ":" + << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[14] + << std::hex << std::setw (2) << std::setfill ('0') << (unsigned int) m_prefix[15]; } Ipv6Prefix Ipv6Prefix::GetLoopback () diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/utils/ipv6-address.h --- a/src/network/utils/ipv6-address.h Fri May 13 14:57:10 2011 -0400 +++ b/src/network/utils/ipv6-address.h Fri May 13 14:57:43 2011 -0400 @@ -42,7 +42,7 @@ */ class Ipv6Address { -public : +public: /** * \brief Default constructor. */ diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/utils/llc-snap-header.cc --- a/src/network/utils/llc-snap-header.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/utils/llc-snap-header.cc Fri May 13 14:57:43 2011 -0400 @@ -27,9 +27,10 @@ NS_OBJECT_ENSURE_REGISTERED (LlcSnapHeader); LlcSnapHeader::LlcSnapHeader () -{} +{ +} -void +void LlcSnapHeader::SetType (uint16_t type) { m_etherType = type; @@ -52,7 +53,7 @@ static TypeId tid = TypeId ("ns3::LlcSnapHeader") .SetParent
() .AddConstructor () - ; + ; return tid; } TypeId @@ -73,7 +74,7 @@ LlcSnapHeader::Serialize (Buffer::Iterator start) const { Buffer::Iterator i = start; - uint8_t buf[] = {0xaa, 0xaa, 0x03, 0, 0, 0}; + uint8_t buf[] = { 0xaa, 0xaa, 0x03, 0, 0, 0}; i.Write (buf, 6); i.WriteHtonU16 (m_etherType); } diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/utils/mac48-address.cc --- a/src/network/utils/mac48-address.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/utils/mac48-address.cc Fri May 13 14:57:43 2011 -0400 @@ -39,12 +39,12 @@ AsciiToLowCase (char c) { if (c >= ASCII_a && c <= ASCII_z) { - return c; - } else if (c >= ASCII_A && c <= ASCII_Z) { - return c + (ASCII_a - ASCII_A); - } else { - return c; - } + return c; + } else if (c >= ASCII_A && c <= ASCII_Z) { + return c + (ASCII_a - ASCII_A); + } else { + return c; + } } @@ -59,25 +59,25 @@ { uint8_t byte = 0; while (*str != ASCII_COLON && *str != 0) - { - byte <<= 4; - char low = AsciiToLowCase (*str); - if (low >= ASCII_a) - { - byte |= low - ASCII_a + 10; - } - else - { - byte |= low - ASCII_ZERO; - } - str++; - } + { + byte <<= 4; + char low = AsciiToLowCase (*str); + if (low >= ASCII_a) + { + byte |= low - ASCII_a + 10; + } + else + { + byte |= low - ASCII_ZERO; + } + str++; + } m_address[i] = byte; i++; if (*str == 0) - { - break; - } + { + break; + } str++; } NS_ASSERT (i == 6); @@ -261,17 +261,17 @@ std::string::size_type next; next = v.find (":", col); if (next == std::string::npos) - { - tmp = v.substr (col, v.size ()-col); - address.m_address[i] = AsInt (tmp); - break; - } + { + tmp = v.substr (col, v.size ()-col); + address.m_address[i] = AsInt (tmp); + break; + } else - { - tmp = v.substr (col, next-col); - address.m_address[i] = AsInt (tmp); - col = next + 1; - } + { + tmp = v.substr (col, next-col); + address.m_address[i] = AsInt (tmp); + col = next + 1; + } } return is; } diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/utils/mac48-address.h --- a/src/network/utils/mac48-address.h Fri May 13 14:57:10 2011 -0400 +++ b/src/network/utils/mac48-address.h Fri May 13 14:57:43 2011 -0400 @@ -91,7 +91,7 @@ * \returns true if this is a broadcast address, false otherwise. */ bool IsBroadcast (void) const; - + /** * \returns true if the group bit is set, false otherwise. */ diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/utils/mac64-address.cc --- a/src/network/utils/mac64-address.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/utils/mac64-address.cc Fri May 13 14:57:43 2011 -0400 @@ -37,12 +37,12 @@ AsciiToLowCase (char c) { if (c >= ASCII_a && c <= ASCII_z) { - return c; - } else if (c >= ASCII_A && c <= ASCII_Z) { - return c + (ASCII_a - ASCII_A); - } else { - return c; - } + return c; + } else if (c >= ASCII_A && c <= ASCII_Z) { + return c + (ASCII_a - ASCII_A); + } else { + return c; + } } @@ -57,25 +57,25 @@ { uint8_t byte = 0; while (*str != ASCII_COLON && *str != 0) - { - byte <<= 4; - char low = AsciiToLowCase (*str); - if (low >= ASCII_a) - { - byte |= low - ASCII_a + 10; - } - else - { - byte |= low - ASCII_ZERO; - } - str++; - } + { + byte <<= 4; + char low = AsciiToLowCase (*str); + if (low >= ASCII_a) + { + byte |= low - ASCII_a + 10; + } + else + { + byte |= low - ASCII_ZERO; + } + str++; + } m_address[i] = byte; i++; if (*str == 0) - { - break; - } + { + break; + } str++; } NS_ASSERT (i == 6); @@ -147,7 +147,7 @@ } bool operator != (const Mac64Address &a, const Mac64Address &b) { - return ! (a == b); + return !(a == b); } std::ostream& operator<< (std::ostream& os, const Mac64Address & address) diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/utils/output-stream-wrapper.h --- a/src/network/utils/output-stream-wrapper.h Fri May 13 14:57:10 2011 -0400 +++ b/src/network/utils/output-stream-wrapper.h Fri May 13 14:57:43 2011 -0400 @@ -41,7 +41,7 @@ * When writing traced information to a file, the tempting ns-3 idiom is to * create a bound callback with an ofstream as the bound object. Unfortunately, * this implies a copy construction in order to get the ofstream object into the - * callback. This operation, as mentioned above, is forbidden by the STL. + * callback. This operation, as mentioned above, is forbidden by the STL. * Using this class in ns-3 APIs is generally preferable to passing global * pointers to ostream objects, or passing a pointer to a stack allocated * ostream (which creates object lifetime issues). @@ -82,7 +82,7 @@ * \returns a pointer to the encapsulated std::ostream */ std::ostream *GetStream (void); - + private: std::ostream *m_ostream; bool m_destroyable; diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/utils/packet-socket-address.cc --- a/src/network/utils/packet-socket-address.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/utils/packet-socket-address.cc Fri May 13 14:57:43 2011 -0400 @@ -23,8 +23,9 @@ namespace ns3 { PacketSocketAddress::PacketSocketAddress () -{} -void +{ +} +void PacketSocketAddress::SetProtocol (uint16_t protocol) { m_protocol = protocol; @@ -84,7 +85,7 @@ buffer[3] = (m_device >> 16) & 0xff; buffer[4] = (m_device >> 8) & 0xff; buffer[5] = (m_device >> 0) & 0xff; - buffer[6] = m_isSingleDevice?1:0; + buffer[6] = m_isSingleDevice ? 1 : 0; uint32_t copied = m_address.CopyAllTo (buffer + 7, Address::MAX_SIZE - 7); return Address (GetType (), buffer, 7 + copied); } @@ -103,7 +104,7 @@ device |= buffer[4]; device <<= 8; device |= buffer[5]; - bool isSingleDevice = (buffer[6] == 1)?true:false; + bool isSingleDevice = (buffer[6] == 1) ? true : false; Address physical; physical.CopyAllFrom (buffer + 7, Address::MAX_SIZE - 7); PacketSocketAddress ad; diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/utils/packet-socket-address.h --- a/src/network/utils/packet-socket-address.h Fri May 13 14:57:10 2011 -0400 +++ b/src/network/utils/packet-socket-address.h Fri May 13 14:57:43 2011 -0400 @@ -37,7 +37,7 @@ */ class PacketSocketAddress { - public: +public: PacketSocketAddress (); void SetProtocol (uint16_t protocol); @@ -68,7 +68,7 @@ * \returns true if the address matches, false otherwise. */ static bool IsMatchingType (const Address &address); - private: +private: static uint8_t GetType (void); Address ConvertTo (void) const; uint16_t m_protocol; diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/utils/packet-socket-factory.cc --- a/src/network/utils/packet-socket-factory.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/utils/packet-socket-factory.cc Fri May 13 14:57:43 2011 -0400 @@ -34,7 +34,8 @@ } PacketSocketFactory::PacketSocketFactory () -{} +{ +} Ptr PacketSocketFactory::CreateSocket (void) { diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/utils/packet-socket.cc --- a/src/network/utils/packet-socket.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/utils/packet-socket.cc Fri May 13 14:57:43 2011 -0400 @@ -48,7 +48,7 @@ UintegerValue (131072), MakeUintegerAccessor (&PacketSocket::m_rcvBufSize), MakeUintegerChecker ()) - ; + ; return tid; } @@ -233,7 +233,7 @@ m_state = STATE_CONNECTED; NotifyConnectionSucceeded (); return 0; - error: +error: NotifyConnectionFailed (); return -1; } @@ -282,7 +282,7 @@ { if (m_state == STATE_CONNECTED) { - PacketSocketAddress ad = PacketSocketAddress::ConvertFrom (m_destAddr); + PacketSocketAddress ad = PacketSocketAddress::ConvertFrom (m_destAddr); return GetMinMtu (ad); } // If we are not connected, we return a 'safe' value by default. @@ -318,7 +318,7 @@ m_errno = ERROR_MSGSIZE; return -1; } - + bool error = false; Address dest = ad.GetPhysicalAddress (); if (ad.IsSingleDevice ()) @@ -451,21 +451,21 @@ { NS_LOG_FUNCTION (this << address); PacketSocketAddress ad = PacketSocketAddress::ConvertFrom(address); - + ad.SetProtocol (m_protocol); if (m_isSingleDevice) { Ptr device = m_node->GetDevice (ad.GetSingleDevice ()); - ad.SetPhysicalAddress(device->GetAddress()); + ad.SetPhysicalAddress(device->GetAddress()); ad.SetSingleDevice (m_device); } else { - ad.SetPhysicalAddress(Address()); + ad.SetPhysicalAddress(Address()); ad.SetAllDevices (); - } + } address = ad; - + return 0; } @@ -485,4 +485,4 @@ return false; } -}//namespace ns3 +} //namespace ns3 diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/utils/packet-socket.h --- a/src/network/utils/packet-socket.h Fri May 13 14:57:10 2011 -0400 +++ b/src/network/utils/packet-socket.h Fri May 13 14:57:43 2011 -0400 @@ -101,7 +101,7 @@ virtual uint32_t GetRxAvailable (void) const; virtual Ptr Recv (uint32_t maxSize, uint32_t flags); virtual Ptr RecvFrom (uint32_t maxSize, uint32_t flags, - Address &fromAddress); + Address &fromAddress); virtual int GetSockName (Address &address) const; virtual bool SetAllowBroadcast (bool allowBroadcast); virtual bool GetAllowBroadcast () const; @@ -132,15 +132,15 @@ std::queue > m_deliveryQueue; uint32_t m_rxAvailable; - + TracedCallback > m_dropTrace; - + // Socket options (attributes) uint32_t m_rcvBufSize; }; -}//namespace ns3 +} //namespace ns3 #endif /* PACKET_SOCKET_H */ diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/utils/packetbb.cc --- a/src/network/utils/packetbb.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/utils/packetbb.cc Fri May 13 14:57:43 2011 -0400 @@ -257,8 +257,8 @@ ConstIterator ti, oi; for (ti = Begin (), oi = other.Begin (); - ti != End () && oi != other.End (); - ti++, oi++) + ti != End () && oi != other.End (); + ti++, oi++) { if (**ti != **oi) { @@ -429,11 +429,11 @@ if (size > 0) { while (start.GetDistanceFrom (tlvstart) < size) - { - Ptr newtlv = Create (); - newtlv->Deserialize (start); - PushBack (newtlv); - } + { + Ptr newtlv = Create (); + newtlv->Deserialize (start); + PushBack (newtlv); + } } } @@ -475,8 +475,8 @@ ConstIterator it, ot; for (it = Begin (), ot = other.Begin (); - it != End () && ot != other.End (); - it++, ot++) + it != End () && ot != other.End (); + it++, ot++) { if (**it != **ot) { @@ -730,7 +730,7 @@ PbbPacket::MessageIterator PbbPacket::Erase (PbbPacket::MessageIterator first, - PbbPacket::MessageIterator last) + PbbPacket::MessageIterator last) { return m_messageList.erase (first, last); } @@ -779,8 +779,8 @@ } for (ConstMessageIterator iter = MessageBegin (); - iter != MessageEnd (); - iter++) + iter != MessageEnd (); + iter++) { size += (*iter)->GetSerializedSize (); } @@ -815,8 +815,8 @@ bufref.WriteU8(flags); for (ConstMessageIterator iter = MessageBegin (); - iter != MessageEnd (); - iter++) + iter != MessageEnd (); + iter++) { (*iter)->Serialize (start); } @@ -870,8 +870,8 @@ m_tlvList.Print (os, 1); for (ConstMessageIterator iter = MessageBegin (); - iter != MessageEnd (); - iter++) + iter != MessageEnd (); + iter++) { (*iter)->Print (os, 1); } @@ -905,13 +905,13 @@ if (MessageSize () != other.MessageSize ()) { - return false; + return false; } ConstMessageIterator tmi, omi; for (tmi = MessageBegin (), omi = other.MessageBegin (); - tmi != MessageEnd () && omi != other.MessageEnd (); - tmi++, omi++) + tmi != MessageEnd () && omi != other.MessageEnd (); + tmi++, omi++) { if (**tmi != **omi) { @@ -1240,7 +1240,7 @@ PbbMessage::AddressBlockIterator PbbMessage::AddressBlockErase (PbbMessage::AddressBlockIterator first, - PbbMessage::AddressBlockIterator last) + PbbMessage::AddressBlockIterator last) { return m_addressBlockList.erase(first, last); } @@ -1249,8 +1249,8 @@ PbbMessage::AddressBlockClear (void) { for (AddressBlockIterator iter = AddressBlockBegin (); - iter != AddressBlockEnd (); - iter++) + iter != AddressBlockEnd (); + iter++) { *iter = 0; } @@ -1286,8 +1286,8 @@ size += m_tlvList.GetSerializedSize (); for (ConstAddressBlockIterator iter = AddressBlockBegin (); - iter != AddressBlockEnd (); - iter++) + iter != AddressBlockEnd (); + iter++) { size += (*iter)->GetSerializedSize (); } @@ -1342,8 +1342,8 @@ m_tlvList.Serialize (start); for (ConstAddressBlockIterator iter = AddressBlockBegin (); - iter != AddressBlockEnd (); - iter++) + iter != AddressBlockEnd (); + iter++) { (*iter)->Serialize (start); } @@ -1368,16 +1368,16 @@ switch (addrlen) { - case 0: - case IPV4: - newmsg = Create (); - break; - case IPV6: - newmsg = Create (); - break; - default: - return 0; - break; + case 0: + case IPV4: + newmsg = Create (); + break; + case IPV6: + newmsg = Create (); + break; + default: + return 0; + break; } newmsg->Deserialize (start); return newmsg; @@ -1469,8 +1469,8 @@ m_tlvList.Print (os, level+1); for (ConstAddressBlockIterator iter = AddressBlockBegin (); - iter != AddressBlockEnd (); - iter++) + iter != AddressBlockEnd (); + iter++) { (*iter)->Print (os, level+1); } @@ -1554,8 +1554,8 @@ ConstAddressBlockIterator tai, oai; for (tai = AddressBlockBegin (), oai = other.AddressBlockBegin (); - tai != AddressBlockEnd () && oai != other.AddressBlockEnd (); - tai++, oai++) + tai != AddressBlockEnd () && oai != other.AddressBlockEnd (); + tai++, oai++) { if (**tai != **oai) { @@ -1666,10 +1666,12 @@ /* End PbbMessageIpv6 Class */ PbbAddressBlock::PbbAddressBlock () -{} +{ +} PbbAddressBlock::~PbbAddressBlock () -{} +{ +} /* Manipulating the address block */ @@ -1753,12 +1755,12 @@ PbbAddressBlock::AddressIterator PbbAddressBlock::AddressErase (PbbAddressBlock::AddressIterator first, - PbbAddressBlock::AddressIterator last) + PbbAddressBlock::AddressIterator last) { return m_addressList.erase(first, last); } - void +void PbbAddressBlock::AddressClear (void) { return m_addressList.clear(); @@ -1956,7 +1958,7 @@ PbbAddressBlock::TlvIterator PbbAddressBlock::TlvErase (PbbAddressBlock::TlvIterator first, - PbbAddressBlock::TlvIterator last) + PbbAddressBlock::TlvIterator last) { return m_addressTlvList.Erase(first, last); } @@ -2066,8 +2068,8 @@ { uint8_t mid[GetAddressLength ()]; for (PbbAddressBlock::ConstAddressIterator iter = AddressBegin (); - iter != AddressEnd (); - iter++) + iter != AddressEnd (); + iter++) { SerializeAddress (mid, iter); start.Write (mid + headlen, GetAddressLength () - headlen - taillen); @@ -2078,13 +2080,13 @@ bufref.WriteU8 (flags); for (ConstPrefixIterator iter = PrefixBegin (); - iter != PrefixEnd (); - iter++) + iter != PrefixEnd (); + iter++) { start.WriteU8 (*iter); } } - + m_addressTlvList.Serialize (start); } @@ -2110,7 +2112,7 @@ if ((flags & AHAS_FULL_TAIL) ^ (flags & AHAS_ZERO_TAIL)) { taillen = start.ReadU8 (); - + if (flags & AHAS_FULL_TAIL) { start.Read (addrtmp + GetAddressLength () - taillen, taillen); @@ -2157,8 +2159,8 @@ os << prefix << "PbbAddressBlock {" << std::endl; os << prefix << "\taddresses = " << std::endl; for (ConstAddressIterator iter = AddressBegin (); - iter != AddressEnd (); - iter++) + iter != AddressEnd (); + iter++) { os << prefix << "\t\t"; PrintAddress(os, iter); @@ -2167,8 +2169,8 @@ os << prefix << "\tprefixes = " << std::endl; for (ConstPrefixIterator iter = PrefixBegin (); - iter != PrefixEnd (); - iter++) + iter != PrefixEnd (); + iter++) { os << prefix << "\t\t" << (int)(*iter) << std::endl; } @@ -2186,8 +2188,8 @@ ConstAddressIterator tai, oai; for (tai = AddressBegin (), oai = other.AddressBegin (); - tai != AddressEnd () && oai != other.AddressEnd (); - tai++, oai++) + tai != AddressEnd () && oai != other.AddressEnd (); + tai++, oai++) { if (*tai != *oai) { @@ -2202,8 +2204,8 @@ ConstPrefixIterator tpi, opi; for (tpi = PrefixBegin (), opi = other.PrefixBegin (); - tpi != PrefixEnd () && opi != other.PrefixEnd (); - tpi++, opi++) + tpi != PrefixEnd () && opi != other.PrefixEnd (); + tpi++, opi++) { if (*tpi != *opi) { @@ -2230,15 +2232,15 @@ { switch (PrefixSize ()) { - case 0: - return 0; - break; - case 1: - return AHAS_SINGLE_PRE_LEN; - break; - default: - return AHAS_MULTI_PRE_LEN; - break; + case 0: + return 0; + break; + case 1: + return AHAS_SINGLE_PRE_LEN; + break; + default: + return AHAS_MULTI_PRE_LEN; + break; } /* Quiet compiler */ @@ -2247,7 +2249,7 @@ void PbbAddressBlock::GetHeadTail (uint8_t *head, uint8_t &headlen, - uint8_t *tail, uint8_t &taillen) const + uint8_t *tail, uint8_t &taillen) const { headlen = GetAddressLength (); taillen = headlen; @@ -2261,8 +2263,8 @@ /* Skip the first item */ for (PbbAddressBlock::ConstAddressIterator iter = AddressBegin ()++; - iter != AddressEnd (); - iter++) + iter != AddressEnd (); + iter++) { SerializeAddress (bufcur, iter); @@ -2280,8 +2282,8 @@ if (headlen <= GetAddressLength () - 1) { for (i = GetAddressLength () - 1; - GetAddressLength () - 1 - i <= taillen && i > headlen; - i--) + GetAddressLength () - 1 - i <= taillen && i > headlen; + i--) { if (buflast[i] != bufcur[i]) { @@ -2692,7 +2694,7 @@ if (HasValue ()) { - os << prefix << "\thas value; size = " << GetValue (). GetSize () << std::endl; + os << prefix << "\thas value; size = " << GetValue ().GetSize () << std::endl; } os << prefix << "}" << std::endl; diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/utils/packetbb.h --- a/src/network/utils/packetbb.h Fri May 13 14:57:10 2011 -0400 +++ b/src/network/utils/packetbb.h Fri May 13 14:57:43 2011 -0400 @@ -946,7 +946,7 @@ * \return an iterator pointing to the next address block in the message. */ AddressBlockIterator AddressBlockErase (AddressBlockIterator first, - AddressBlockIterator last); + AddressBlockIterator last); /** * \brief Removes all address blocks from this message. @@ -1173,7 +1173,7 @@ * \return An iterator pointing to the newly inserted address. */ AddressIterator AddressInsert (AddressIterator position, - const Address value); + const Address value); /** * \brief Removes the address at the specified position. @@ -1453,7 +1453,7 @@ private: uint8_t GetPrefixFlags (void) const; void GetHeadTail (uint8_t *head, uint8_t &headlen, - uint8_t *tail, uint8_t &taillen) const; + uint8_t *tail, uint8_t &taillen) const; bool HasZeroTail (const uint8_t *tail, uint8_t taillen) const; std::list
m_addressList; diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/utils/pcap-file-wrapper.cc --- a/src/network/utils/pcap-file-wrapper.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/utils/pcap-file-wrapper.cc Fri May 13 14:57:43 2011 -0400 @@ -39,7 +39,7 @@ UintegerValue (PcapFile::SNAPLEN_DEFAULT), MakeUintegerAccessor (&PcapFileWrapper::m_snapLen), MakeUintegerChecker (0, PcapFile::SNAPLEN_DEFAULT)) - ; + ; return tid; } diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/utils/pcap-file-wrapper.h --- a/src/network/utils/pcap-file-wrapper.h Fri May 13 14:57:10 2011 -0400 +++ b/src/network/utils/pcap-file-wrapper.h Fri May 13 14:57:43 2011 -0400 @@ -193,7 +193,7 @@ * See http://wiki.wireshark.org/Development/LibpcapFileFormat */ uint32_t GetDataLinkType (void); - + private: PcapFile m_file; uint32_t m_snapLen; diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/utils/pcap-file.cc --- a/src/network/utils/pcap-file.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/utils/pcap-file.cc Fri May 13 14:57:43 2011 -0400 @@ -443,7 +443,7 @@ // // We don't always want to force the client to keep a maximum length buffer - // around so we allow her to specify a minimum number of bytes to read. + // around so we allow her to specify a minimum number of bytes to read. // Usually 64 bytes is enough information to print all of the headers, so // it isn't typically necessary to read all thousand bytes of an echo packet, // for example, to figure out what is going on. @@ -474,7 +474,7 @@ { return true; } - + uint8_t *data1 = new uint8_t [snapLen] (); uint8_t *data2 = new uint8_t [snapLen] (); uint32_t tsSec1, tsSec2; @@ -483,7 +483,7 @@ uint32_t origLen1, origLen2; uint32_t readLen1, readLen2; bool diff = false; - + while (!pcap1.Eof () && !pcap2.Eof ()) { pcap1.Read (data1, snapLen, tsSec1, tsUsec1, inclLen1, origLen1, readLen1); @@ -505,19 +505,19 @@ diff = true; // Next packet timestamps do not match break; } - + if (readLen1 != readLen2) { diff = true; // Packet lengths do not match break; } - + if (std::memcmp(data1, data2, readLen1) != 0) { diff = true; // Packet data do not match break; } - } + } sec = tsSec1; usec = tsUsec1; diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/utils/pcap-file.h --- a/src/network/utils/pcap-file.h Fri May 13 14:57:10 2011 -0400 +++ b/src/network/utils/pcap-file.h Fri May 13 14:57:43 2011 -0400 @@ -242,7 +242,7 @@ * See http://wiki.wireshark.org/Development/LibpcapFileFormat */ uint32_t GetDataLinkType (void); - + /** * \brief Compare two PCAP files packet-by-packet * @@ -292,6 +292,6 @@ bool m_swapMode; }; -}//namespace ns3 +} //namespace ns3 #endif /* PCAP_FILE_H */ diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/utils/queue.cc --- a/src/network/utils/queue.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/utils/queue.cc Fri May 13 14:57:43 2011 -0400 @@ -37,7 +37,7 @@ MakeTraceSourceAccessor (&Queue::m_traceDequeue)) .AddTraceSource ("Drop", "Drop a packet stored in the queue.", MakeTraceSourceAccessor (&Queue::m_traceDrop)) - ; + ; return tid; } @@ -75,7 +75,7 @@ uint32_t size = p->GetSize (); m_nBytes += size; m_nTotalReceivedBytes += size; - + m_nPackets++; m_nTotalReceivedPackets++; } diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/utils/queue.h --- a/src/network/utils/queue.h Fri May 13 14:57:10 2011 -0400 +++ b/src/network/utils/queue.h Fri May 13 14:57:43 2011 -0400 @@ -49,7 +49,7 @@ Queue (); virtual ~Queue (); - + /** * \return true if the queue is empty; false otherwise */ diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/utils/radiotap-header.cc --- a/src/network/utils/radiotap-header.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/utils/radiotap-header.cc Fri May 13 14:57:43 2011 -0400 @@ -23,7 +23,7 @@ #include "ns3/log.h" #include "radiotap-header.h" -NS_LOG_COMPONENT_DEFINE ("RadiotapHeader"); +NS_LOG_COMPONENT_DEFINE ("RadiotapHeader"); namespace ns3 { @@ -39,7 +39,7 @@ m_channelFlags(CHANNEL_FLAG_NONE), m_antennaSignal(0), m_antennaNoise(0) -{ +{ NS_LOG_FUNCTION (this); } @@ -48,7 +48,7 @@ static TypeId tid = TypeId ("ns3::RadiotapHeader") .SetParent
() .AddConstructor () - ; + ; return tid; } @@ -59,14 +59,14 @@ return GetTypeId (); } -uint32_t +uint32_t RadiotapHeader::GetSerializedSize (void) const { NS_LOG_FUNCTION (this); return m_length; } -void +void RadiotapHeader::Serialize (Buffer::Iterator start) const { NS_LOG_FUNCTION (this); @@ -75,7 +75,7 @@ start.WriteU8 (0); // pad field start.WriteU16 (m_length); // entire length of radiotap data + header start.WriteU32 (m_present); // bits describing which fields follow header - + // // Time Synchronization Function Timer (when the first bit of the MPDU // arrived at the MAC) @@ -129,20 +129,20 @@ } } -uint32_t +uint32_t RadiotapHeader::Deserialize (Buffer::Iterator start) { NS_LOG_FUNCTION (this); - + uint8_t __attribute__ ((unused)) tmp = start.ReadU8 (); // major version of radiotap header NS_ASSERT_MSG (tmp == 0x00, "RadiotapHeader::Deserialize(): Unexpected major version"); start.ReadU8 (); // pad field - + m_length = start.ReadU16 (); // entire length of radiotap data + header m_present = start.ReadU32 (); // bits describing which fields follow header - + uint32_t bytesRead = 8; - + // // Time Synchronization Function Timer (when the first bit of the MPDU arrived at the MAC) // @@ -209,12 +209,12 @@ m_antennaNoise = start.ReadU8(); ++bytesRead; } - + NS_ASSERT_MSG(m_length == bytesRead, "RadiotapHeader::Deserialize(): expected and actual lengths inconsistent"); return bytesRead; } -void +void RadiotapHeader::Print (std::ostream &os) const { NS_LOG_FUNCTION (this); @@ -227,7 +227,7 @@ << " noise=" << (int16_t) m_antennaNoise; } -void +void RadiotapHeader::SetTsft (uint64_t value) { NS_LOG_FUNCTION (this << value); @@ -242,7 +242,7 @@ NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec); } -uint64_t +uint64_t RadiotapHeader::GetTsft () const { NS_LOG_FUNCTION (this); @@ -346,16 +346,17 @@ m_antennaSignal = static_cast (floor(signal + 0.5)); } - NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec);} + NS_LOG_LOGIC (this << " m_length=" << m_length << " m_present=0x" << std::hex << m_present << std::dec); +} -uint8_t +uint8_t RadiotapHeader::GetAntennaSignalPower (void) const { NS_LOG_FUNCTION (this); return m_antennaSignal; } -void +void RadiotapHeader::SetAntennaNoisePower (double noise) { NS_LOG_FUNCTION (this << noise); diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/utils/radiotap-header.h --- a/src/network/utils/radiotap-header.h Fri May 13 14:57:10 2011 -0400 +++ b/src/network/utils/radiotap-header.h Fri May 13 14:57:43 2011 -0400 @@ -25,7 +25,7 @@ #include namespace ns3 { - + /** * @brief Radiotap header implementation * @@ -43,7 +43,7 @@ * fields will end up aligned without the need of inserting padding space. By * the term "gap" I mean not using a field which would appear between two used * fields. Moral: don't leave gaps, or if you do be careful about how you - * do it. + * do it. */ class RadiotapHeader : public Header { @@ -96,7 +96,7 @@ * @param os The output stream */ virtual void Print (std::ostream &os) const; - + /** * @brief Set the Time Synchronization Function Timer (TSFT) value. Valid for * received frames only. @@ -179,7 +179,7 @@ * @returns The transmit/receive data rate in units of 500 kbps. */ uint16_t GetChannelFrequency (void) const; - + /** * @brief Get the channel flags of the transmitted or received frame. * @returns The frame flags. @@ -242,18 +242,18 @@ RADIOTAP_EXT = 0x10000000 }; - void CheckAddChannelField(); - - uint16_t m_length; - uint32_t m_present; - - uint64_t m_tsft; - uint8_t m_flags; - uint8_t m_rate; - uint16_t m_channelFreq; - uint16_t m_channelFlags; - int8_t m_antennaSignal; - int8_t m_antennaNoise; + void CheckAddChannelField(); + + uint16_t m_length; + uint32_t m_present; + + uint64_t m_tsft; + uint8_t m_flags; + uint8_t m_rate; + uint16_t m_channelFreq; + uint16_t m_channelFlags; + int8_t m_antennaSignal; + int8_t m_antennaNoise; }; } // namespace ns3 diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/utils/sequence-number.h --- a/src/network/utils/sequence-number.h Fri May 13 14:57:10 2011 -0400 +++ b/src/network/utils/sequence-number.h Fri May 13 14:57:43 2011 -0400 @@ -279,7 +279,7 @@ os << val.m_value; return os; } - + template std::istream & operator >> (std::istream &is, const SequenceNumber &val) { diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/utils/simple-channel.cc --- a/src/network/utils/simple-channel.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/utils/simple-channel.cc Fri May 13 14:57:43 2011 -0400 @@ -36,43 +36,44 @@ static TypeId tid = TypeId ("ns3::SimpleChannel") .SetParent () .AddConstructor () - ; + ; return tid; } SimpleChannel::SimpleChannel () -{} +{ +} void -SimpleChannel::Send (Ptr p, uint16_t protocol, - Mac48Address to, Mac48Address from, - Ptr sender) +SimpleChannel::Send (Ptr p, uint16_t protocol, + Mac48Address to, Mac48Address from, + Ptr sender) { NS_LOG_FUNCTION (p << protocol << to << from << sender); for (std::vector >::const_iterator i = m_devices.begin (); i != m_devices.end (); ++i) { Ptr tmp = *i; if (tmp == sender) - { - continue; - } + { + continue; + } Simulator::ScheduleWithContext (tmp->GetNode ()->GetId (), Seconds (0), &SimpleNetDevice::Receive, tmp, p->Copy (), protocol, to, from); } } -void +void SimpleChannel::Add (Ptr device) { m_devices.push_back (device); } -uint32_t +uint32_t SimpleChannel::GetNDevices (void) const { return m_devices.size (); } -Ptr +Ptr SimpleChannel::GetDevice (uint32_t i) const { return m_devices[i]; diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/utils/simple-channel.h --- a/src/network/utils/simple-channel.h Fri May 13 14:57:10 2011 -0400 +++ b/src/network/utils/simple-channel.h Fri May 13 14:57:43 2011 -0400 @@ -40,7 +40,7 @@ SimpleChannel (); void Send (Ptr p, uint16_t protocol, Mac48Address to, Mac48Address from, - Ptr sender); + Ptr sender); void Add (Ptr device); diff -r 7ff8011cf487 -r 5ecfee5d17de src/network/utils/simple-net-device.cc --- a/src/network/utils/simple-net-device.cc Fri May 13 14:57:10 2011 -0400 +++ b/src/network/utils/simple-net-device.cc Fri May 13 14:57:43 2011 -0400 @@ -46,7 +46,7 @@ .AddTraceSource ("PhyRxDrop", "Trace source indicating a packet has been dropped by the device during reception", MakeTraceSourceAccessor (&SimpleNetDevice::m_phyRxDropTrace)) - ; + ; return tid; } @@ -55,11 +55,12 @@ m_node (0), m_mtu (0xffff), m_ifIndex (0) -{} +{ +} -void -SimpleNetDevice::Receive (Ptr packet, uint16_t protocol, - Mac48Address to, Mac48Address from) +void +SimpleNetDevice::Receive (Ptr packet, uint16_t protocol, + Mac48Address to, Mac48Address from) { NS_LOG_FUNCTION (packet << protocol << to << from); NetDevice::PacketType packetType;