|
|
| 373 |
/** |
373 |
/** |
| 374 |
* Request the queue discipline to extract a packet. This function only updates |
374 |
* Request the queue discipline to extract a packet. This function only updates |
| 375 |
* the statistics and calls the (private) DoDequeue function, which must be |
375 |
* the statistics and calls the (private) DoDequeue function, which must be |
| 376 |
* implemented by derived classes. |
376 |
* implemented by derived classes. Use DequeuePeeked instead of this method if |
|
|
377 |
* the queue disc has been previously queried with Peek. |
| 377 |
* \return 0 if the operation was not successful; the item otherwise. |
378 |
* \return 0 if the operation was not successful; the item otherwise. |
| 378 |
*/ |
379 |
*/ |
| 379 |
Ptr<QueueDiscItem> Dequeue (void); |
380 |
Ptr<QueueDiscItem> Dequeue (void); |
|
|
| 381 |
/** |
382 |
/** |
| 382 |
* Get a copy of the next packet the queue discipline will extract, without |
383 |
* Get a copy of the next packet the queue discipline will extract, without |
| 383 |
* actually extracting the packet. This function only calls the (private) |
384 |
* actually extracting the packet. This function only calls the (private) |
| 384 |
* DoPeek function, which must be implemented by derived classes. |
385 |
* DoPeek function. |
| 385 |
* \return 0 if the operation was not successful; the item otherwise. |
386 |
* \return 0 if the operation was not successful; the item otherwise. |
| 386 |
*/ |
387 |
*/ |
| 387 |
Ptr<const QueueDiscItem> Peek (void); |
388 |
Ptr<const QueueDiscItem> Peek (void); |
| 388 |
|
389 |
|
| 389 |
/** |
390 |
/** |
| 390 |
* Extract from the queue disc the packet that has been dequeued by calling |
391 |
* Extract from the queue disc the packet that has been dequeued by calling |
| 391 |
* PeekDequeued. |
392 |
* Peek, if any, or dequeue a packet, otherwise. Use this method instead of |
|
|
393 |
* Dequeue if the queue disc has been previously queried with Peek. |
| 392 |
* |
394 |
* |
| 393 |
* \return 0 if the operation was not successful; the item otherwise. |
395 |
* \return 0 if the operation was not successful; the item otherwise. |
| 394 |
*/ |
396 |
*/ |
|
|
| 543 |
*/ |
545 |
*/ |
| 544 |
bool Mark (Ptr<QueueDiscItem> item, const char* reason); |
546 |
bool Mark (Ptr<QueueDiscItem> item, const char* reason); |
| 545 |
|
547 |
|
| 546 |
/** |
|
|
| 547 |
* Dequeue a packet and retain it in the queue disc as a requeued packet. |
| 548 |
* The packet is not traced as requeued, nor is the total count of requeued |
| 549 |
* packets increased. The dequeued packet is not counted in the backlog of |
| 550 |
* the queue disc and is actually extracted from the queue disc by calling |
| 551 |
* DequeuePeeked. Queue discs can point their DoPeek method to this one. This |
| 552 |
* is recommended especially for queue discs for which it is not obvious what |
| 553 |
* is the next packet that will be dequeued (e.g., queue discs having multiple |
| 554 |
* internal queues or child queue discs or queue discs that drop packets |
| 555 |
* after dequeue). |
| 556 |
* |
| 557 |
* \return 0 if the operation was not successful; the item otherwise. |
| 558 |
*/ |
| 559 |
Ptr<const QueueDiscItem> PeekDequeued (void); |
| 560 |
|
| 561 |
private: |
548 |
private: |
| 562 |
/** |
549 |
/** |
| 563 |
* \brief Copy constructor |
550 |
* \brief Copy constructor |
|
|
| 590 |
virtual Ptr<QueueDiscItem> DoDequeue (void) = 0; |
577 |
virtual Ptr<QueueDiscItem> DoDequeue (void) = 0; |
| 591 |
|
578 |
|
| 592 |
/** |
579 |
/** |
| 593 |
* This function returns a copy of the next packet the queue disc will extract. |
580 |
* \brief Return a copy of the next packet the queue disc will extract. |
|
|
581 |
* |
| 582 |
* The implementation of this method is based on the qdisc_peek_dequeued |
| 583 |
* function of the Linux kernel, which dequeues a packet and retains it in the |
| 584 |
* queue disc as a requeued packet. The packet is not traced as requeued, nor |
| 585 |
* is the total count of requeued packets increased. The dequeued packet is |
| 586 |
* not counted in the backlog of the queue disc and is actually extracted from |
| 587 |
* the queue disc by calling DequeuePeeked. This approach is recommended |
| 588 |
* especially for queue discs for which it is not obvious what is the next |
| 589 |
* packet that will be dequeued (e.g., queue discs having multiple internal |
| 590 |
* queues or child queue discs or queue discs that drop packets after dequeue). |
| 591 |
* Subclasses can however provide their own implementation of this method that |
| 592 |
* overrides the default one. |
| 593 |
* |
| 594 |
* \return 0 if the operation was not successful; the packet otherwise. |
594 |
* \return 0 if the operation was not successful; the packet otherwise. |
| 595 |
*/ |
595 |
*/ |
| 596 |
virtual Ptr<const QueueDiscItem> DoPeek (void) = 0; |
596 |
virtual Ptr<const QueueDiscItem> DoPeek (void); |
| 597 |
|
597 |
|
| 598 |
/** |
598 |
/** |
| 599 |
* Check whether the current configuration is correct. Default objects (such |
599 |
* Check whether the current configuration is correct. Default objects (such |