Commit 4d86cda3 authored by Mark Andrews's avatar Mark Andrews
Browse files

1757. [func] host now can turn on memory debugging flags with '-m'.

parent e3d982f4
......@@ -15,7 +15,7 @@
1758. [placeholder] rt12933
1757. [placeholder] rt12919
1757. [func] host now can turn on memory debugging flags with '-m'.
1756. [func] named-checkconf now checks the logging configuration.
[RT #12352]
......
......@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: host.c,v 1.98 2004/09/06 01:24:43 marka Exp $ */
/* $Id: host.c,v 1.99 2004/11/10 22:04:25 marka Exp $ */
#include <config.h>
#include <limits.h>
......@@ -127,7 +127,7 @@ static void
show_usage(void) {
fputs(
"Usage: host [-aCdlriTwv] [-c class] [-N ndots] [-t type] [-W time]\n"
" [-R number] hostname [server]\n"
" [-R number] [-m flag] hostname [server]\n"
" -a is equivalent to -v -t *\n"
" -c specifies query class for non-IN data\n"
" -C compares SOA records on authoritative nameservers\n"
......@@ -143,7 +143,8 @@ show_usage(void) {
" -w specifies to wait forever for a reply\n"
" -W specifies how long to wait for a reply\n"
" -4 use IPv4 query transport only\n"
" -6 use IPv6 query transport only\n", stderr);
" -6 use IPv6 query transport only\n"
" -m set memory debugging flag (trace|record|usage)\n", stderr);
exit(1);
}
......@@ -537,6 +538,50 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
return (result);
}
static const char * optstring = "46ac:dilnm:rt:vwCDN:R:TW:";
static void
pre_parse_args(int argc, char **argv) {
int c;
while ((c = isc_commandline_parse(argc, argv, optstring)) != -1) {
switch (c) {
case 'm':
if (strcasecmp("trace", isc_commandline_argument) == 0)
isc_mem_debugging |= ISC_MEM_DEBUGTRACE;
else if (!strcasecmp("record",
isc_commandline_argument) == 0)
isc_mem_debugging |= ISC_MEM_DEBUGRECORD;
else if (strcasecmp("usage",
isc_commandline_argument) == 0)
isc_mem_debugging |= ISC_MEM_DEBUGUSAGE;
break;
case '4': break;
case '6': break;
case 'a': break;
case 'c': break;
case 'd': break;
case 'i': break;
case 'l': break;
case 'n': break;
case 'r': break;
case 't': break;
case 'v': break;
case 'w': break;
case 'C': break;
case 'D': break;
case 'N': break;
case 'R': break;
case 'T': break;
case 'W': break;
default:
show_usage();
}
}
isc_commandline_reset = ISC_TRUE;
}
static void
parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
char hostname[MXNAME];
......@@ -553,8 +598,7 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
lookup = make_empty_lookup();
while ((c = isc_commandline_parse(argc, argv, "lvwrdt:c:aTCN:R:W:Dni46"))
!= EOF) {
while ((c = isc_commandline_parse(argc, argv, optstring)) != -1) {
switch (c) {
case 'l':
lookup->tcp_mode = ISC_TRUE;
......@@ -637,6 +681,9 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
case 'n':
/* deprecated */
break;
case 'm':
/* Handled by pre_parse_args(). */
break;
case 'w':
/*
* The timer routines are coded such that
......@@ -738,6 +785,7 @@ main(int argc, char **argv) {
debug("main()");
progname = argv[0];
pre_parse_args(argc, argv);
result = isc_app_start();
check_result(result, "isc_app_start");
setup_libs();
......@@ -751,4 +799,3 @@ main(int argc, char **argv) {
isc_app_finish();
return ((seen_error == 0) ? 0 : 1);
}
......@@ -16,7 +16,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
<!-- $Id: host.docbook,v 1.6 2004/04/13 01:09:37 marka Exp $ -->
<!-- $Id: host.docbook,v 1.7 2004/11/10 22:04:25 marka Exp $ -->
<refentry>
......@@ -44,6 +44,7 @@
<arg><option>-R <replaceable class="parameter">number</replaceable></option></arg>
<arg><option>-t <replaceable class="parameter">type</replaceable></option></arg>
<arg><option>-W <replaceable class="parameter">wait</replaceable></option></arg>
<arg><option>-m <replaceable class="parameter">flag</replaceable></option></arg>
<arg><option>-4</option></arg>
<arg><option>-6</option></arg>
<arg choice=req>name</arg>
......@@ -188,6 +189,11 @@ will be set to the number of seconds given by the hardware's maximum
value for an integer quantity.
</para>
<para>
The <option>-m</option> can be used to set the memory usage debugging flags
<parameter>record</parameter>, <parameter>usage</parameter> and
<parameter>trace</parameter>.
</para>
</refsect1>
<refsect1>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment