From cbcde107819c5f0cdec6a040d7afb942efab7842 Mon Sep 17 00:00:00 2001 From: Josh Pelkey Date: Fri, 13 May 2011 14:54:37 -0400 Subject: [PATCH] flow-monitor coding style changes --- .../helper/flow-monitor-helper.cc | 6 +- src/flow-monitor/helper/flow-monitor-helper.h | 6 +- src/flow-monitor/model/flow-classifier.cc | 5 +- src/flow-monitor/model/flow-monitor.cc | 74 +++++++++---------- src/flow-monitor/model/flow-monitor.h | 6 +- src/flow-monitor/model/flow-probe.cc | 4 +- src/flow-monitor/model/flow-probe.h | 12 +-- src/flow-monitor/model/histogram.cc | 16 ++-- src/flow-monitor/model/histogram.h | 4 +- .../model/ipv4-flow-classifier.cc | 14 ++-- src/flow-monitor/model/ipv4-flow-classifier.h | 4 +- src/flow-monitor/model/ipv4-flow-probe.cc | 44 +++++------ src/flow-monitor/model/ipv4-flow-probe.h | 36 ++++----- src/flow-monitor/test/histogram-test-suite.cc | 11 +-- 14 files changed, 123 insertions(+), 119 deletions(-) diff --git a/src/flow-monitor/helper/flow-monitor-helper.cc b/src/flow-monitor/helper/flow-monitor-helper.cc index 72c2bc0d0..e19837b24 100644 --- a/src/flow-monitor/helper/flow-monitor-helper.cc +++ b/src/flow-monitor/helper/flow-monitor-helper.cc @@ -46,7 +46,7 @@ Ptr FlowMonitorHelper::GetMonitor () { if (!m_flowMonitor) - { + { m_flowMonitor = m_monitorFactory.Create (); m_flowClassifier = Create (); m_flowMonitor->SetFlowClassifier (m_flowClassifier); @@ -59,7 +59,7 @@ Ptr FlowMonitorHelper::GetClassifier () { if (!m_flowClassifier) - { + { m_flowClassifier = Create (); } return m_flowClassifier; @@ -103,7 +103,7 @@ FlowMonitorHelper::InstallAll () Install (node); } } - return m_flowMonitor; + return m_flowMonitor; } diff --git a/src/flow-monitor/helper/flow-monitor-helper.h b/src/flow-monitor/helper/flow-monitor-helper.h index 3539ec421..f22d9f7ac 100644 --- a/src/flow-monitor/helper/flow-monitor-helper.h +++ b/src/flow-monitor/helper/flow-monitor-helper.h @@ -29,7 +29,7 @@ namespace ns3 { class AttributeValue; -class Ipv4FlowClassifier; +class Ipv4FlowClassifier; /// \brief Helper to enable IPv4 flow monitoring on a set of Nodes class FlowMonitorHelper @@ -38,7 +38,7 @@ public: /// \brief Construct a FlowMonitorHelper class which makes it easier to /// configure and use the FlowMonitor FlowMonitorHelper (); - + /// \brief Set an attribute for the to-be-created FlowMonitor object void SetMonitorAttribute (std::string n1, const AttributeValue &v1); @@ -56,7 +56,7 @@ public: /// \brief Retrieve the FlowClassifier object created by the Install* methods Ptr GetClassifier (); - + private: ObjectFactory m_monitorFactory; Ptr m_flowMonitor; diff --git a/src/flow-monitor/model/flow-classifier.cc b/src/flow-monitor/model/flow-classifier.cc index 287e5bfbe..8123835c0 100644 --- a/src/flow-monitor/model/flow-classifier.cc +++ b/src/flow-monitor/model/flow-classifier.cc @@ -24,12 +24,13 @@ namespace ns3 { FlowClassifier::FlowClassifier () : - m_lastNewFlowId (0) + m_lastNewFlowId (0) { } FlowClassifier::~FlowClassifier () -{} +{ +} FlowId FlowClassifier::GetNewFlowId () diff --git a/src/flow-monitor/model/flow-monitor.cc b/src/flow-monitor/model/flow-monitor.cc index 45f14e0b0..328dfd274 100644 --- a/src/flow-monitor/model/flow-monitor.cc +++ b/src/flow-monitor/model/flow-monitor.cc @@ -34,7 +34,7 @@ namespace ns3 { NS_LOG_COMPONENT_DEFINE ("FlowMonitor"); NS_OBJECT_ENSURE_REGISTERED (FlowMonitor); - + TypeId FlowMonitor::GetTypeId (void) @@ -58,7 +58,7 @@ FlowMonitor::GetTypeId (void) .AddAttribute ("JitterBinWidth", ("The width used in the jitter histogram."), DoubleValue (0.001), MakeDoubleAccessor (&FlowMonitor::m_jitterBinWidth), - MakeDoubleChecker ()) + MakeDoubleChecker ()) .AddAttribute ("PacketSizeBinWidth", ("The width used in the packetSize histogram."), DoubleValue (20), MakeDoubleAccessor (&FlowMonitor::m_packetSizeBinWidth), @@ -71,7 +71,7 @@ FlowMonitor::GetTypeId (void) TimeValue (Seconds (0.5)), MakeTimeAccessor (&FlowMonitor::m_flowInterruptionsMinTime), MakeTimeChecker ()) - ; + ; return tid; } @@ -82,9 +82,9 @@ FlowMonitor::GetInstanceTypeId (void) const } FlowMonitor::FlowMonitor () - : m_enabled (false) + : m_enabled (false) { - // m_histogramBinWidth=DEFAULT_BIN_WIDTH; + // m_histogramBinWidth=DEFAULT_BIN_WIDTH; } @@ -131,7 +131,7 @@ FlowMonitor::ReportFirstTx (Ptr probe, uint32_t flowId, uint32_t pack tracked.lastSeenTime = tracked.firstSeenTime; tracked.timesForwarded = 0; NS_LOG_DEBUG ("ReportFirstTx: adding tracked packet (flowId=" << flowId << ", packetId=" << packetId - << ")."); + << ")."); probe->AddPacketStats (flowId, packetSize, Seconds (0)); @@ -158,7 +158,7 @@ FlowMonitor::ReportForwarding (Ptr probe, uint32_t flowId, uint32_t p if (tracked == m_trackedPackets.end ()) { NS_LOG_WARN ("Received packet forward report (flowId=" << flowId << ", packetId=" << packetId - << ") but not known to be transmitted."); + << ") but not known to be transmitted."); return; } @@ -181,7 +181,7 @@ FlowMonitor::ReportLastRx (Ptr probe, uint32_t flowId, uint32_t packe if (tracked == m_trackedPackets.end ()) { NS_LOG_WARN ("Received packet last-tx report (flowId=" << flowId << ", packetId=" << packetId - << ") but not known to be transmitted."); + << ") but not known to be transmitted."); return; } @@ -196,18 +196,18 @@ FlowMonitor::ReportLastRx (Ptr probe, uint32_t flowId, uint32_t packe { Time jitter = stats.lastDelay - delay; if (jitter > Seconds (0)) - { - stats.jitterSum += jitter; - stats.jitterHistogram.AddValue (jitter.GetSeconds ()); - } + { + stats.jitterSum += jitter; + stats.jitterHistogram.AddValue (jitter.GetSeconds ()); + } else - { - stats.jitterSum -= jitter; - stats.jitterHistogram.AddValue (-jitter.GetSeconds()); - } + { + stats.jitterSum -= jitter; + stats.jitterHistogram.AddValue (-jitter.GetSeconds()); + } } stats.lastDelay = delay; - + stats.rxBytes += packetSize; stats.packetSizeHistogram.AddValue ((double) packetSize); stats.rxPackets++; @@ -277,7 +277,7 @@ void FlowMonitor::CheckForLostPackets (Time maxDelay) { Time now = Simulator::Now (); - + for (TrackedPacketMap::iterator iter = m_trackedPackets.begin (); iter != m_trackedPackets.end (); ) { @@ -285,7 +285,7 @@ FlowMonitor::CheckForLostPackets (Time maxDelay) { // packet is considered lost, add it to the loss statistics std::map::iterator - flow = m_flowStats.find (iter->first.first); + flow = m_flowStats.find (iter->first.first); NS_ASSERT (flow != m_flowStats.end ()); flow->second.lostPackets++; @@ -387,7 +387,7 @@ void FlowMonitor::SerializeToXmlStream (std::ostream &os, int indent, bool enableHistograms, bool enableProbes) { CheckForLostPackets (); - + INDENT(indent); os << "\n"; indent += 2; INDENT(indent); os << "\n"; @@ -395,24 +395,24 @@ FlowMonitor::SerializeToXmlStream (std::ostream &os, int indent, bool enableHist for (std::map::const_iterator flowI = m_flowStats.begin (); flowI != m_flowStats.end (); flowI++) { - + INDENT(indent); -#define ATTRIB(name) << " "#name"=\"" << flowI->second.name << "\"" +#define ATTRIB(name) << " " # name "=\"" << flowI->second.name << "\"" os << "first << "\"" - ATTRIB(timeFirstTxPacket) - ATTRIB(timeFirstRxPacket) - ATTRIB(timeLastTxPacket) - ATTRIB(timeLastRxPacket) - ATTRIB(delaySum) - ATTRIB(jitterSum) - ATTRIB(lastDelay) - ATTRIB(txBytes) - ATTRIB(rxBytes) - ATTRIB(txPackets) - ATTRIB(rxPackets) - ATTRIB(lostPackets) - ATTRIB(timesForwarded) - << ">\n"; + ATTRIB(timeFirstTxPacket) + ATTRIB(timeFirstRxPacket) + ATTRIB(timeLastTxPacket) + ATTRIB(timeLastRxPacket) + ATTRIB(delaySum) + ATTRIB(jitterSum) + ATTRIB(lastDelay) + ATTRIB(txBytes) + ATTRIB(rxBytes) + ATTRIB(txPackets) + ATTRIB(rxPackets) + ATTRIB(lostPackets) + ATTRIB(timesForwarded) + << ">\n"; #undef ATTRIB @@ -462,7 +462,7 @@ FlowMonitor::SerializeToXmlStream (std::ostream &os, int indent, bool enableHist indent -= 2; INDENT(indent); os << "\n"; } - + std::string FlowMonitor::SerializeToXmlString (int indent, bool enableHistograms, bool enableProbes) diff --git a/src/flow-monitor/model/flow-monitor.h b/src/flow-monitor/model/flow-monitor.h index f79559de0..64877ff79 100644 --- a/src/flow-monitor/model/flow-monitor.h +++ b/src/flow-monitor/model/flow-monitor.h @@ -54,7 +54,7 @@ public: /// was received by an end node, i.e. the time when the flow /// reception starts Time timeFirstRxPacket; - + /// Contains the absolute time when the last packet in the flow /// was transmitted, i.e. the time when the flow transmission /// ends @@ -133,7 +133,7 @@ public: /// Set the FlowClassifier to be used by the flow monitor. void SetFlowClassifier (Ptr classifier); - + /// Set the time, counting from the current time, from which to start monitoring flows void Start (const Time &time); /// Set the time, counting from the current time, from which to stop monitoring flows @@ -171,7 +171,7 @@ public: /// Check right now for packets that appear to be lost, considering /// packets as lost if not seen in the network for a time larger /// than maxDelay - void CheckForLostPackets (Time maxDelay); + void CheckForLostPackets (Time maxDelay); // --- methods to get the results --- /// Retrieve all collected the flow statistics. Note, if the diff --git a/src/flow-monitor/model/flow-probe.cc b/src/flow-monitor/model/flow-probe.cc index e58058942..d059aec14 100644 --- a/src/flow-monitor/model/flow-probe.cc +++ b/src/flow-monitor/model/flow-probe.cc @@ -28,7 +28,7 @@ FlowProbe::~FlowProbe () { } - + FlowProbe::FlowProbe (Ptr flowMonitor) : m_flowMonitor (flowMonitor) { @@ -72,7 +72,7 @@ FlowProbe::SerializeToXmlStream (std::ostream &os, int indent, uint32_t index) c INDENT(indent); os << "\n"; indent += 2; - + for (Stats::const_iterator iter = m_stats.begin (); iter != m_stats.end (); iter++) { INDENT(indent); diff --git a/src/flow-monitor/model/flow-probe.h b/src/flow-monitor/model/flow-probe.h index 87d8db4a2..f317da6a2 100644 --- a/src/flow-monitor/model/flow-probe.h +++ b/src/flow-monitor/model/flow-probe.h @@ -31,7 +31,7 @@ namespace ns3 { class FlowMonitor; - + /// The FlowProbe class is responsible for listening for packet events /// in a specific point of the simulated space, report those events to /// the global FlowMonitor, and collect its own flow statistics @@ -41,11 +41,11 @@ class FlowProbe : public SimpleRefCount private: FlowProbe (FlowProbe const &); FlowProbe& operator= (FlowProbe const &); - + protected: - + FlowProbe (Ptr flowMonitor); - + public: virtual ~FlowProbe (); @@ -65,9 +65,9 @@ public: /// Number of packets seen of this flow uint32_t packets; }; - + typedef std::map Stats; - + void AddPacketStats (FlowId flowId, uint32_t packetSize, Time delayFromFirstProbe); void AddPacketDropStats (FlowId flowId, uint32_t packetSize, uint32_t reasonCode); diff --git a/src/flow-monitor/model/histogram.cc b/src/flow-monitor/model/histogram.cc index 86e25d6c8..0927c1025 100644 --- a/src/flow-monitor/model/histogram.cc +++ b/src/flow-monitor/model/histogram.cc @@ -23,7 +23,7 @@ #include "ns3/simulator.h" #include "ns3/log.h" -#define DEFAULT_BIN_WIDTH 1 +#define DEFAULT_BIN_WIDTH 1 // #define RESERVED_BINS_INC 10 @@ -42,7 +42,7 @@ Histogram::GetNBins () const { return m_histogram.size (); } - + double Histogram::GetBinStart (uint32_t index) { @@ -74,22 +74,22 @@ Histogram::GetBinCount (uint32_t index) NS_ASSERT (index < m_histogram.size ()); return m_histogram[index]; } - + void Histogram::AddValue (double value) { uint32_t index = (uint32_t)floor (value/m_binWidth); - + //check if we need to resize the vector NS_LOG_DEBUG ("AddValue: index=" << index << ", m_histogram.size()=" << m_histogram.size ()); - + if (index >= m_histogram.size ()) { m_histogram.resize (index + 1, 0); } m_histogram[index]++; } - + Histogram::Histogram (double binWidth) { m_binWidth = binWidth; @@ -105,12 +105,12 @@ void Histogram::SerializeToXmlStream (std::ostream &os, int indent, std::string elementName) const { #define INDENT(level) for (int __xpto = 0; __xpto < level; __xpto++) os << ' '; - + INDENT(indent); os << "<" << elementName // << " binWidth=\"" << m_binWidth << "\"" << " nBins=\"" << m_histogram.size () << "\"" << " >\n"; indent += 2; - + #if 1 // two alternative forms of representing bin data, one more verbose than the other one for (uint32_t index = 0; index < m_histogram.size (); index++) { diff --git a/src/flow-monitor/model/histogram.h b/src/flow-monitor/model/histogram.h index 6772e1675..935376b7a 100644 --- a/src/flow-monitor/model/histogram.h +++ b/src/flow-monitor/model/histogram.h @@ -42,10 +42,10 @@ public: double GetBinWidth (uint32_t index) const; void SetDefaultBinWidth (double binWidth); uint32_t GetBinCount (uint32_t index); - + // Method for adding values void AddValue (double value); - + void SerializeToXmlStream (std::ostream &os, int indent, std::string elementName) const; diff --git a/src/flow-monitor/model/ipv4-flow-classifier.cc b/src/flow-monitor/model/ipv4-flow-classifier.cc index e0692bf21..7f40a862c 100644 --- a/src/flow-monitor/model/ipv4-flow-classifier.cc +++ b/src/flow-monitor/model/ipv4-flow-classifier.cc @@ -61,7 +61,7 @@ bool operator < (const Ipv4FlowClassifier::FiveTuple &t1, { return false; } - + if (t1.sourcePort < t2.sourcePort) { return true; @@ -137,11 +137,11 @@ Ipv4FlowClassifier::Classify (const Ipv4Header &ipHeader, Ptr ipPa default: return false; } - + // try to insert the tuple, but check if it already exists std::pair::iterator, bool> insert = m_flowMap.insert (std::pair (tuple, 0)); - + // if the insertion succeeded, we need to assign this tuple a new flow identifier if (insert.second) { @@ -159,7 +159,7 @@ Ipv4FlowClassifier::FiveTuple Ipv4FlowClassifier::FindFlow (FlowId flowId) const { for (std::map::const_iterator - iter = m_flowMap.begin (); iter != m_flowMap.end (); iter++) + iter = m_flowMap.begin (); iter != m_flowMap.end (); iter++) { if (iter->second == flowId) { @@ -168,7 +168,7 @@ Ipv4FlowClassifier::FindFlow (FlowId flowId) const } NS_FATAL_ERROR ("Could not find the flow with ID " << flowId); FiveTuple retval = { Ipv4Address::GetZero (), Ipv4Address::GetZero (), 0, 0, 0 }; - return retval; + return retval; } void @@ -180,7 +180,7 @@ Ipv4FlowClassifier::SerializeToXmlStream (std::ostream &os, int indent) const indent += 2; for (std::map::const_iterator - iter = m_flowMap.begin (); iter != m_flowMap.end (); iter++) + iter = m_flowMap.begin (); iter != m_flowMap.end (); iter++) { INDENT(indent); os << "second << "\"" @@ -194,7 +194,7 @@ Ipv4FlowClassifier::SerializeToXmlStream (std::ostream &os, int indent) const indent -= 2; INDENT(indent); os << "\n"; - + #undef INDENT } diff --git a/src/flow-monitor/model/ipv4-flow-classifier.h b/src/flow-monitor/model/ipv4-flow-classifier.h index 5dca4c59e..cea7f8343 100644 --- a/src/flow-monitor/model/ipv4-flow-classifier.h +++ b/src/flow-monitor/model/ipv4-flow-classifier.h @@ -64,13 +64,13 @@ public: private: std::map m_flowMap; - + }; bool operator < (const Ipv4FlowClassifier::FiveTuple &t1, const Ipv4FlowClassifier::FiveTuple &t2); bool operator == (const Ipv4FlowClassifier::FiveTuple &t1, const Ipv4FlowClassifier::FiveTuple &t2); - + } // namespace ns3 diff --git a/src/flow-monitor/model/ipv4-flow-probe.cc b/src/flow-monitor/model/ipv4-flow-probe.cc index 2e50a13d4..b9f4159ff 100644 --- a/src/flow-monitor/model/ipv4-flow-probe.cc +++ b/src/flow-monitor/model/ipv4-flow-probe.cc @@ -34,9 +34,9 @@ using namespace std; NS_LOG_COMPONENT_DEFINE ("Ipv4FlowProbe"); - ////////////////////////////////////// - // Ipv4FlowProbeTag class implementation // - ////////////////////////////////////// +////////////////////////////////////// +// Ipv4FlowProbeTag class implementation // +////////////////////////////////////// class Ipv4FlowProbeTag : public Tag { @@ -59,7 +59,7 @@ private: uint32_t m_flowId; uint32_t m_packetId; uint32_t m_packetSize; - + }; TypeId @@ -68,7 +68,7 @@ Ipv4FlowProbeTag::GetTypeId (void) static TypeId tid = TypeId ("ns3::Ipv4FlowProbeTag") .SetParent () .AddConstructor () - ; + ; return tid; } TypeId @@ -104,11 +104,13 @@ Ipv4FlowProbeTag::Print (std::ostream &os) const } Ipv4FlowProbeTag::Ipv4FlowProbeTag () : Tag () -{} +{ +} Ipv4FlowProbeTag::Ipv4FlowProbeTag (uint32_t flowId, uint32_t packetId, uint32_t packetSize) : Tag (), m_flowId (flowId), m_packetId (packetId), m_packetSize (packetSize) -{} +{ +} void Ipv4FlowProbeTag::SetFlowId (uint32_t id) @@ -129,7 +131,7 @@ uint32_t Ipv4FlowProbeTag::GetFlowId (void) const { return m_flowId; -} +} uint32_t Ipv4FlowProbeTag::GetPacketId (void) const { @@ -141,9 +143,9 @@ Ipv4FlowProbeTag::GetPacketSize (void) const return m_packetSize; } - //////////////////////////////////////// - // Ipv4FlowProbe class implementation // - //////////////////////////////////////// +//////////////////////////////////////// +// Ipv4FlowProbe class implementation // +//////////////////////////////////////// Ipv4FlowProbe::Ipv4FlowProbe (Ptr monitor, Ptr classifier, @@ -192,12 +194,12 @@ Ipv4FlowProbe::SendOutgoingLogger (const Ipv4Header &ipHeader, Ptr { FlowId flowId; FlowPacketId packetId; - + if (m_classifier->Classify (ipHeader, ipPayload, &flowId, &packetId)) { uint32_t size = (ipPayload->GetSize () + ipHeader.GetSerializedSize ()); NS_LOG_DEBUG ("ReportFirstTx ("<ReportFirstTx (this, flowId, packetId, size); // tag the packet with the flow id and packet id, so that the packet can be identified even @@ -212,7 +214,7 @@ Ipv4FlowProbe::ForwardLogger (const Ipv4Header &ipHeader, Ptr ipPa { FlowId flowId; FlowPacketId packetId; - + if (m_classifier->Classify (ipHeader, ipPayload, &flowId, &packetId)) { uint32_t size = (ipPayload->GetSize () + ipHeader.GetSerializedSize ()); @@ -224,10 +226,10 @@ Ipv4FlowProbe::ForwardLogger (const Ipv4Header &ipHeader, Ptr ipPa void Ipv4FlowProbe::ForwardUpLogger (const Ipv4Header &ipHeader, Ptr ipPayload, uint32_t interface) -{ +{ FlowId flowId; FlowPacketId packetId; - + if (m_classifier->Classify (ipHeader, ipPayload, &flowId, &packetId)) { // remove the tags that are added by Ipv4FlowProbe::SendOutgoingLogger () @@ -251,7 +253,7 @@ Ipv4FlowProbe::DropLogger (const Ipv4Header &ipHeader, Ptr ipPaylo { case Ipv4L3Protocol::DROP_NO_ROUTE: break; - + case Ipv4L3Protocol::DROP_TTL_EXPIRED: case Ipv4L3Protocol::DROP_BAD_CHECKSUM: Ipv4Address addri = m_ipv4->GetAddress (ifIndex); @@ -277,8 +279,8 @@ Ipv4FlowProbe::DropLogger (const Ipv4Header &ipHeader, Ptr ipPaylo uint32_t size = (ipPayload->GetSize () + ipHeader.GetSerializedSize ()); NS_LOG_DEBUG ("Drop ("< ipPayload) bool tagFound; tagFound = ConstCast (ipPayload)->RemovePacketTag (fTag); NS_ASSERT_MSG (tagFound, "FlowProbeTag is missing"); - + FlowId flowId = fTag.GetFlowId (); FlowPacketId packetId = fTag.GetPacketId (); uint32_t size = fTag.GetPacketSize (); NS_LOG_DEBUG ("Drop ("<ReportDrop (this, flowId, packetId, size, DROP_QUEUE); } diff --git a/src/flow-monitor/model/ipv4-flow-probe.h b/src/flow-monitor/model/ipv4-flow-probe.h index fd8ceffe0..e48d9ca87 100644 --- a/src/flow-monitor/model/ipv4-flow-probe.h +++ b/src/flow-monitor/model/ipv4-flow-probe.h @@ -38,34 +38,34 @@ class Node; /// Ipv4L3Protocol interface of the node. class Ipv4FlowProbe : public FlowProbe { - + public: Ipv4FlowProbe (Ptr monitor, Ptr classifier, Ptr node); virtual ~Ipv4FlowProbe (); /// \brief enumeration of possible reasons why a packet may be dropped enum DropReason - { - /// Packet dropped due to missing route to the destination - DROP_NO_ROUTE = 0, + { + /// Packet dropped due to missing route to the destination + DROP_NO_ROUTE = 0, - /// Packet dropped due to TTL decremented to zero during IPv4 forwarding - DROP_TTL_EXPIRE, + /// Packet dropped due to TTL decremented to zero during IPv4 forwarding + DROP_TTL_EXPIRE, - /// Packet dropped due to invalid checksum in the IPv4 header - DROP_BAD_CHECKSUM, + /// Packet dropped due to invalid checksum in the IPv4 header + DROP_BAD_CHECKSUM, - /// Packet dropped due to queue overflow. Note: only works for - /// NetDevices that provide a TxQueue attribute of type Queue - /// with a Drop trace source. It currently works with Csma and - /// PointToPoint devices, but not with WiFi or WiMax. - DROP_QUEUE, + /// Packet dropped due to queue overflow. Note: only works for + /// NetDevices that provide a TxQueue attribute of type Queue + /// with a Drop trace source. It currently works with Csma and + /// PointToPoint devices, but not with WiFi or WiMax. + DROP_QUEUE, - DROP_INTERFACE_DOWN, /**< Interface is down so can not send packet */ - DROP_ROUTE_ERROR, /**< Route error */ - - DROP_INVALID_REASON, - }; + DROP_INTERFACE_DOWN, /**< Interface is down so can not send packet */ + DROP_ROUTE_ERROR, /**< Route error */ + + DROP_INVALID_REASON, + }; private: diff --git a/src/flow-monitor/test/histogram-test-suite.cc b/src/flow-monitor/test/histogram-test-suite.cc index f6e9cf1c1..eedfeb4e7 100644 --- a/src/flow-monitor/test/histogram-test-suite.cc +++ b/src/flow-monitor/test/histogram-test-suite.cc @@ -34,7 +34,8 @@ public: HistogramTestCase::HistogramTestCase () : ns3::TestCase ("Histogram") -{} +{ +} void @@ -47,19 +48,19 @@ HistogramTestCase::DoRun (void) { h0.AddValue (3.4); } - + for (int i=1; i <= 5; i++) - { + { h0.AddValue (3.6); } - + NS_TEST_EXPECT_MSG_EQ_TOL (h0.GetBinWidth (0), 3.5, 1e-6, ""); NS_TEST_EXPECT_MSG_EQ (h0.GetNBins (), 2, ""); NS_TEST_EXPECT_MSG_EQ_TOL (h0.GetBinStart (1), 3.5, 1e-6, ""); NS_TEST_EXPECT_MSG_EQ (h0.GetBinCount (0), 10, ""); NS_TEST_EXPECT_MSG_EQ (h0.GetBinCount (1), 5, ""); } - + { // Testing bin expansion h0.AddValue (74.3);