Skip to content

Commit

Permalink
traffic-control: Change return type of RedQueueDisc::DropEarly() from…
Browse files Browse the repository at this point in the history
… uint32_t to bool
  • Loading branch information
edalm committed Oct 12, 2023
1 parent edf72af commit 8497002
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/traffic-control/model/red-queue-disc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
}
}
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/traffic-control/model/red-queue-disc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 8497002

Please sign in to comment.