From 24f016c79c8f94d26636d16f8cb2920e629fd58d Mon Sep 17 00:00:00 2001 From: Kirill Andreev Date: Mon, 1 Jun 2009 14:06:11 +0400 Subject: [PATCH] Added dropped TTL field to stats --- src/devices/mesh/dot11s/hwmp-protocol.cc | 4 ++++ src/devices/mesh/dot11s/hwmp-protocol.h | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/devices/mesh/dot11s/hwmp-protocol.cc b/src/devices/mesh/dot11s/hwmp-protocol.cc index a231e2f03..e6b0a6f64 100644 --- a/src/devices/mesh/dot11s/hwmp-protocol.cc +++ b/src/devices/mesh/dot11s/hwmp-protocol.cc @@ -220,7 +220,10 @@ HwmpProtocol::RequestRoute ( return false; } if (tag.GetTtl () == 0) + { + m_stats.droppedTtl ++; return false; + } tag.DecrementTtl (); } if (destination == Mac48Address::GetBroadcast ()) @@ -945,6 +948,7 @@ void HwmpProtocol::Statistics::Print (std::ostream & os) const "txUnicast=\"" << txUnicast << "\" " "txBroadcast=\"" << txBroadcast << "\" " "txBytes=\"" << txBytes / 1024 << "K\" " + "droppedTtl=\"" << droppedTtl << "\" " "totalQueued=\"" << totalQueued << "\" " "totalDropped=\"" << totalDropped << "\"/>\n"; } diff --git a/src/devices/mesh/dot11s/hwmp-protocol.h b/src/devices/mesh/dot11s/hwmp-protocol.h index 5b7de27db..662900382 100644 --- a/src/devices/mesh/dot11s/hwmp-protocol.h +++ b/src/devices/mesh/dot11s/hwmp-protocol.h @@ -145,11 +145,12 @@ private: uint16_t txUnicast; uint16_t txBroadcast; uint32_t txBytes; + uint16_t droppedTtl; uint16_t totalQueued; uint16_t totalDropped; void Print (std::ostream & os) const; - Statistics () : txUnicast (0), txBroadcast (0), txBytes (0), totalQueued (0), totalDropped (0) {} + Statistics () : txUnicast (0), txBroadcast (0), txBytes (0), droppedTtl (0), totalQueued (0), totalDropped (0) {} }; Statistics m_stats; ///\}