|
xorp
|
Outbound packet queue. More...
#include <packet_queue.hh>
Public Types | |
|
typedef list< const RipPacket < A > * > | QueueRep |
Public Member Functions | |
| void | enqueue_packet (const RipPacket< A > *pkt) |
| Place packet in ready to sent queue. | |
| bool | empty () const |
| const RipPacket< A > * | head () const |
| Peek at head packet if it exists. | |
| void | pop_head () |
| Remove head packet. | |
| bool | drop_old () |
| Discard packet behind head packet to make space for new packets. | |
| void | flush_packets () |
| Flush queued packets. | |
| void | set_max_buffered_bytes (uint32_t mb) |
| Set the maximum amount of data to buffer. | |
| uint32_t | max_buffered_bytes () const |
| Get the maximum amount of buffered data. | |
| uint32_t | buffered_bytes () const |
| Get the current amount of buffered data. | |
| uint32_t | drop_count () const |
| Get the number of packets dropped from queue. | |
| void | reset_drop_count () |
| Reset packet drop counter. | |
Protected Attributes | |
| QueueRep | _ready_packets |
| uint32_t | _buffered_bytes |
| uint32_t | _max_buffered_bytes |
| uint32_t | _drops |
Outbound packet queue.
The queue is of fixed size and does FIFO. When the queue becomes full the eldest packet behind the head is dropped, ie since the head may be in transit.
| bool PacketQueue< A >::drop_old | ( | ) |
Discard packet behind head packet to make space for new packets.
| bool PacketQueue< A >::empty | ( | ) | const |
| void PacketQueue< A >::enqueue_packet | ( | const RipPacket< A > * | pkt | ) |
Place packet in ready to sent queue.
The supplied packet is expected to have been allocated with the standard new operator and will be destructed by the packet queue when it is dropped or popped from the queue.
This may cause older packets in the queue to be dropped to make sufficient space for new packet.
| const RipPacket< A > * PacketQueue< A >::head | ( | ) | const |
Peek at head packet if it exists.