22const size_t DEFAULT_BUFFER_SIZE = 128;
78 const uint16_t ns_port,
80 const unsigned int wait,
87 void incrStats(
const std::string& stat,
bool update_key =
true);
94 response_(response_placeholder), callback_(callback), proto_(proto) {
106 <<
" Transport protocol for DNS Updates; please use UDP");
122 <<
proto_ <<
"' specified for DNS Updates");
168 (*callback_)(status);
193 const uint16_t ns_port,
195 const unsigned int wait,
203 <<
". Provided timeout value is '" << wait <<
"'");
240 in_buf_,
this,
static_cast<int>(wait));
244 io_service.
post(io_fetch);
258 mgr.
addValue(stat,
static_cast<int64_t
>(1));
261 static_cast<int64_t
>(1));
267 : impl_(new
DNSClientImpl(response_placeholder, callback, proto)) {
276 static const unsigned int max_timeout = std::numeric_limits<int>::max();
277 return (max_timeout);
283 const uint16_t ns_port,
285 const unsigned int wait,
287 impl_->
doUpdate(io_service, ns_addr, ns_port, update, wait, tsig_key);
A generic exception that is thrown if a parameter given to a method is considered invalid in that con...
This is a base class for exceptions thrown from the DNS library module.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
A generic exception that is thrown when a function is not implemented.
Upstream Fetch Processing.
Result
Result of Upstream Fetch.
@ STOPPED
Control code, fetch has been stopped.
@ TIME_OUT
Failure, fetch timed out.
@ SUCCESS
Success, fetch completed.
The IOAddress class represents an IP addresses (version agnostic)
The IOService class is a wrapper for the ASIO io_service class.
void post(const std::function< void()> &callback)
Post a callback to the end of the queue.
The D2UpdateMessage encapsulates a DNS Update message.
void toWire(dns::AbstractMessageRenderer &renderer, dns::TSIGContext *const tsig_ctx=NULL)
Encode outgoing message into wire format.
DNSClient::Status getStatus(const asiodns::IOFetch::Result)
void incrStats(const std::string &stat, bool update_key=true)
virtual void operator()(asiodns::IOFetch::Result result)
Callback method.
std::string tsig_key_name_
DNSClient::Callback * callback_
dns::TSIGContextPtr tsig_context_
D2UpdateMessagePtr & response_
DNSClientImpl(D2UpdateMessagePtr &response_placeholder, DNSClient::Callback *callback, const DNSClient::Protocol proto)
void doUpdate(asiolink::IOService &io_service, const asiolink::IOAddress &ns_addr, const uint16_t ns_port, D2UpdateMessage &update, const unsigned int wait, const D2TsigKeyPtr &tsig_key)
DNSClient::Protocol proto_
util::OutputBufferPtr in_buf_
Callback for the DNSClient class.
~DNSClient()
Virtual destructor, does nothing.
DNSClient(D2UpdateMessagePtr &response_placeholder, Callback *callback, const Protocol proto=UDP)
Constructor.
void doUpdate(asiolink::IOService &io_service, const asiolink::IOAddress &ns_addr, const uint16_t ns_port, D2UpdateMessage &update, const unsigned int wait, const D2TsigKeyPtr &tsig_key=D2TsigKeyPtr())
Start asynchronous DNS Update with TSIG.
static unsigned int getMaxTimeout()
Returns maximal allowed timeout value accepted by DNSClient::doUpdate.
Status
A status code of the DNSClient.
@ IO_STOPPED
IO was stopped.
@ TIMEOUT
No response, timeout.
@ OTHER
Other, unclassified error.
@ INVALID_RESPONSE
Response received but invalid.
@ SUCCESS
Response received and is ok.
Protocol
Transport layer protocol used by a DNS Client to communicate with a server.
void setBuffer(isc::util::OutputBuffer *buffer)
Set or reset a temporary output buffer.
The MessageRenderer is a concrete derived class of AbstractMessageRenderer as a general purpose imple...
Statistics Manager class.
static StatsMgr & instance()
Statistics Manager accessor method.
static std::string generateName(const std::string &context, Type index, const std::string &stat_name)
Generates statistic name in a given context.
The OutputBuffer class is a buffer abstraction for manipulating mutable data.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
void addValue(const std::string &name, const int64_t value)
Records incremental integer observation.
#define LOG_DEBUG(LOGGER, LEVEL, MESSAGE)
Macro to conveniently test debug output and log it.
boost::shared_ptr< D2UpdateMessage > D2UpdateMessagePtr
Pointer to the DNS Update Message.
isc::log::Logger d2_to_dns_logger("d2-to-dns")
const isc::log::MessageID DHCP_DDNS_INVALID_RESPONSE
boost::shared_ptr< D2TsigKey > D2TsigKeyPtr
Type of pointer to a D2 TSIG key.
boost::shared_ptr< TSIGContext > TSIGContextPtr
const int DBGLVL_TRACE_DETAIL
Trace detailed operations.
boost::shared_ptr< OutputBuffer > OutputBufferPtr
Defines the logger used by the top-level component of kea-lfc.