583. [func] "rndc querylog" will now toggle logging of

queries, like "ndc querylog" in BIND 8.
This commit is contained in:
Andreas Gustafsson 2000-11-30 00:25:49 +00:00
parent acb053cc54
commit d3be9a9c6e
8 changed files with 37 additions and 14 deletions

View file

@ -1,3 +1,6 @@
583. [func] "rndc querylog" will now toggle logging of
queries, like "ndc querylog" in BIND 8.
582. [bug] dns_zone_idetach() failed to lock the zone.
[RT #199, #463]

View file

@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: omapi.h,v 1.15 2000/11/27 19:42:28 gson Exp $ */
/* $Id: omapi.h,v 1.16 2000/11/30 00:25:13 gson Exp $ */
#ifndef NAMED_OMAPI_H
#define NAMED_OMAPI_H 1
@ -41,6 +41,7 @@
#define NS_OMAPI_COMMAND_RELOADZONES "reload-zones"
#define NS_OMAPI_COMMAND_REFRESH "refresh"
#define NS_OMAPI_COMMAND_DUMPSTATS "stats"
#define NS_OMAPI_COMMAND_QUERYLOG "querylog"
isc_result_t
ns_omapi_init(void);

View file

@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: server.h,v 1.44 2000/11/09 19:55:20 mws Exp $ */
/* $Id: server.h,v 1.45 2000/11/30 00:25:14 gson Exp $ */
#ifndef NAMED_SERVER_H
#define NAMED_SERVER_H 1
@ -67,6 +67,7 @@ struct ns_server {
isc_event_t * reload_event;
isc_boolean_t flushonshutdown;
isc_boolean_t log_queries; /* For BIND 8 compatibility */
char * statsfile;
FILE * statsfp;
@ -112,6 +113,12 @@ ns_server_reloadzone(ns_server_t *server, char *args);
isc_result_t
ns_server_refreshzone(ns_server_t *server, char *args);
isc_result_t
ns_server_togglequerylog(ns_server_t *server);
/*
* Toggle logging of queries, as in BIND 8.
*/
isc_result_t
ns_server_dumpstats(ns_server_t *server);

View file

@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: omapi.c,v 1.24 2000/11/08 01:36:12 gson Exp $ */
/* $Id: omapi.c,v 1.25 2000/11/30 00:25:06 gson Exp $ */
/*
* Principal Author: DCL
@ -127,6 +127,8 @@ control_setvalue(omapi_object_t *handle, omapi_string_t *name,
} else if (omapi_string_strcmp(name, NS_OMAPI_COMMAND_DUMPSTATS)
== 0) {
result = ns_server_dumpstats(ns_g_server);
} else if (omapi_string_strcmp(name, NS_OMAPI_COMMAND_QUERYLOG) == 0) {
result = ns_server_togglequerylog(ns_g_server);
} else {
isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
NS_LOGMODULE_OMAPI, ISC_LOG_WARNING,

View file

@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: query.c,v 1.155 2000/11/23 01:32:45 gson Exp $ */
/* $Id: query.c,v 1.156 2000/11/30 00:25:09 gson Exp $ */
#include <config.h>
@ -3321,7 +3321,8 @@ ns_query_start(ns_client_t *client) {
return;
}
log_query(client);
if (ns_g_server->log_queries)
log_query(client);
/*
* Check for multiple question queries, since edns1 is dead.

View file

@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: server.c,v 1.261 2000/11/28 21:32:32 gson Exp $ */
/* $Id: server.c,v 1.262 2000/11/30 00:25:11 gson Exp $ */
#include <config.h>
@ -2010,6 +2010,8 @@ ns_server_create(isc_mem_t *mctx, ns_server_t **serverp) {
ns_server_zeroglobal(server);
server->flushonshutdown = ISC_FALSE;
server->log_queries = ISC_FALSE;
server->magic = NS_SERVER_MAGIC;
*serverp = server;
}
@ -2186,6 +2188,17 @@ ns_server_refreshzone(ns_server_t *server, char *args) {
return (ISC_R_SUCCESS);
}
isc_result_t
ns_server_togglequerylog(ns_server_t *server) {
server->log_queries = ! server->log_queries;
isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
NS_LOGMODULE_SERVER, ISC_LOG_INFO,
"query logging is now %s",
server->log_queries ? "on" : "off");
return (ISC_R_SUCCESS);
}
static isc_result_t
ns_listenlist_fromconfig(dns_c_lstnlist_t *clist, dns_c_ctx_t *cctx,
ns_aclconfctx_t *actx,

View file

@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: rndc.c,v 1.29 2000/11/25 03:27:54 mws Exp $ */
/* $Id: rndc.c,v 1.30 2000/11/30 00:25:16 gson Exp $ */
/*
* Principal Author: DCL
@ -262,7 +262,7 @@ command is one of the following for named:\n\
stats Dump statistics to statistics file.\n\
*trace Increment debugging level by one.\n\
*notrace Set debugging level to 0.\n\
*querylog Toggle query logging.\n\
querylog Toggle query logging.\n\
*stop Stop the server.\n\
*restart Restart the server.\n\
\n\
@ -504,10 +504,6 @@ main(int argc, char **argv) {
} else if (strcmp(command, "notrace") == 0) {
result = ISC_R_NOTIMPLEMENTED;
} else if (strcmp(command, "querylog") == 0 ||
strcmp(command, "qrylog") == 0) {
result = ISC_R_NOTIMPLEMENTED;
} else if (strcmp(command, "reload") == 0) {
char omapiargs[DNS_NAME_MAXTEXT];
if (argc > 0) {

View file

@ -2,7 +2,7 @@
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.0//EN"
"http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd">
<!-- File: $Id: Bv9ARM-book.xml,v 1.56 2000/11/28 23:06:32 gson Exp $ -->
<!-- File: $Id: Bv9ARM-book.xml,v 1.57 2000/11/30 00:25:49 gson Exp $ -->
<book>
@ -690,7 +690,7 @@ of a server.</para>
</row>
<row rowsep = "0">
<entry colname =
"1"><para><userinput>querylog</userinput><footnoteref linkend="nyi1"/></para></entry>
"1"><para><userinput>querylog</userinput></para></entry>
<entry colname = "2"><para>Toggle query logging.</para></entry>
</row>
<row rowsep = "0">