From 9e560b59a722d06a62b5aed761e71fec72638a7c Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Tue, 6 Feb 2001 23:57:16 +0000 Subject: [PATCH] 726. [func] Implement the "trace" and "notrace" commands in rndc. --- CHANGES | 2 ++ bin/named/include/named/omapi.h | 4 +++- bin/named/omapi.c | 10 +++++++++- bin/rndc/rndc.c | 12 +++++------- 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/CHANGES b/CHANGES index 7a4519f68a..a25e172fd6 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,6 @@ + 726. [func] Implement the "trace" and "notrace" commands in rndc. + 725. [bug] Installing man pages could fail. 724. [func] New libisc functions isc_netaddr_any(), diff --git a/bin/named/include/named/omapi.h b/bin/named/include/named/omapi.h index 25070cefc1..196235e3ba 100644 --- a/bin/named/include/named/omapi.h +++ b/bin/named/include/named/omapi.h @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: omapi.h,v 1.18 2001/01/09 21:40:26 bwelling Exp $ */ +/* $Id: omapi.h,v 1.19 2001/02/06 23:57:15 bwelling Exp $ */ #ifndef NAMED_OMAPI_H #define NAMED_OMAPI_H 1 @@ -43,6 +43,8 @@ #define NS_OMAPI_COMMAND_DUMPSTATS "stats" #define NS_OMAPI_COMMAND_QUERYLOG "querylog" #define NS_OMAPI_COMMAND_DUMPDB "dumpdb" +#define NS_OMAPI_COMMAND_TRACE "trace" +#define NS_OMAPI_COMMAND_NOTRACE "notrace" isc_result_t ns_omapi_init(void); diff --git a/bin/named/omapi.c b/bin/named/omapi.c index 392f7b4ef4..4ba3fc9f57 100644 --- a/bin/named/omapi.c +++ b/bin/named/omapi.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: omapi.c,v 1.30 2001/01/09 21:39:59 bwelling Exp $ */ +/* $Id: omapi.c,v 1.31 2001/02/06 23:57:13 bwelling Exp $ */ /* * Principal Author: DCL @@ -113,6 +113,14 @@ control_setvalue(omapi_object_t *handle, omapi_string_t *name, } else if (omapi_string_strcmp(name, NS_OMAPI_COMMAND_DUMPDB) == 0) { ns_server_dumpdb(ns_g_server); result = ISC_R_SUCCESS; + } else if (omapi_string_strcmp(name, NS_OMAPI_COMMAND_TRACE) == 0) { + ns_g_debuglevel++; + isc_log_setdebuglevel(ns_g_lctx, ns_g_debuglevel); + result = ISC_R_SUCCESS; + } else if (omapi_string_strcmp(name, NS_OMAPI_COMMAND_NOTRACE) == 0) { + ns_g_debuglevel = 0; + isc_log_setdebuglevel(ns_g_lctx, ns_g_debuglevel); + result = ISC_R_SUCCESS; } else { isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_OMAPI, ISC_LOG_WARNING, diff --git a/bin/rndc/rndc.c b/bin/rndc/rndc.c index 08209b939a..ad18ccff48 100644 --- a/bin/rndc/rndc.c +++ b/bin/rndc/rndc.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: rndc.c,v 1.38 2001/01/09 21:40:44 bwelling Exp $ */ +/* $Id: rndc.c,v 1.39 2001/02/06 23:57:16 bwelling Exp $ */ /* * Principal Author: DCL @@ -270,9 +270,9 @@ command is one of the following:\n\ dumpdb Dump cache(s) to the dump file (named_dump.db).\n\ stop Save pending updates to master files and stop the server.\n\ halt Stop the server without saving pending updates.\n\ + trace Increment debugging level by one.\n\ + notrace Set debugging level to 0.\n\ *status Display ps(1) status of named.\n\ - *trace Increment debugging level by one.\n\ - *notrace Set debugging level to 0.\n\ *restart Restart the server.\n\ \n\ * == not yet implemented\n\ @@ -513,10 +513,8 @@ main(int argc, char **argv) { notify(command); - if (strcmp(command, "notrace") == 0 || - strcmp(command, "restart") == 0 || - strcmp(command, "status") == 0 || - strcmp(command, "trace") == 0) { + if (strcmp(command, "restart") == 0 || + strcmp(command, "status") == 0) { result = ISC_R_NOTIMPLEMENTED; } else { result = send_command(omapimgr, command, args);