From d2792acfafe148fca2f97ff97ef0a8082218e28a Mon Sep 17 00:00:00 2001 From: Michael Sawyer Date: Mon, 2 Oct 2000 16:43:25 +0000 Subject: [PATCH] Add (presently undocumented) -p option to show the begin of each DNS packet, useful for AXFR's and similar replies. (requested by GDIB) --- bin/dig/dig.c | 7 +++++-- bin/dig/dighost.c | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/bin/dig/dig.c b/bin/dig/dig.c index c77da7c6f2..f93ae6351c 100644 --- a/bin/dig/dig.c +++ b/bin/dig/dig.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dig.c,v 1.108 2000/10/02 16:16:50 mws Exp $ */ +/* $Id: dig.c,v 1.109 2000/10/02 16:43:24 mws Exp $ */ #include #include @@ -78,7 +78,7 @@ dig_lookup_t *default_lookup = NULL; extern isc_uint32_t name_limit; extern isc_uint32_t rr_limit; -extern isc_boolean_t debugging; +extern isc_boolean_t debugging, show_packets; char *batchname = NULL; FILE *batchfp = NULL; char *argv0; @@ -883,6 +883,9 @@ dash_option(char *option, char *next, dig_lookup_t **lookup, case 'n': nibble = ISC_TRUE; return (ISC_FALSE); + case 'p': + show_packets = ISC_TRUE; + return (ISC_FALSE); } if (value == NULL) goto invalid_option; diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c index b0684b8fd1..0dfce9fec1 100644 --- a/bin/dig/dighost.c +++ b/bin/dig/dighost.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dighost.c,v 1.139 2000/09/30 00:06:08 gson Exp $ */ +/* $Id: dighost.c,v 1.140 2000/10/02 16:43:25 mws Exp $ */ /* * Notice to programmers: Do not use this code as an example of how to @@ -75,7 +75,8 @@ isc_boolean_t qr = ISC_FALSE, is_dst_up = ISC_FALSE, have_domain = ISC_FALSE, - is_blocking =ISC_FALSE; + is_blocking =ISC_FALSE, + show_packets = ISC_TRUE; in_port_t port = 53; unsigned int timeout = 0; @@ -2093,6 +2094,8 @@ recv_done(isc_task_t *task, isc_event_t *event) { UNUSED(task); INSIST(!free_now); + if (show_packets) + puts(";; begin of DNS packet"); debug("recv_done()"); LOCK_LOOKUP;