traffic-control: Change return type of RedQueueDisc::DropEarly() from uint32_t to bool
This commit is contained in:
@@ -651,7 +651,7 @@ RedQueueDisc::Estimator(uint32_t nQueued, uint32_t m, double qAvg, double qW)
|
||||
}
|
||||
|
||||
// Check if packet p needs to be dropped due to probability mark
|
||||
uint32_t
|
||||
bool
|
||||
RedQueueDisc::DropEarly(Ptr<QueueDiscItem> item, uint32_t qSize)
|
||||
{
|
||||
NS_LOG_FUNCTION(this << item << qSize);
|
||||
@@ -673,7 +673,7 @@ RedQueueDisc::DropEarly(Ptr<QueueDiscItem> item, uint32_t qSize)
|
||||
if ((double)qSize < fraction * m_qAvg)
|
||||
{
|
||||
// Queue could have been empty for 0.05 seconds
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -706,10 +706,10 @@ RedQueueDisc::DropEarly(Ptr<QueueDiscItem> item, uint32_t qSize)
|
||||
m_countBytes = 0;
|
||||
/// \todo Implement set bit to mark
|
||||
|
||||
return 1; // drop
|
||||
return true; // drop
|
||||
}
|
||||
|
||||
return 0; // no drop/mark
|
||||
return false; // no drop/mark
|
||||
}
|
||||
|
||||
// Returns a probability using these function parameters for the DropEarly function
|
||||
|
||||
@@ -244,9 +244,9 @@ class RedQueueDisc : public QueueDisc
|
||||
* \brief Check if a packet needs to be dropped due to probability mark
|
||||
* \param item queue item
|
||||
* \param qSize queue size
|
||||
* \returns 0 for no drop/mark, 1 for drop
|
||||
* \returns false for no drop/mark, true for drop
|
||||
*/
|
||||
uint32_t DropEarly(Ptr<QueueDiscItem> item, uint32_t qSize);
|
||||
bool DropEarly(Ptr<QueueDiscItem> item, uint32_t qSize);
|
||||
/**
|
||||
* \brief Returns a probability using these function parameters for the DropEarly function
|
||||
* \returns Prob. of packet drop before "count"
|
||||
|
||||
Reference in New Issue
Block a user