|
|
| 190 |
double GetDroppedPacketsPerSecondVariance (void); |
190 |
double GetDroppedPacketsPerSecondVariance (void); |
| 191 |
#endif |
191 |
#endif |
| 192 |
|
192 |
|
|
|
193 |
/// Callback set by the object (e.g., a queue disc) that wants to be notified of a packet drop |
| 194 |
typedef Callback<void, Ptr<QueueItem> > DropCallback; |
| 195 |
|
| 196 |
/** |
| 197 |
* \brief Set the drop callback |
| 198 |
* \param cb the callback to set |
| 199 |
* |
| 200 |
* Called when a queue is added to a queue disc in order to set a |
| 201 |
* callback to the Drop method of the queue disc. |
| 202 |
*/ |
| 203 |
virtual void SetDropCallback (DropCallback cb); |
| 204 |
|
| 193 |
protected: |
205 |
protected: |
| 194 |
/** |
206 |
/** |
| 195 |
* \brief Drop a packet |
207 |
* \brief Drop a packet |
| 196 |
* \param p packet that was dropped |
208 |
* \param item item that was dropped |
| 197 |
* |
209 |
* |
| 198 |
* This method is called by the base class when a packet is dropped because |
210 |
* This method is called by the base class when a packet is dropped because |
| 199 |
* the queue is full and by the subclasses to notify parent (this class) that |
211 |
* the queue is full and by the subclasses to notify parent (this class) that |
| 200 |
* a packet has been dropped for other reasons. |
212 |
* a packet has been dropped for other reasons. |
| 201 |
*/ |
213 |
*/ |
| 202 |
void Drop (Ptr<Packet> p); |
214 |
void Drop (Ptr<QueueItem> item); |
| 203 |
|
215 |
|
| 204 |
private: |
216 |
private: |
| 205 |
/** |
217 |
/** |
|
|
| 219 |
*/ |
231 |
*/ |
| 220 |
virtual Ptr<const QueueItem> DoPeek (void) const = 0; |
232 |
virtual Ptr<const QueueItem> DoPeek (void) const = 0; |
| 221 |
|
233 |
|
|
|
234 |
/** |
| 235 |
* \brief Notification of a packet drop |
| 236 |
* \param item item that was dropped |
| 237 |
*/ |
| 238 |
void NotifyDrop (Ptr<QueueItem> item); |
| 239 |
|
| 222 |
/// Traced callback: fired when a packet is enqueued |
240 |
/// Traced callback: fired when a packet is enqueued |
| 223 |
TracedCallback<Ptr<const Packet> > m_traceEnqueue; |
241 |
TracedCallback<Ptr<const Packet> > m_traceEnqueue; |
| 224 |
/// Traced callback: fired when a packet is dequeued |
242 |
/// Traced callback: fired when a packet is dequeued |
|
|
| 236 |
uint32_t m_maxPackets; //!< max packets in the queue |
254 |
uint32_t m_maxPackets; //!< max packets in the queue |
| 237 |
uint32_t m_maxBytes; //!< max bytes in the queue |
255 |
uint32_t m_maxBytes; //!< max bytes in the queue |
| 238 |
QueueMode m_mode; //!< queue mode (packets or bytes limited) |
256 |
QueueMode m_mode; //!< queue mode (packets or bytes limited) |
|
|
257 |
DropCallback m_dropCallback; //!< drop callback |
| 239 |
}; |
258 |
}; |
| 240 |
|
259 |
|
| 241 |
} // namespace ns3 |
260 |
} // namespace ns3 |