Kea
1.9.9-git
|
Interface for managing a queue of inbound DHCP packets. More...
#include <packet_queue.h>
Public Member Functions | |
PacketQueue (const std::string &queue_type) | |
Constructor. More... | |
virtual | ~PacketQueue () |
Virtual destructor. More... | |
virtual void | clear ()=0 |
Discards all packets currently in the buffer. More... | |
virtual PacketTypePtr | dequeuePacket ()=0 |
Dequeues the next packet from the queue. More... | |
virtual bool | empty () const =0 |
return True if the queue is empty. More... | |
virtual void | enqueuePacket (PacketTypePtr packet, const SocketInfo &source)=0 |
Adds a packet to the queue. More... | |
virtual data::ElementPtr | getInfo () const |
Fetches operational information about the current state of the queue. More... | |
std::string | getInfoStr () const |
Fetches a JSON string representation of queue operational info. More... | |
std::string | getQueueType () |
virtual size_t | getSize () const =0 |
Returns the current number of packets in the buffer. More... | |
Interface for managing a queue of inbound DHCP packets.
This class serves as the abstract interface for packet queue implementations which may be used by IfaceMgr
to store inbound packets until they are a dequeued for processing.
PacketTypePtr | Type of packet the queue contains. This expected to be either isc::dhcp::Pkt4Ptr or isc::dhcp::Pkt6Ptr |
Definition at line 48 of file packet_queue.h.
|
inlineexplicit |
Constructor.
queue_type | logical name of the queue implementation Typically this is assigned by the factory that creates the queue. It is the logical name used to register queue implementations. |
Definition at line 57 of file packet_queue.h.
|
inlinevirtual |
Virtual destructor.
Definition at line 61 of file packet_queue.h.
|
pure virtual |
Discards all packets currently in the buffer.
Implemented in isc::dhcp::PacketQueueRing< PacketTypePtr >, isc::dhcp::PacketQueueRing< Pkt4Ptr >, and isc::dhcp::PacketQueueRing< Pkt6Ptr >.
|
pure virtual |
Dequeues the next packet from the queue.
Dequeues the next packet (if any) and returns it. Derivations determine how packets are dequeued.
Implemented in isc::dhcp::PacketQueueRing< PacketTypePtr >, isc::dhcp::PacketQueueRing< Pkt4Ptr >, and isc::dhcp::PacketQueueRing< Pkt6Ptr >.
|
pure virtual |
return True if the queue is empty.
Implemented in isc::dhcp::PacketQueueRing< PacketTypePtr >, isc::dhcp::PacketQueueRing< Pkt4Ptr >, and isc::dhcp::PacketQueueRing< Pkt6Ptr >.
|
pure virtual |
Adds a packet to the queue.
Adds the packet to the queue. Derivations determine which packets to queue and how to queue them.
packet | packet to enqueue |
source | socket the packet came from |
Implemented in isc::dhcp::PacketQueueRing< PacketTypePtr >, isc::dhcp::PacketQueueRing< Pkt4Ptr >, and isc::dhcp::PacketQueueRing< Pkt6Ptr >.
|
inlinevirtual |
Fetches operational information about the current state of the queue.
Creates and returns an ElementPtr containing a single entry, "queue-type". Derivations are expected to call this method first and then add their own values. Since implementations may vary widely on data of interest, this is structured as an ElementPtr for broad latitude.
Reimplemented in isc::dhcp::PacketQueueRing< PacketTypePtr >, isc::dhcp::PacketQueueRing< Pkt4Ptr >, and isc::dhcp::PacketQueueRing< Pkt6Ptr >.
Definition at line 100 of file packet_queue.h.
Referenced by isc::dhcp::PacketQueueRing< Pkt6Ptr >::getInfo(), and isc::dhcp::PacketQueue< Pkt6Ptr >::getInfoStr().
|
inline |
Fetches a JSON string representation of queue operational info.
This method calls getInfo()
and then converts that into JSON text.
Definition at line 111 of file packet_queue.h.
|
inline |
Definition at line 119 of file packet_queue.h.
|
pure virtual |
Returns the current number of packets in the buffer.
Implemented in isc::dhcp::PacketQueueRing< PacketTypePtr >, isc::dhcp::PacketQueueRing< Pkt4Ptr >, and isc::dhcp::PacketQueueRing< Pkt6Ptr >.