Index: src/dsr/model/dsr-rsendbuff.cc |
=================================================================== |
--- a/src/dsr/model/dsr-rsendbuff.cc |
+++ b/src/dsr/model/dsr-rsendbuff.cc |
@@ -40,6 +40,7 @@ |
namespace ns3 { |
namespace dsr { |
+ |
uint32_t |
SendBuffer::GetSize () |
{ |
@@ -54,9 +55,11 @@ |
for (std::vector<SendBuffEntry>::const_iterator i = m_sendBuffer.begin (); i |
!= m_sendBuffer.end (); ++i) |
{ |
+ NS_LOG_INFO ("packet id " << i->GetPacket ()->GetUid () << " " << entry.GetPacket ()->GetUid () |
+ << " dst " << i->GetDestination () << " " << entry.GetDestination ()); |
+ |
if ((i->GetPacket ()->GetUid () == entry.GetPacket ()->GetUid ()) |
- && (i->GetDestination () |
- == entry.GetDestination ())) |
+ && (i->GetDestination () == entry.GetDestination ())) |
{ |
return false; |
} |
@@ -122,7 +125,6 @@ |
{ |
/* |
* Make sure if the send buffer contains entry with certain dst |
- * Used for test case |
*/ |
for (std::vector<SendBuffEntry>::const_iterator i = m_sendBuffer.begin (); i |
!= m_sendBuffer.end (); ++i) |
@@ -136,22 +138,6 @@ |
return false; |
} |
-uint32_t |
-SendBuffer::FindPacketsWithDst (Ipv4Address dst) |
-{ |
- uint32_t count = 0; |
- for (std::vector<SendBuffEntry>::const_iterator i = m_sendBuffer.begin (); i |
- != m_sendBuffer.end (); ++i) |
- { |
- if (i->GetDestination () == dst) |
- { |
- NS_LOG_DEBUG ("Found the packet"); |
- count++; |
- } |
- } |
- return count; |
-} |
- |
struct IsExpired |
{ |
bool |
@@ -168,6 +154,7 @@ |
/* |
* Purge the buffer to eliminate expired entries |
*/ |
+ NS_LOG_DEBUG ("The send buffer size " << m_sendBuffer.size ()); |
IsExpired pred; |
for (std::vector<SendBuffEntry>::iterator i = m_sendBuffer.begin (); i |
!= m_sendBuffer.end (); ++i) |