46template<
typename PacketTypePtr>
57 : queue_type_(queue_type) {}
112 std::ostringstream os;
119 return (queue_type_);
124 std::string queue_type_;
read_packet FORK if not parent: break YIELD answer=DNSLookup(packet, this) response=DNSAnswer(answer) YIELD send(response) At each "YIELD" point, the coroutine initiates an asynchronous operation, then pauses and turns over control to some other task on the ASIO service queue. When the operation completes, the coroutine resumes. The DNSLookup and DNSAnswer define callback methods used by a DNS Server to communicate with the module that called it. They are abstract-only classes whose concrete implementations are supplied by the calling module. The DNSLookup callback always runs asynchronously. Concrete implementations must be sure to call the server 's "resume" method when it is finished. In an authoritative server, the DNSLookup implementation would examine the query, look up the answer, then call "resume"(See the diagram in doc/auth_process.jpg). In a recursive server, the DNSLookup implementation would initiate a DNSQuery, which in turn would be responsible for calling the server 's "resume" method(See the diagram in doc/recursive_process.jpg). A DNSQuery object is intended to handle resolution of a query over the network when the local authoritative data sources or cache are not sufficient. The plan is that it will make use of subsidiary DNSFetch calls to get data from particular authoritative servers, and when it has gotten a complete answer, it calls "resume". In current form, however, DNSQuery is much simpler packet
Exception(const char *file, size_t line, const char *what)
Constructor for a given type for exceptions with file name and file line number.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
static ElementPtr create(const Position &pos=ZERO_POSITION())
static ElementPtr createMap(const Position &pos=ZERO_POSITION())
Creates an empty MapElement type ElementPtr.
InvalidQueueParameter(const char *file, size_t line, const char *what)
virtual data::ElementPtr getInfo() const
Fetches operational information about the current state of the queue.
std::string getQueueType()
virtual size_t getSize() const =0
Returns the current number of packets in the buffer.
virtual PacketTypePtr dequeuePacket()=0
Dequeues the next packet from the queue.
virtual bool empty() const =0
return True if the queue is empty.
virtual void clear()=0
Discards all packets currently in the buffer.
virtual void enqueuePacket(PacketTypePtr packet, const SocketInfo &source)=0
Adds a packet to the queue.
PacketQueue(const std::string &queue_type)
Constructor.
virtual ~PacketQueue()
Virtual destructor.
std::string getInfoStr() const
Fetches a JSON string representation of queue operational info.
boost::shared_ptr< Element > ElementPtr
boost::shared_ptr< PacketQueue< Pkt4Ptr > > PacketQueue4Ptr
Defines pointer to the DHCPv4 queue interface used at the application level.
boost::shared_ptr< PacketQueue< Pkt6Ptr > > PacketQueue6Ptr
Defines pointer to the DHCPv6 queue interface used at the application level.
QueueEnd
Enumerates choices between the two ends of the queue.
Defines the logger used by the top-level component of kea-lfc.
Holds information about socket.