From 12c37af78f65301858be28679695a9e818270947 Mon Sep 17 00:00:00 2001 From: Stephen Morris Date: Fri, 24 Jun 2011 11:29:53 +0100 Subject: [PATCH 1/5] [trac1039] Renamed message file to resolver_messages.mes --- src/bin/resolver/Makefile.am | 12 ++++++------ src/bin/resolver/resolver_log.h | 2 +- .../{resolverdef.mes => resolver_messages.mes} | 0 src/bin/resolver/tests/Makefile.am | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) rename src/bin/resolver/{resolverdef.mes => resolver_messages.mes} (100%) diff --git a/src/bin/resolver/Makefile.am b/src/bin/resolver/Makefile.am index e82608115d..bce8307515 100644 --- a/src/bin/resolver/Makefile.am +++ b/src/bin/resolver/Makefile.am @@ -20,10 +20,10 @@ pkglibexecdir = $(libexecdir)/@PACKAGE@ CLEANFILES = *.gcno *.gcda CLEANFILES += resolver.spec spec_config.h -CLEANFILES += resolverdef.cc resolverdef.h +CLEANFILES += resolver_messages.cc resolver_messages.h man_MANS = b10-resolver.8 -EXTRA_DIST = $(man_MANS) b10-resolver.xml resolverdef.mes +EXTRA_DIST = $(man_MANS) b10-resolver.xml resolver_messages.mes if ENABLE_MAN @@ -39,11 +39,11 @@ spec_config.h: spec_config.h.pre $(SED) -e "s|@@LOCALSTATEDIR@@|$(localstatedir)|" spec_config.h.pre >$@ # Define rule to build logging source files from message file -resolverdef.h resolverdef.cc: resolverdef.mes - $(top_builddir)/src/lib/log/compiler/message $(top_srcdir)/src/bin/resolver/resolverdef.mes +resolver_messages.h resolver_messages.cc: resolver_messages.mes + $(top_builddir)/src/lib/log/compiler/message $(top_srcdir)/src/bin/resolver/resolver_messages.mes -BUILT_SOURCES = spec_config.h resolverdef.cc resolverdef.h +BUILT_SOURCES = spec_config.h resolver_messages.cc resolver_messages.h pkglibexec_PROGRAMS = b10-resolver b10_resolver_SOURCES = resolver.cc resolver.h @@ -53,7 +53,7 @@ b10_resolver_SOURCES += $(top_builddir)/src/bin/auth/change_user.h b10_resolver_SOURCES += $(top_builddir)/src/bin/auth/common.h b10_resolver_SOURCES += main.cc -nodist_b10_resolver_SOURCES = resolverdef.cc resolverdef.h +nodist_b10_resolver_SOURCES = resolver_messages.cc resolver_messages.h b10_resolver_LDADD = $(top_builddir)/src/lib/dns/libdns++.la diff --git a/src/bin/resolver/resolver_log.h b/src/bin/resolver/resolver_log.h index 63f6abb0a4..8378b98d2c 100644 --- a/src/bin/resolver/resolver_log.h +++ b/src/bin/resolver/resolver_log.h @@ -16,7 +16,7 @@ #define __RESOLVER_LOG__H #include -#include "resolverdef.h" +#include "resolver_messages.h" /// \brief Resolver Logging /// diff --git a/src/bin/resolver/resolverdef.mes b/src/bin/resolver/resolver_messages.mes similarity index 100% rename from src/bin/resolver/resolverdef.mes rename to src/bin/resolver/resolver_messages.mes diff --git a/src/bin/resolver/tests/Makefile.am b/src/bin/resolver/tests/Makefile.am index 35b5398b99..e0d9fd4613 100644 --- a/src/bin/resolver/tests/Makefile.am +++ b/src/bin/resolver/tests/Makefile.am @@ -28,7 +28,7 @@ run_unittests_SOURCES += resolver_config_unittest.cc run_unittests_SOURCES += response_scrubber_unittest.cc run_unittests_SOURCES += run_unittests.cc -nodist_run_unittests_SOURCES = ../resolverdef.h ../resolverdef.cc +nodist_run_unittests_SOURCES = ../resolver_messages.h ../resolver_messages.cc run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES) run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS) From a16c7925f9a00f44680e2ca984def99d6bb3cecf Mon Sep 17 00:00:00 2001 From: Stephen Morris Date: Fri, 24 Jun 2011 11:31:40 +0100 Subject: [PATCH 2/5] [trac1039] Remove $PREFIX --- src/bin/resolver/resolver_messages.mes | 77 +++++++++++++------------- 1 file changed, 38 insertions(+), 39 deletions(-) diff --git a/src/bin/resolver/resolver_messages.mes b/src/bin/resolver/resolver_messages.mes index 47433a4259..7d2ffb5eb5 100644 --- a/src/bin/resolver/resolver_messages.mes +++ b/src/bin/resolver/resolver_messages.mes @@ -12,154 +12,153 @@ # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. -$PREFIX RESOLVER_ # No namespace declaration - these constants go in the global namespace # along with the resolver methods. -% AXFRTCP AXFR request received over TCP +% RESOLVER_AXFRTCP AXFR request received over TCP A debug message, the resolver received a NOTIFY message over TCP. The server cannot process it and will return an error message to the sender with the RCODE set to NOTIMP. -% AXFRUDP AXFR request received over UDP +% RESOLVER_AXFRUDP AXFR request received over UDP A debug message, the resolver received a NOTIFY message over UDP. The server cannot process it (and in any case, an AXFR request should be sent over TCP) and will return an error message to the sender with the RCODE set to FORMERR. -% CONFIGCHAN configuration channel created +% RESOLVER_CONFIGCHAN configuration channel created A debug message, output when the resolver has successfully established a connection to the configuration channel. -% CONFIGERR error in configuration: %1 +% RESOLVER_CONFIGERR error in configuration: %1 An error was detected in a configuration update received by the resolver. This may be in the format of the configuration message (in which case this is a programming error) or it may be in the data supplied (in which case it is a user error). The reason for the error, given as a parameter in the message, will give more details. -% CONFIGLOAD configuration loaded +% RESOLVER_CONFIGLOAD configuration loaded A debug message, output when the resolver configuration has been successfully loaded. -% CONFIGUPD configuration updated: %1 +% RESOLVER_CONFIGUPD configuration updated: %1 A debug message, the configuration has been updated with the specified information. -% DNSMSGRCVD DNS message received: %1 +% RESOLVER_DNSMSGRCVD DNS message received: %1 A debug message, this always precedes some other logging message and is the formatted contents of the DNS packet that the other message refers to. -% DNSMSGSENT DNS message of %1 bytes sent: %2 +% RESOLVER_DNSMSGSENT DNS message of %1 bytes sent: %2 A debug message, this contains details of the response sent back to the querying system. -% CLTMOSMALL client timeout of %1 is too small +% RESOLVER_CLTMOSMALL client timeout of %1 is too small An error indicating that the configuration value specified for the query timeout is too small. -% CREATED main resolver object created +% RESOLVER_CREATED main resolver object created A debug message, output when the Resolver() object has been created. -% FAILED resolver failed, reason: %1 +% RESOLVER_FAILED resolver failed, reason: %1 This is an error message output when an unhandled exception is caught by the resolver. All it can do is to shut down. -% FWDADDR setting forward address %1(%2) +% RESOLVER_FWDADDR setting forward address %1(%2) This message may appear multiple times during startup, and it lists the forward addresses used by the resolver when running in forwarding mode. -% FWDQUERY processing forward query +% RESOLVER_FWDQUERY processing forward query The received query has passed all checks and is being forwarded to upstream servers. -% HDRERR message received, exception when processing header: %1 +% RESOLVER_HDRERR message received, exception when processing header: %1 A debug message noting that an exception occurred during the processing of a received packet. The packet has been dropped. -% IXFR IXFR request received +% RESOLVER_IXFR IXFR request received The resolver received a NOTIFY message over TCP. The server cannot process it and will return an error message to the sender with the RCODE set to NOTIMP. -% LKTMOSMALL lookup timeout of %1 is too small +% RESOLVER_LKTMOSMALL lookup timeout of %1 is too small An error indicating that the configuration value specified for the lookup timeout is too small. -% NFYNOTAUTH NOTIFY arrived but server is not authoritative +% RESOLVER_NFYNOTAUTH NOTIFY arrived but server is not authoritative The resolver received a NOTIFY message. As the server is not authoritative it cannot process it, so it returns an error message to the sender with the RCODE set to NOTAUTH. -% NORMQUERY processing normal query +% RESOLVER_NORMQUERY processing normal query The received query has passed all checks and is being processed by the resolver. -% NOTIN non-IN class request received, returning REFUSED message +% RESOLVER_NOTIN non-IN class request received, returning REFUSED message A debug message, the resolver has received a DNS packet that was not IN class. The resolver cannot handle such packets, so is returning a REFUSED response to the sender. -% NOROOTADDR no root addresses available +% RESOLVER_NOROOTADDR no root addresses available A warning message during startup, indicates that no root addresses have been set. This may be because the resolver will get them from a priming query. -% NOTONEQUES query contained %1 questions, exactly one question was expected +% RESOLVER_NOTONEQUES query contained %1 questions, exactly one question was expected A debug message, the resolver received a query that contained the number of entires in the question section detailed in the message. This is a malformed message, as a DNS query must contain only one question. The resolver will return a message to the sender with the RCODE set to FORMERR. -% OPCODEUNS opcode %1 not supported by the resolver +% RESOLVER_OPCODEUNS opcode %1 not supported by the resolver A debug message, the resolver received a message with an unsupported opcode (it can only process QUERY opcodes). It will return a message to the sender with the RCODE set to NOTIMP. -% PARSEERR error parsing received message: %1 - returning %2 +% RESOLVER_PARSEERR error parsing received message: %1 - returning %2 A debug message noting that the resolver received a message and the parsing of the body of the message failed due to some non-protocol related reason (although the parsing of the header succeeded). The message parameters give a textual description of the problem and the RCODE returned. -% PRINTMSG print message command, arguments are: %1 +% RESOLVER_PRINTMSG print message command, arguments are: %1 This message is logged when a "print_message" command is received over the command channel. -% PROTERR protocol error parsing received message: %1 - returning %2 +% RESOLVER_PROTERR protocol error parsing received message: %1 - returning %2 A debug message noting that the resolver received a message and the parsing of the body of the message failed due to some protocol error (although the parsing of the header succeeded). The message parameters give a textual description of the problem and the RCODE returned. -% QUSETUP query setup +% RESOLVER_QUSETUP query setup A debug message noting that the resolver is creating a RecursiveQuery object. -% QUSHUT query shutdown +% RESOLVER_QUSHUT query shutdown A debug message noting that the resolver is destroying a RecursiveQuery object. -% QUTMOSMALL query timeout of %1 is too small +% RESOLVER_QUTMOSMALL query timeout of %1 is too small An error indicating that the configuration value specified for the query timeout is too small. -% RECURSIVE running in recursive mode +% RESOLVER_RECURSIVE running in recursive mode This is an informational message that appears at startup noting that the resolver is running in recursive mode. -% RECVMSG resolver has received a DNS message +% RESOLVER_RECVMSG resolver has received a DNS message A debug message indicating that the resolver has received a message. Depending on the debug settings, subsequent log output will indicate the nature of the message. -% RETRYNEG negative number of retries (%1) specified in the configuration +% RESOLVER_RETRYNEG negative number of retries (%1) specified in the configuration An error message indicating that the resolver configuration has specified a negative retry count. Only zero or positive values are valid. -% ROOTADDR setting root address %1(%2) +% RESOLVER_ROOTADDR setting root address %1(%2) This message may appear multiple times during startup; it lists the root addresses used by the resolver. -% SERVICE service object created +% RESOLVER_SERVICE service object created A debug message, output when the main service object (which handles the received queries) is created. -% SETPARAM query timeout: %1, client timeout: %2, lookup timeout: %3, retry count: %4 +% RESOLVER_SETPARAM query timeout: %1, client timeout: %2, lookup timeout: %3, retry count: %4 A debug message, lists the parameters associated with the message. These are: query timeout: the timeout (in ms) used for queries originated by the resolver to upstream servers. Client timeout: the interval to resolver a query by @@ -178,16 +177,16 @@ there comes a time - the lookup timeout - when even the resolve gives up. At this point it will wait for pending upstream queries to complete or timeout and drop the query. -% SHUTDOWN resolver shutdown complete +% RESOLVER_SHUTDOWN resolver shutdown complete This information message is output when the resolver has shut down. -% STARTED resolver started +% RESOLVER_STARTED resolver started This informational message is output by the resolver when all initialization has been completed and it is entering its main loop. -% STARTING starting resolver with command line '%1' +% RESOLVER_STARTING starting resolver with command line '%1' An informational message, this is output when the resolver starts up. -% UNEXRESP received unexpected response, ignoring +% RESOLVER_UNEXRESP received unexpected response, ignoring A debug message noting that the server has received a response instead of a query and is ignoring it. From 6f8383136ae83eb439c71a70c4bde83524b72c5e Mon Sep 17 00:00:00 2001 From: Stephen Morris Date: Fri, 24 Jun 2011 11:49:42 +0100 Subject: [PATCH 3/5] [trac1039] Rename some message IDs --- src/bin/resolver/main.cc | 8 ++-- src/bin/resolver/resolver.cc | 52 ++++++++++----------- src/bin/resolver/resolver_messages.mes | 62 +++++++++++++------------- 3 files changed, 61 insertions(+), 61 deletions(-) diff --git a/src/bin/resolver/main.cc b/src/bin/resolver/main.cc index 530f6899f6..e7cc4cf323 100644 --- a/src/bin/resolver/main.cc +++ b/src/bin/resolver/main.cc @@ -80,7 +80,7 @@ my_command_handler(const string& command, ConstElementPtr args) { ConstElementPtr answer = createAnswer(); if (command == "print_message") { - LOG_INFO(resolver_logger, RESOLVER_PRINTMSG).arg(args); + LOG_INFO(resolver_logger, RESOLVER_PRINT_COMMAND).arg(args); /* let's add that message to our answer as well */ answer = createAnswer(0, args); } else if (command == "shutdown") { @@ -203,14 +203,14 @@ main(int argc, char* argv[]) { DNSService dns_service(io_service, checkin, lookup, answer); resolver->setDNSService(dns_service); - LOG_DEBUG(resolver_logger, RESOLVER_DBG_INIT, RESOLVER_SERVICE); + LOG_DEBUG(resolver_logger, RESOLVER_DBG_INIT, RESOLVER_SERVICE_CREATED); cc_session = new Session(io_service.get_io_service()); config_session = new ModuleCCSession(specfile, *cc_session, my_config_handler, my_command_handler, true, true); - LOG_DEBUG(resolver_logger, RESOLVER_DBG_INIT, RESOLVER_CONFIGCHAN); + LOG_DEBUG(resolver_logger, RESOLVER_DBG_INIT, RESOLVER_CONFIG_CHANNEL); // FIXME: This does not belong here, but inside Boss if (uid != NULL) { @@ -218,7 +218,7 @@ main(int argc, char* argv[]) { } resolver->setConfigSession(config_session); - LOG_DEBUG(resolver_logger, RESOLVER_DBG_INIT, RESOLVER_CONFIGLOAD); + LOG_DEBUG(resolver_logger, RESOLVER_DBG_INIT, RESOLVER_CONFIG_LOADED); LOG_INFO(resolver_logger, RESOLVER_STARTED); io_service.run(); diff --git a/src/bin/resolver/resolver.cc b/src/bin/resolver/resolver.cc index 934fbdf387..1b8f1d90fc 100644 --- a/src/bin/resolver/resolver.cc +++ b/src/bin/resolver/resolver.cc @@ -83,7 +83,7 @@ public: isc::cache::ResolverCache& cache) { assert(!rec_query_); // queryShutdown must be called first - LOG_DEBUG(resolver_logger, RESOLVER_DBG_INIT, RESOLVER_QUSETUP); + LOG_DEBUG(resolver_logger, RESOLVER_DBG_INIT, RESOLVER_RECQ_SETUP); rec_query_ = new RecursiveQuery(dnss, nsas, cache, upstream_, @@ -99,7 +99,7 @@ public: // (this is not a safety check, just to prevent logging of // actions that are not performed if (rec_query_) { - LOG_DEBUG(resolver_logger, RESOLVER_DBG_INIT, RESOLVER_QUSHUT); + LOG_DEBUG(resolver_logger, RESOLVER_DBG_INIT, RESOLVER_RECQ_SHUTDOWN); delete rec_query_; rec_query_ = NULL; } @@ -112,7 +112,7 @@ public: if (dnss) { if (!upstream_.empty()) { BOOST_FOREACH(const AddressPair& address, upstream) { - LOG_INFO(resolver_logger, RESOLVER_FWDADDR) + LOG_INFO(resolver_logger, RESOLVER_FWD_ADDRESS) .arg(address.first).arg(address.second); } } else { @@ -128,11 +128,11 @@ public: if (dnss) { if (!upstream_root_.empty()) { BOOST_FOREACH(const AddressPair& address, upstream_root) { - LOG_INFO(resolver_logger, RESOLVER_ROOTADDR) + LOG_INFO(resolver_logger, RESOLVER_SET_ROOT_ADDRESS) .arg(address.first).arg(address.second); } } else { - LOG_WARN(resolver_logger, RESOLVER_NOROOTADDR); + LOG_WARN(resolver_logger, RESOLVER_NO_ROOT_ADDRESS); } } } @@ -302,7 +302,7 @@ public: answer_message->toWire(renderer); - LOG_DEBUG(resolver_logger, RESOLVER_DBG_DETAIL, RESOLVER_DNSMSGSENT) + LOG_DEBUG(resolver_logger, RESOLVER_DBG_DETAIL, RESOLVER_DNS_MSG_SENT) .arg(renderer.getLength()).arg(*answer_message); } }; @@ -395,13 +395,13 @@ Resolver::processMessage(const IOMessage& io_message, // Ignore all responses. if (query_message->getHeaderFlag(Message::HEADERFLAG_QR)) { - LOG_DEBUG(resolver_logger, RESOLVER_DBG_IO, RESOLVER_UNEXRESP); + LOG_DEBUG(resolver_logger, RESOLVER_DBG_IO, RESOLVER_UNEXPECTED_RESPONSE); server->resume(false); return; } } catch (const Exception& ex) { - LOG_DEBUG(resolver_logger, RESOLVER_DBG_IO, RESOLVER_HDRERR) + LOG_DEBUG(resolver_logger, RESOLVER_DBG_IO, RESOLVER_HEADER_ERROR) .arg(ex.what()); server->resume(false); return; @@ -411,14 +411,14 @@ Resolver::processMessage(const IOMessage& io_message, try { query_message->fromWire(request_buffer); } catch (const DNSProtocolError& error) { - LOG_DEBUG(resolver_logger, RESOLVER_DBG_IO, RESOLVER_PROTERR) + LOG_DEBUG(resolver_logger, RESOLVER_DBG_IO, RESOLVER_PROTOCOL_ERROR) .arg(error.what()).arg(error.getRcode()); makeErrorMessage(query_message, answer_message, buffer, error.getRcode()); server->resume(true); return; } catch (const Exception& ex) { - LOG_DEBUG(resolver_logger, RESOLVER_DBG_IO, RESOLVER_PROTERR) + LOG_DEBUG(resolver_logger, RESOLVER_DBG_IO, RESOLVER_PROTOCOL_ERROR) .arg(ex.what()).arg(Rcode::SERVFAIL()); makeErrorMessage(query_message, answer_message, buffer, Rcode::SERVFAIL()); @@ -429,7 +429,7 @@ Resolver::processMessage(const IOMessage& io_message, // Note: there appears to be no LOG_DEBUG for a successfully-received // message. This is not an oversight - it is handled below. In the // meantime, output the full message for debug purposes (if requested). - LOG_DEBUG(resolver_logger, RESOLVER_DBG_DETAIL, RESOLVER_DNSMSGRCVD) + LOG_DEBUG(resolver_logger, RESOLVER_DBG_DETAIL, RESOLVER_DNS_MSG_RECVD) .arg(*query_message); // Perform further protocol-level validation. @@ -439,12 +439,12 @@ Resolver::processMessage(const IOMessage& io_message, makeErrorMessage(query_message, answer_message, buffer, Rcode::NOTAUTH()); // Notify arrived, but we are not authoritative. - LOG_DEBUG(resolver_logger, RESOLVER_DBG_PROCESS, RESOLVER_NFYNOTAUTH); + LOG_DEBUG(resolver_logger, RESOLVER_DBG_PROCESS, RESOLVER_NOTIFY_RECVD); } else if (query_message->getOpcode() != Opcode::QUERY()) { // Unsupported opcode. - LOG_DEBUG(resolver_logger, RESOLVER_DBG_PROCESS, RESOLVER_OPCODEUNS) + LOG_DEBUG(resolver_logger, RESOLVER_DBG_PROCESS, RESOLVER_UNSUPPORTED_OPCODE) .arg(query_message->getOpcode()); makeErrorMessage(query_message, answer_message, buffer, Rcode::NOTIMP()); @@ -452,7 +452,7 @@ Resolver::processMessage(const IOMessage& io_message, } else if (query_message->getRRCount(Message::SECTION_QUESTION) != 1) { // Not one question - LOG_DEBUG(resolver_logger, RESOLVER_DBG_PROCESS, RESOLVER_NOTONEQUES) + LOG_DEBUG(resolver_logger, RESOLVER_DBG_PROCESS, RESOLVER_NOT_ONE_QUEST) .arg(query_message->getRRCount(Message::SECTION_QUESTION)); makeErrorMessage(query_message, answer_message, buffer, Rcode::FORMERR()); @@ -464,14 +464,14 @@ Resolver::processMessage(const IOMessage& io_message, // Can't process AXFR request receoved over UDP LOG_DEBUG(resolver_logger, RESOLVER_DBG_PROCESS, - RESOLVER_AXFRUDP); + RESOLVER_AXFR_UDP); makeErrorMessage(query_message, answer_message, buffer, Rcode::FORMERR()); } else { // ... or over TCP for that matter LOG_DEBUG(resolver_logger, RESOLVER_DBG_PROCESS, - RESOLVER_AXFRTCP); + RESOLVER_AXFR_TCP); makeErrorMessage(query_message, answer_message, buffer, Rcode::NOTIMP()); } @@ -485,7 +485,7 @@ Resolver::processMessage(const IOMessage& io_message, } else if (question->getClass() != RRClass::IN()) { // Non-IN message received, refuse it. - LOG_DEBUG(resolver_logger, RESOLVER_DBG_PROCESS, RESOLVER_NOTIN) + LOG_DEBUG(resolver_logger, RESOLVER_DBG_PROCESS, RESOLVER_NON_IN_PACKET) .arg(question->getClass()); makeErrorMessage(query_message, answer_message, buffer, Rcode::REFUSED()); @@ -518,21 +518,21 @@ ResolverImpl::processNormalQuery(ConstMessagePtr query_message, { if (upstream_.empty()) { // Processing normal query - LOG_DEBUG(resolver_logger, RESOLVER_DBG_IO, RESOLVER_NORMQUERY); + LOG_DEBUG(resolver_logger, RESOLVER_DBG_IO, RESOLVER_NORMAL_QUERY); ConstQuestionPtr question = *query_message->beginQuestion(); rec_query_->resolve(*question, answer_message, buffer, server); } else { // Processing forward query - LOG_DEBUG(resolver_logger, RESOLVER_DBG_IO, RESOLVER_FWDQUERY); + LOG_DEBUG(resolver_logger, RESOLVER_DBG_IO, RESOLVER_FWD_QUERY); rec_query_->forward(query_message, answer_message, buffer, server); } } ConstElementPtr Resolver::updateConfig(ConstElementPtr config) { - LOG_DEBUG(resolver_logger, RESOLVER_DBG_CONFIG, RESOLVER_CONFIGUPD) + LOG_DEBUG(resolver_logger, RESOLVER_DBG_CONFIG, RESOLVER_CONFIG_UPDATED) .arg(*config); try { @@ -560,7 +560,7 @@ Resolver::updateConfig(ConstElementPtr config) { // check for us qtimeout = qtimeoutE->intValue(); if (qtimeout < -1) { - LOG_ERROR(resolver_logger, RESOLVER_QUTMOSMALL).arg(qtimeout); + LOG_ERROR(resolver_logger, RESOLVER_QUERY_TMO_SMALL).arg(qtimeout); isc_throw(BadValue, "Query timeout too small"); } set_timeouts = true; @@ -568,7 +568,7 @@ Resolver::updateConfig(ConstElementPtr config) { if (ctimeoutE) { ctimeout = ctimeoutE->intValue(); if (ctimeout < -1) { - LOG_ERROR(resolver_logger, RESOLVER_CLTMOSMALL).arg(ctimeout); + LOG_ERROR(resolver_logger, RESOLVER_CLI_TMO_SMALL).arg(ctimeout); isc_throw(BadValue, "Client timeout too small"); } set_timeouts = true; @@ -576,7 +576,7 @@ Resolver::updateConfig(ConstElementPtr config) { if (ltimeoutE) { ltimeout = ltimeoutE->intValue(); if (ltimeout < -1) { - LOG_ERROR(resolver_logger, RESOLVER_LKTMOSMALL).arg(ltimeout); + LOG_ERROR(resolver_logger, RESOLVER_LKUP_TMO_SMALL).arg(ltimeout); isc_throw(BadValue, "Lookup timeout too small"); } set_timeouts = true; @@ -586,7 +586,7 @@ Resolver::updateConfig(ConstElementPtr config) { // _after_ the comparison (as opposed to before it for the timeouts) // because "retries" is unsigned. if (retriesE->intValue() < 0) { - LOG_ERROR(resolver_logger, RESOLVER_RETRYNEG) + LOG_ERROR(resolver_logger, RESOLVER_NEG_RETRIES) .arg(retriesE->intValue()); isc_throw(BadValue, "Negative number of retries"); } @@ -633,7 +633,7 @@ Resolver::updateConfig(ConstElementPtr config) { } catch (const isc::Exception& error) { // Configuration error - LOG_ERROR(resolver_logger, RESOLVER_CONFIGERR).arg(error.what()); + LOG_ERROR(resolver_logger, RESOLVER_CONFIG_ERROR).arg(error.what()); return (isc::config::createAnswer(1, error.what())); } } @@ -673,7 +673,7 @@ Resolver::setListenAddresses(const AddressList& addresses) { void Resolver::setTimeouts(int query_timeout, int client_timeout, int lookup_timeout, unsigned retries) { - LOG_DEBUG(resolver_logger, RESOLVER_DBG_CONFIG, RESOLVER_SETPARAM) + LOG_DEBUG(resolver_logger, RESOLVER_DBG_CONFIG, RESOLVER_SET_PARAMS) .arg(query_timeout).arg(client_timeout).arg(lookup_timeout) .arg(retries); diff --git a/src/bin/resolver/resolver_messages.mes b/src/bin/resolver/resolver_messages.mes index 7d2ffb5eb5..23ab02f3c8 100644 --- a/src/bin/resolver/resolver_messages.mes +++ b/src/bin/resolver/resolver_messages.mes @@ -15,44 +15,44 @@ # No namespace declaration - these constants go in the global namespace # along with the resolver methods. -% RESOLVER_AXFRTCP AXFR request received over TCP +% RESOLVER_AXFR_TCP AXFR request received over TCP A debug message, the resolver received a NOTIFY message over TCP. The server cannot process it and will return an error message to the sender with the RCODE set to NOTIMP. -% RESOLVER_AXFRUDP AXFR request received over UDP +% RESOLVER_AXFR_UDP AXFR request received over UDP A debug message, the resolver received a NOTIFY message over UDP. The server cannot process it (and in any case, an AXFR request should be sent over TCP) and will return an error message to the sender with the RCODE set to FORMERR. -% RESOLVER_CONFIGCHAN configuration channel created +% RESOLVER_CONFIG_CHANNEL configuration channel created A debug message, output when the resolver has successfully established a connection to the configuration channel. -% RESOLVER_CONFIGERR error in configuration: %1 +% RESOLVER_CONFIG_ERROR error in configuration: %1 An error was detected in a configuration update received by the resolver. This may be in the format of the configuration message (in which case this is a programming error) or it may be in the data supplied (in which case it is a user error). The reason for the error, given as a parameter in the message, will give more details. -% RESOLVER_CONFIGLOAD configuration loaded +% RESOLVER_CONFIG_LOADED configuration loaded A debug message, output when the resolver configuration has been successfully loaded. -% RESOLVER_CONFIGUPD configuration updated: %1 +% RESOLVER_CONFIG_UPDATED configuration updated: %1 A debug message, the configuration has been updated with the specified information. -% RESOLVER_DNSMSGRCVD DNS message received: %1 +% RESOLVER_DNS_MSG_RECVD DNS message received: %1 A debug message, this always precedes some other logging message and is the formatted contents of the DNS packet that the other message refers to. -% RESOLVER_DNSMSGSENT DNS message of %1 bytes sent: %2 +% RESOLVER_DNS_MSG_SENT DNS message of %1 bytes sent: %2 A debug message, this contains details of the response sent back to the querying system. -% RESOLVER_CLTMOSMALL client timeout of %1 is too small +% RESOLVER_CLI_TMO_SMALL client timeout of %1 is too small An error indicating that the configuration value specified for the query timeout is too small. @@ -63,15 +63,15 @@ A debug message, output when the Resolver() object has been created. This is an error message output when an unhandled exception is caught by the resolver. All it can do is to shut down. -% RESOLVER_FWDADDR setting forward address %1(%2) +% RESOLVER_FWD_ADDRESS setting forward address %1(%2) This message may appear multiple times during startup, and it lists the forward addresses used by the resolver when running in forwarding mode. -% RESOLVER_FWDQUERY processing forward query +% RESOLVER_FWD_QUERY processing forward query The received query has passed all checks and is being forwarded to upstream servers. -% RESOLVER_HDRERR message received, exception when processing header: %1 +% RESOLVER_HEADER_ERROR message received, exception when processing header: %1 A debug message noting that an exception occurred during the processing of a received packet. The packet has been dropped. @@ -79,61 +79,61 @@ a received packet. The packet has been dropped. The resolver received a NOTIFY message over TCP. The server cannot process it and will return an error message to the sender with the RCODE set to NOTIMP. -% RESOLVER_LKTMOSMALL lookup timeout of %1 is too small +% RESOLVER_LKUP_TMO_SMALL lookup timeout of %1 is too small An error indicating that the configuration value specified for the lookup timeout is too small. -% RESOLVER_NFYNOTAUTH NOTIFY arrived but server is not authoritative +% RESOLVER_NOTIFY_RECVD NOTIFY arrived but server is not authoritative The resolver received a NOTIFY message. As the server is not authoritative it cannot process it, so it returns an error message to the sender with the RCODE set to NOTAUTH. -% RESOLVER_NORMQUERY processing normal query +% RESOLVER_NORMAL_QUERY processing normal query The received query has passed all checks and is being processed by the resolver. -% RESOLVER_NOTIN non-IN class request received, returning REFUSED message +% RESOLVER_NON_IN_PACKET non-IN class request received, returning REFUSED message A debug message, the resolver has received a DNS packet that was not IN class. The resolver cannot handle such packets, so is returning a REFUSED response to the sender. -% RESOLVER_NOROOTADDR no root addresses available +% RESOLVER_NO_ROOT_ADDRESS no root addresses available A warning message during startup, indicates that no root addresses have been set. This may be because the resolver will get them from a priming query. -% RESOLVER_NOTONEQUES query contained %1 questions, exactly one question was expected +% RESOLVER_NOT_ONE_QUEST query contained %1 questions, exactly one question was expected A debug message, the resolver received a query that contained the number of entires in the question section detailed in the message. This is a malformed message, as a DNS query must contain only one question. The resolver will return a message to the sender with the RCODE set to FORMERR. -% RESOLVER_OPCODEUNS opcode %1 not supported by the resolver +% RESOLVER_UNSUPPORTED_OPCODE opcode %1 not supported by the resolver A debug message, the resolver received a message with an unsupported opcode (it can only process QUERY opcodes). It will return a message to the sender with the RCODE set to NOTIMP. -% RESOLVER_PARSEERR error parsing received message: %1 - returning %2 +% RESOLVER_PARSE_ERROR error parsing received message: %1 - returning %2 A debug message noting that the resolver received a message and the parsing of the body of the message failed due to some non-protocol related reason (although the parsing of the header succeeded). The message parameters give a textual description of the problem and the RCODE returned. -% RESOLVER_PRINTMSG print message command, arguments are: %1 +% RESOLVER_PRINT_COMMAND print message command, arguments are: %1 This message is logged when a "print_message" command is received over the command channel. -% RESOLVER_PROTERR protocol error parsing received message: %1 - returning %2 +% RESOLVER_PROTOCOL_ERROR protocol error parsing received message: %1 - returning %2 A debug message noting that the resolver received a message and the parsing of the body of the message failed due to some protocol error (although the parsing of the header succeeded). The message parameters give a textual description of the problem and the RCODE returned. -% RESOLVER_QUSETUP query setup +% RESOLVER_RECQ_SETUP query setup A debug message noting that the resolver is creating a RecursiveQuery object. -% RESOLVER_QUSHUT query shutdown +% RESOLVER_RECQ_SHUTDOWN query shutdown A debug message noting that the resolver is destroying a RecursiveQuery object. -% RESOLVER_QUTMOSMALL query timeout of %1 is too small +% RESOLVER_QUERY_TMO_SMALL query timeout of %1 is too small An error indicating that the configuration value specified for the query timeout is too small. @@ -141,24 +141,24 @@ timeout is too small. This is an informational message that appears at startup noting that the resolver is running in recursive mode. -% RESOLVER_RECVMSG resolver has received a DNS message +% RESOLVER_RECEIVED_MSG resolver has received a DNS message A debug message indicating that the resolver has received a message. Depending on the debug settings, subsequent log output will indicate the nature of the message. -% RESOLVER_RETRYNEG negative number of retries (%1) specified in the configuration +% RESOLVER_NEG_RETRIES negative number of retries (%1) specified in the configuration An error message indicating that the resolver configuration has specified a negative retry count. Only zero or positive values are valid. -% RESOLVER_ROOTADDR setting root address %1(%2) +% RESOLVER_SET_ROOT_ADDRESS setting root address %1(%2) This message may appear multiple times during startup; it lists the root addresses used by the resolver. -% RESOLVER_SERVICE service object created +% RESOLVER_SERVICE_CREATED service object created A debug message, output when the main service object (which handles the received queries) is created. -% RESOLVER_SETPARAM query timeout: %1, client timeout: %2, lookup timeout: %3, retry count: %4 +% RESOLVER_SET_PARAMS query timeout: %1, client timeout: %2, lookup timeout: %3, retry count: %4 A debug message, lists the parameters associated with the message. These are: query timeout: the timeout (in ms) used for queries originated by the resolver to upstream servers. Client timeout: the interval to resolver a query by @@ -187,6 +187,6 @@ has been completed and it is entering its main loop. % RESOLVER_STARTING starting resolver with command line '%1' An informational message, this is output when the resolver starts up. -% RESOLVER_UNEXRESP received unexpected response, ignoring +% RESOLVER_UNEXPECTED_RESPONSE received unexpected response, ignoring A debug message noting that the server has received a response instead of a query and is ignoring it. From 77c17d3f03de64646da89de238288a22c49e3eb5 Mon Sep 17 00:00:00 2001 From: Stephen Morris Date: Fri, 24 Jun 2011 12:00:47 +0100 Subject: [PATCH 4/5] [trac1039] Modifications to messages and put in alphabetical order --- src/bin/resolver/resolver_messages.mes | 132 ++++++++++++------------- 1 file changed, 66 insertions(+), 66 deletions(-) diff --git a/src/bin/resolver/resolver_messages.mes b/src/bin/resolver/resolver_messages.mes index 23ab02f3c8..c379f2b01b 100644 --- a/src/bin/resolver/resolver_messages.mes +++ b/src/bin/resolver/resolver_messages.mes @@ -15,151 +15,142 @@ # No namespace declaration - these constants go in the global namespace # along with the resolver methods. -% RESOLVER_AXFR_TCP AXFR request received over TCP +% RESOLVER_AXFR_TCP AXFR request received over TCP A debug message, the resolver received a NOTIFY message over TCP. The server cannot process it and will return an error message to the sender with the RCODE set to NOTIMP. -% RESOLVER_AXFR_UDP AXFR request received over UDP +% RESOLVER_AXFR_UDP AXFR request received over UDP A debug message, the resolver received a NOTIFY message over UDP. The server cannot process it (and in any case, an AXFR request should be sent over TCP) and will return an error message to the sender with the RCODE set to FORMERR. -% RESOLVER_CONFIG_CHANNEL configuration channel created +% RESOLVER_CLI_TMO_SMALL client timeout of %1 is too small +An error indicating that the configuration value specified for the query +timeout is too small. + +% RESOLVER_CONFIG_CHANNEL configuration channel created A debug message, output when the resolver has successfully established a connection to the configuration channel. -% RESOLVER_CONFIG_ERROR error in configuration: %1 +% RESOLVER_CONFIG_ERROR error in configuration: %1 An error was detected in a configuration update received by the resolver. This may be in the format of the configuration message (in which case this is a programming error) or it may be in the data supplied (in which case it is a user error). The reason for the error, given as a parameter in the message, will give more details. -% RESOLVER_CONFIG_LOADED configuration loaded +% RESOLVER_CONFIG_LOADED configuration loaded A debug message, output when the resolver configuration has been successfully loaded. -% RESOLVER_CONFIG_UPDATED configuration updated: %1 +% RESOLVER_CONFIG_UPDATED configuration updated: %1 A debug message, the configuration has been updated with the specified information. -% RESOLVER_DNS_MSG_RECVD DNS message received: %1 +% RESOLVER_CREATED main resolver object created +A debug message, output when the Resolver() object has been created. + +% RESOLVER_DNS_MSG_RECVD DNS message received: %1 A debug message, this always precedes some other logging message and is the formatted contents of the DNS packet that the other message refers to. -% RESOLVER_DNS_MSG_SENT DNS message of %1 bytes sent: %2 +% RESOLVER_DNS_MSG_SENT DNS message of %1 bytes sent: %2 A debug message, this contains details of the response sent back to the querying system. -% RESOLVER_CLI_TMO_SMALL client timeout of %1 is too small -An error indicating that the configuration value specified for the query -timeout is too small. - -% RESOLVER_CREATED main resolver object created -A debug message, output when the Resolver() object has been created. - -% RESOLVER_FAILED resolver failed, reason: %1 +% RESOLVER_FAILED resolver failed, reason: %1 This is an error message output when an unhandled exception is caught by the resolver. All it can do is to shut down. -% RESOLVER_FWD_ADDRESS setting forward address %1(%2) +% RESOLVER_FWD_ADDRESS setting forward address %1(%2) This message may appear multiple times during startup, and it lists the forward addresses used by the resolver when running in forwarding mode. -% RESOLVER_FWD_QUERY processing forward query +% RESOLVER_FWD_QUERY processing forward query The received query has passed all checks and is being forwarded to upstream servers. -% RESOLVER_HEADER_ERROR message received, exception when processing header: %1 +% RESOLVER_HEADER_ERROR message received, exception when processing header: %1 A debug message noting that an exception occurred during the processing of a received packet. The packet has been dropped. -% RESOLVER_IXFR IXFR request received +% RESOLVER_IXFR IXFR request received The resolver received a NOTIFY message over TCP. The server cannot process it and will return an error message to the sender with the RCODE set to NOTIMP. -% RESOLVER_LKUP_TMO_SMALL lookup timeout of %1 is too small +% RESOLVER_LKUP_TMO_SMALL lookup timeout of %1 is too small An error indicating that the configuration value specified for the lookup timeout is too small. -% RESOLVER_NOTIFY_RECVD NOTIFY arrived but server is not authoritative -The resolver received a NOTIFY message. As the server is not authoritative it -cannot process it, so it returns an error message to the sender with the RCODE -set to NOTAUTH. +% RESOLVER_NEG_RETRIES negative number of retries (%1) specified in the configuration +An error message indicating that the resolver configuration has specified a +negative retry count. Only zero or positive values are valid. -% RESOLVER_NORMAL_QUERY processing normal query -The received query has passed all checks and is being processed by the resolver. - -% RESOLVER_NON_IN_PACKET non-IN class request received, returning REFUSED message +% RESOLVER_NON_IN_PACKET non-IN class request received, returning REFUSED message A debug message, the resolver has received a DNS packet that was not IN class. The resolver cannot handle such packets, so is returning a REFUSED response to the sender. -% RESOLVER_NO_ROOT_ADDRESS no root addresses available -A warning message during startup, indicates that no root addresses have been -set. This may be because the resolver will get them from a priming query. +% RESOLVER_NORMAL_QUERY processing normal query +The received query has passed all checks and is being processed by the resolver. -% RESOLVER_NOT_ONE_QUEST query contained %1 questions, exactly one question was expected +% RESOLVER_NOTIFY_RECVD NOTIFY arrived but server is not authoritative +The resolver received a NOTIFY message. As the server is not authoritative it +cannot process it, so it returns an error message to the sender with the RCODE +set to NOTAUTH. + +% RESOLVER_NOT_ONE_QUEST query contained %1 questions, exactly one question was expected A debug message, the resolver received a query that contained the number of entires in the question section detailed in the message. This is a malformed message, as a DNS query must contain only one question. The resolver will return a message to the sender with the RCODE set to FORMERR. -% RESOLVER_UNSUPPORTED_OPCODE opcode %1 not supported by the resolver -A debug message, the resolver received a message with an unsupported opcode -(it can only process QUERY opcodes). It will return a message to the sender -with the RCODE set to NOTIMP. +% RESOLVER_NO_ROOT_ADDRESS no root addresses available +A warning message during startup, indicates that no root addresses have been +set. This may be because the resolver will get them from a priming query. -% RESOLVER_PARSE_ERROR error parsing received message: %1 - returning %2 +% RESOLVER_PARSE_ERROR error parsing received message: %1 - returning %2 A debug message noting that the resolver received a message and the parsing of the body of the message failed due to some non-protocol related reason (although the parsing of the header succeeded). The message parameters give a textual description of the problem and the RCODE returned. -% RESOLVER_PRINT_COMMAND print message command, arguments are: %1 +% RESOLVER_PRINT_COMMAND print message command, arguments are: %1 This message is logged when a "print_message" command is received over the command channel. -% RESOLVER_PROTOCOL_ERROR protocol error parsing received message: %1 - returning %2 +% RESOLVER_PROTOCOL_ERROR protocol error parsing received message: %1 - returning %2 A debug message noting that the resolver received a message and the parsing of the body of the message failed due to some protocol error (although the parsing of the header succeeded). The message parameters give a textual description of the problem and the RCODE returned. -% RESOLVER_RECQ_SETUP query setup -A debug message noting that the resolver is creating a RecursiveQuery object. - -% RESOLVER_RECQ_SHUTDOWN query shutdown -A debug message noting that the resolver is destroying a RecursiveQuery object. - -% RESOLVER_QUERY_TMO_SMALL query timeout of %1 is too small +% RESOLVER_QUERY_TMO_SMALL query timeout of %1 is too small An error indicating that the configuration value specified for the query timeout is too small. -% RESOLVER_RECURSIVE running in recursive mode -This is an informational message that appears at startup noting that the -resolver is running in recursive mode. - -% RESOLVER_RECEIVED_MSG resolver has received a DNS message +% RESOLVER_RECEIVED_MSG resolver has received a DNS message A debug message indicating that the resolver has received a message. Depending on the debug settings, subsequent log output will indicate the nature of the message. -% RESOLVER_NEG_RETRIES negative number of retries (%1) specified in the configuration -An error message indicating that the resolver configuration has specified a -negative retry count. Only zero or positive values are valid. +% RESOLVER_RECQ_SETUP query setup +A debug message noting that the resolver is creating a RecursiveQuery object. -% RESOLVER_SET_ROOT_ADDRESS setting root address %1(%2) -This message may appear multiple times during startup; it lists the root -addresses used by the resolver. +% RESOLVER_RECQ_SHUTDOWN query shutdown +A debug message noting that the resolver is destroying a RecursiveQuery object. -% RESOLVER_SERVICE_CREATED service object created +% RESOLVER_RECURSIVE running in recursive mode +This is an informational message that appears at startup noting that the +resolver is running in recursive mode. + +% RESOLVER_SERVICE_CREATED service object created A debug message, output when the main service object (which handles the received queries) is created. -% RESOLVER_SET_PARAMS query timeout: %1, client timeout: %2, lookup timeout: %3, retry count: %4 -A debug message, lists the parameters associated with the message. These are: +% RESOLVER_SET_PARAMS query timeout: %1, client timeout: %2, lookup timeout: %3, retry count: %4 +A debug message, lists the parameters being set for the resolver. These are: query timeout: the timeout (in ms) used for queries originated by the resolver to upstream servers. Client timeout: the interval to resolver a query by a client: after this time, the resolver sends back a SERVFAIL to the client @@ -173,20 +164,29 @@ upstream nameservers. Even if none of these queries timeout, the total time taken to perform all the queries may exceed the client timeout. When this happens, a SERVFAIL is returned to the client, but the resolver continues with the resolution process. Data received is added to the cache. However, -there comes a time - the lookup timeout - when even the resolve gives up. +there comes a time - the lookup timeout - when even the resolver gives up. At this point it will wait for pending upstream queries to complete or timeout and drop the query. -% RESOLVER_SHUTDOWN resolver shutdown complete +% RESOLVER_SET_ROOT_ADDRESS setting root address %1(%2) +This message may appear multiple times during startup; it lists the root +addresses used by the resolver. + +% RESOLVER_SHUTDOWN resolver shutdown complete This information message is output when the resolver has shut down. -% RESOLVER_STARTED resolver started +% RESOLVER_STARTED resolver started This informational message is output by the resolver when all initialization has been completed and it is entering its main loop. -% RESOLVER_STARTING starting resolver with command line '%1' +% RESOLVER_STARTING starting resolver with command line '%1' An informational message, this is output when the resolver starts up. -% RESOLVER_UNEXPECTED_RESPONSE received unexpected response, ignoring +% RESOLVER_UNEXPECTED_RESPONSE received unexpected response, ignoring A debug message noting that the server has received a response instead of a query and is ignoring it. + +% RESOLVER_UNSUPPORTED_OPCODE opcode %1 not supported by the resolver +A debug message, the resolver received a message with an unsupported opcode +(it can only process QUERY opcodes). It will return a message to the sender +with the RCODE set to NOTIMP. From 6f7998f9a209e9dd7b3ac80793098dfd81b489b9 Mon Sep 17 00:00:00 2001 From: Stephen Morris Date: Mon, 27 Jun 2011 11:28:50 +0100 Subject: [PATCH 5/5] [trac1039] Modifications after review --- src/bin/resolver/resolver.cc | 39 ++++++++++++++----------- src/bin/resolver/resolver_messages.mes | 40 +++++++++++++++----------- 2 files changed, 46 insertions(+), 33 deletions(-) diff --git a/src/bin/resolver/resolver.cc b/src/bin/resolver/resolver.cc index 1b8f1d90fc..68c1b20014 100644 --- a/src/bin/resolver/resolver.cc +++ b/src/bin/resolver/resolver.cc @@ -83,7 +83,7 @@ public: isc::cache::ResolverCache& cache) { assert(!rec_query_); // queryShutdown must be called first - LOG_DEBUG(resolver_logger, RESOLVER_DBG_INIT, RESOLVER_RECQ_SETUP); + LOG_DEBUG(resolver_logger, RESOLVER_DBG_INIT, RESOLVER_QUERY_SETUP); rec_query_ = new RecursiveQuery(dnss, nsas, cache, upstream_, @@ -99,7 +99,8 @@ public: // (this is not a safety check, just to prevent logging of // actions that are not performed if (rec_query_) { - LOG_DEBUG(resolver_logger, RESOLVER_DBG_INIT, RESOLVER_RECQ_SHUTDOWN); + LOG_DEBUG(resolver_logger, RESOLVER_DBG_INIT, + RESOLVER_QUERY_SHUTDOWN); delete rec_query_; rec_query_ = NULL; } @@ -112,7 +113,7 @@ public: if (dnss) { if (!upstream_.empty()) { BOOST_FOREACH(const AddressPair& address, upstream) { - LOG_INFO(resolver_logger, RESOLVER_FWD_ADDRESS) + LOG_INFO(resolver_logger, RESOLVER_FORWARD_ADDRESS) .arg(address.first).arg(address.second); } } else { @@ -302,7 +303,8 @@ public: answer_message->toWire(renderer); - LOG_DEBUG(resolver_logger, RESOLVER_DBG_DETAIL, RESOLVER_DNS_MSG_SENT) + LOG_DEBUG(resolver_logger, RESOLVER_DBG_DETAIL, + RESOLVER_DNS_MESSAGE_SENT) .arg(renderer.getLength()).arg(*answer_message); } }; @@ -418,7 +420,7 @@ Resolver::processMessage(const IOMessage& io_message, server->resume(true); return; } catch (const Exception& ex) { - LOG_DEBUG(resolver_logger, RESOLVER_DBG_IO, RESOLVER_PROTOCOL_ERROR) + LOG_DEBUG(resolver_logger, RESOLVER_DBG_IO, RESOLVER_MESSAGE_ERROR) .arg(ex.what()).arg(Rcode::SERVFAIL()); makeErrorMessage(query_message, answer_message, buffer, Rcode::SERVFAIL()); @@ -429,8 +431,8 @@ Resolver::processMessage(const IOMessage& io_message, // Note: there appears to be no LOG_DEBUG for a successfully-received // message. This is not an oversight - it is handled below. In the // meantime, output the full message for debug purposes (if requested). - LOG_DEBUG(resolver_logger, RESOLVER_DBG_DETAIL, RESOLVER_DNS_MSG_RECVD) - .arg(*query_message); + LOG_DEBUG(resolver_logger, RESOLVER_DBG_DETAIL, + RESOLVER_DNS_MESSAGE_RECEIVED).arg(*query_message); // Perform further protocol-level validation. bool sendAnswer = true; @@ -439,20 +441,22 @@ Resolver::processMessage(const IOMessage& io_message, makeErrorMessage(query_message, answer_message, buffer, Rcode::NOTAUTH()); // Notify arrived, but we are not authoritative. - LOG_DEBUG(resolver_logger, RESOLVER_DBG_PROCESS, RESOLVER_NOTIFY_RECVD); + LOG_DEBUG(resolver_logger, RESOLVER_DBG_PROCESS, + RESOLVER_NOTIFY_RECEIVED); } else if (query_message->getOpcode() != Opcode::QUERY()) { // Unsupported opcode. - LOG_DEBUG(resolver_logger, RESOLVER_DBG_PROCESS, RESOLVER_UNSUPPORTED_OPCODE) - .arg(query_message->getOpcode()); + LOG_DEBUG(resolver_logger, RESOLVER_DBG_PROCESS, + RESOLVER_UNSUPPORTED_OPCODE).arg(query_message->getOpcode()); makeErrorMessage(query_message, answer_message, buffer, Rcode::NOTIMP()); } else if (query_message->getRRCount(Message::SECTION_QUESTION) != 1) { // Not one question - LOG_DEBUG(resolver_logger, RESOLVER_DBG_PROCESS, RESOLVER_NOT_ONE_QUEST) + LOG_DEBUG(resolver_logger, RESOLVER_DBG_PROCESS, + RESOLVER_NOT_ONE_QUESTION) .arg(query_message->getRRCount(Message::SECTION_QUESTION)); makeErrorMessage(query_message, answer_message, buffer, Rcode::FORMERR()); @@ -525,7 +529,7 @@ ResolverImpl::processNormalQuery(ConstMessagePtr query_message, } else { // Processing forward query - LOG_DEBUG(resolver_logger, RESOLVER_DBG_IO, RESOLVER_FWD_QUERY); + LOG_DEBUG(resolver_logger, RESOLVER_DBG_IO, RESOLVER_FORWARD_QUERY); rec_query_->forward(query_message, answer_message, buffer, server); } } @@ -560,7 +564,8 @@ Resolver::updateConfig(ConstElementPtr config) { // check for us qtimeout = qtimeoutE->intValue(); if (qtimeout < -1) { - LOG_ERROR(resolver_logger, RESOLVER_QUERY_TMO_SMALL).arg(qtimeout); + LOG_ERROR(resolver_logger, RESOLVER_QUERY_TIME_SMALL) + .arg(qtimeout); isc_throw(BadValue, "Query timeout too small"); } set_timeouts = true; @@ -568,7 +573,8 @@ Resolver::updateConfig(ConstElementPtr config) { if (ctimeoutE) { ctimeout = ctimeoutE->intValue(); if (ctimeout < -1) { - LOG_ERROR(resolver_logger, RESOLVER_CLI_TMO_SMALL).arg(ctimeout); + LOG_ERROR(resolver_logger, RESOLVER_CLIENT_TIME_SMALL) + .arg(ctimeout); isc_throw(BadValue, "Client timeout too small"); } set_timeouts = true; @@ -576,7 +582,8 @@ Resolver::updateConfig(ConstElementPtr config) { if (ltimeoutE) { ltimeout = ltimeoutE->intValue(); if (ltimeout < -1) { - LOG_ERROR(resolver_logger, RESOLVER_LKUP_TMO_SMALL).arg(ltimeout); + LOG_ERROR(resolver_logger, RESOLVER_LOOKUP_TIME_SMALL) + .arg(ltimeout); isc_throw(BadValue, "Lookup timeout too small"); } set_timeouts = true; @@ -586,7 +593,7 @@ Resolver::updateConfig(ConstElementPtr config) { // _after_ the comparison (as opposed to before it for the timeouts) // because "retries" is unsigned. if (retriesE->intValue() < 0) { - LOG_ERROR(resolver_logger, RESOLVER_NEG_RETRIES) + LOG_ERROR(resolver_logger, RESOLVER_NEGATIVE_RETRIES) .arg(retriesE->intValue()); isc_throw(BadValue, "Negative number of retries"); } diff --git a/src/bin/resolver/resolver_messages.mes b/src/bin/resolver/resolver_messages.mes index c379f2b01b..4ce0f7d73a 100644 --- a/src/bin/resolver/resolver_messages.mes +++ b/src/bin/resolver/resolver_messages.mes @@ -25,7 +25,7 @@ A debug message, the resolver received a NOTIFY message over UDP. The server cannot process it (and in any case, an AXFR request should be sent over TCP) and will return an error message to the sender with the RCODE set to FORMERR. -% RESOLVER_CLI_TMO_SMALL client timeout of %1 is too small +% RESOLVER_CLIENT_TIME_SMALL client timeout of %1 is too small An error indicating that the configuration value specified for the query timeout is too small. @@ -51,11 +51,11 @@ information. % RESOLVER_CREATED main resolver object created A debug message, output when the Resolver() object has been created. -% RESOLVER_DNS_MSG_RECVD DNS message received: %1 +% RESOLVER_DNS_MESSAGE_RECEIVED DNS message received: %1 A debug message, this always precedes some other logging message and is the formatted contents of the DNS packet that the other message refers to. -% RESOLVER_DNS_MSG_SENT DNS message of %1 bytes sent: %2 +% RESOLVER_DNS_MESSAGE_SENT DNS message of %1 bytes sent: %2 A debug message, this contains details of the response sent back to the querying system. @@ -63,11 +63,11 @@ system. This is an error message output when an unhandled exception is caught by the resolver. All it can do is to shut down. -% RESOLVER_FWD_ADDRESS setting forward address %1(%2) +% RESOLVER_FORWARD_ADDRESS setting forward address %1(%2) This message may appear multiple times during startup, and it lists the forward addresses used by the resolver when running in forwarding mode. -% RESOLVER_FWD_QUERY processing forward query +% RESOLVER_FORWARD_QUERY processing forward query The received query has passed all checks and is being forwarded to upstream servers. @@ -79,11 +79,17 @@ a received packet. The packet has been dropped. The resolver received a NOTIFY message over TCP. The server cannot process it and will return an error message to the sender with the RCODE set to NOTIMP. -% RESOLVER_LKUP_TMO_SMALL lookup timeout of %1 is too small +% RESOLVER_LOOKUP_TIME_SMALL lookup timeout of %1 is too small An error indicating that the configuration value specified for the lookup timeout is too small. -% RESOLVER_NEG_RETRIES negative number of retries (%1) specified in the configuration +% RESOLVER_MESSAGE_ERROR error parsing received message: %1 - returning %2 +A debug message noting that the resolver received a message and the +parsing of the body of the message failed due to some error (although +the parsing of the header succeeded). The message parameters give a +textual description of the problem and the RCODE returned. + +% RESOLVER_NEGATIVE_RETRIES negative number of retries (%1) specified in the configuration An error message indicating that the resolver configuration has specified a negative retry count. Only zero or positive values are valid. @@ -95,12 +101,12 @@ the sender. % RESOLVER_NORMAL_QUERY processing normal query The received query has passed all checks and is being processed by the resolver. -% RESOLVER_NOTIFY_RECVD NOTIFY arrived but server is not authoritative +% RESOLVER_NOTIFY_RECEIVED NOTIFY arrived but server is not authoritative The resolver received a NOTIFY message. As the server is not authoritative it cannot process it, so it returns an error message to the sender with the RCODE set to NOTAUTH. -% RESOLVER_NOT_ONE_QUEST query contained %1 questions, exactly one question was expected +% RESOLVER_NOT_ONE_QUESTION query contained %1 questions, exactly one question was expected A debug message, the resolver received a query that contained the number of entires in the question section detailed in the message. This is a malformed message, as a DNS query must contain only one question. The resolver will @@ -126,21 +132,21 @@ of the body of the message failed due to some protocol error (although the parsing of the header succeeded). The message parameters give a textual description of the problem and the RCODE returned. -% RESOLVER_QUERY_TMO_SMALL query timeout of %1 is too small +% RESOLVER_QUERY_SETUP query setup +A debug message noting that the resolver is creating a RecursiveQuery object. + +% RESOLVER_QUERY_SHUTDOWN query shutdown +A debug message noting that the resolver is destroying a RecursiveQuery object. + +% RESOLVER_QUERY_TIME_SMALL query timeout of %1 is too small An error indicating that the configuration value specified for the query timeout is too small. -% RESOLVER_RECEIVED_MSG resolver has received a DNS message +% RESOLVER_RECEIVED_MESSAGE resolver has received a DNS message A debug message indicating that the resolver has received a message. Depending on the debug settings, subsequent log output will indicate the nature of the message. -% RESOLVER_RECQ_SETUP query setup -A debug message noting that the resolver is creating a RecursiveQuery object. - -% RESOLVER_RECQ_SHUTDOWN query shutdown -A debug message noting that the resolver is destroying a RecursiveQuery object. - % RESOLVER_RECURSIVE running in recursive mode This is an informational message that appears at startup noting that the resolver is running in recursive mode.