RoutingProtocol::Drop added

This commit is contained in:
Borovkova Elena
2009-08-14 13:47:49 +04:00
parent b25206c736
commit efd9cbeda4
4 changed files with 11 additions and 13 deletions

View File

@@ -1311,6 +1311,12 @@ RoutingProtocol::FindSocketWithInterfaceAddress (Ipv4InterfaceAddress addr ) con
return socket;
}
void
RoutingProtocol::Drop(Ptr<const Packet> packet, const Ipv4Header & header, Socket::SocketErrno err)
{
NS_LOG_LOGIC (this <<" drop own packet " << packet->GetUid() << " to " << header.GetDestination () << " from queue. Error " << err);
}
void
RoutingProtocol::LocalRouteRepair (Ipv4Address dst, Ipv4Address origin )

View File

@@ -238,7 +238,7 @@ private:
//\}
/// Notify that packet is dropped for some reason
void Drop(Ptr<const Packet>, const Ipv4Header &, Socket::SocketErrno) {}
void Drop(Ptr<const Packet>, const Ipv4Header &, Socket::SocketErrno);
///\name Timers. TODO comment each one
//\{

View File

@@ -105,7 +105,10 @@ RequestQueue::Enqueue (QueueEntry & entry )
entry.SetExpireTime (m_queueTimeout);
if (m_queue.size () == m_maxLen)
Drop (Pop (), "Drop the most aged packet"); // Drop the most aged packet
{
Drop (m_queue.front (), "Drop the most aged packet"); // Drop the most aged packet
m_queue.erase (m_queue.begin ());
}
m_queue.push_back (entry);
}
@@ -146,15 +149,6 @@ RequestQueue::Find (Ipv4Address dst )
return false;
}
QueueEntry
RequestQueue::Pop ()
{
NS_LOG_FUNCTION (this);
QueueEntry entry = m_queue.front ();
m_queue.erase (m_queue.begin ());
return entry;
}
struct IsExpired
{
bool

View File

@@ -114,8 +114,6 @@ public:
private:
std::vector<QueueEntry> m_queue;
/// Remove and return first entry from queue
QueueEntry Pop();
/// Remove all expired entries
void Purge();
/// Notify that packet is dropped from queue by timeout