18#include <boost/asio/coroutine.hpp>
19#include <boost/asio/deadline_timer.hpp>
20#include <boost/date_time/posix_time/posix_time_types.hpp>
21#include <boost/shared_array.hpp>
22#include <boost/shared_ptr.hpp>
23#include <boost/system/error_code.hpp>
34class IOFetch :
public boost::asio::coroutine {
72 static std::vector<std::string>
const text_vector {
78 static std::string
const unknown(
"UNKNOWN");
79 return (result < text_vector.size() ? text_vector[result] : unknown);
216 void operator()(boost::system::error_code ec = boost::system::error_code(),
255 void logIOFailure(boost::system::error_code ec);
260 boost::shared_ptr<IOFetchData> data_;
virtual void operator()(Result result)=0
Callback method.
virtual ~Callback()=default
Destructor.
Callback()=default
Constructor.
static std::string const & resultToText(Result const &result)
Convert enum to string.
Result
Result of Upstream Fetch.
IOFetch(Protocol protocol, const isc::asiolink::IOServicePtr &service, const isc::dns::Question &question, const isc::asiolink::IOAddress &address, uint16_t port, isc::util::OutputBufferPtr &buff, Callback *cb, int wait=-1, bool edns=true)
Constructor.
void operator()(boost::system::error_code ec=boost::system::error_code(), size_t length=0)
Coroutine entry point.
Origin
Origin of Asynchronous I/O Call.
Protocol
Protocol to use on the fetch.
void stop(Result reason=STOPPED)
Terminate query.
Protocol getProtocol() const
Return Current Protocol.
The IOAddress class represents an IP addresses (version agnostic)
The Question class encapsulates the common search key of DNS lookup, consisting of owner name,...
boost::shared_ptr< IOFetch > IOFetchPtr
Defines a pointer to an IOFetch.
boost::shared_ptr< IOService > IOServicePtr
Defines a smart pointer to an IOService instance.
boost::shared_ptr< const Message > ConstMessagePtr
boost::shared_ptr< Message > MessagePtr
Pointer-like type pointing to a Message.
boost::shared_ptr< OutputBuffer > OutputBufferPtr
Type of pointers to output buffers.
Defines the logger used by the top-level component of kea-lfc.