RoutingProtocol::Drop added
This commit is contained in:
@@ -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 )
|
||||
|
||||
@@ -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
|
||||
//\{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user