mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-03 16:15:27 +00:00
795. [func] Add the +multiline option to dig.
(which requires dns_message_totext(), etc. to take a style parameter)
This commit is contained in:
2
CHANGES
2
CHANGES
@@ -1,3 +1,5 @@
|
|||||||
|
795. [func] Add the +multiline option to dig. [RT #1095]
|
||||||
|
|
||||||
794. [func] Implement the "port" and "default-port" statements
|
794. [func] Implement the "port" and "default-port" statements
|
||||||
in rndc.conf.
|
in rndc.conf.
|
||||||
|
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: dig.c,v 1.142 2001/03/14 18:08:16 bwelling Exp $ */
|
/* $Id: dig.c,v 1.143 2001/03/28 02:42:49 bwelling Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -31,6 +31,7 @@
|
|||||||
|
|
||||||
#include <dns/byaddr.h>
|
#include <dns/byaddr.h>
|
||||||
#include <dns/fixedname.h>
|
#include <dns/fixedname.h>
|
||||||
|
#include <dns/masterdump.h>
|
||||||
#include <dns/message.h>
|
#include <dns/message.h>
|
||||||
#include <dns/name.h>
|
#include <dns/name.h>
|
||||||
#include <dns/rdata.h>
|
#include <dns/rdata.h>
|
||||||
@@ -85,7 +86,8 @@ char *argv0;
|
|||||||
char domainopt[DNS_NAME_MAXTEXT];
|
char domainopt[DNS_NAME_MAXTEXT];
|
||||||
|
|
||||||
isc_boolean_t short_form = ISC_FALSE, printcmd = ISC_TRUE,
|
isc_boolean_t short_form = ISC_FALSE, printcmd = ISC_TRUE,
|
||||||
nibble = ISC_FALSE, plusquest = ISC_FALSE, pluscomm = ISC_FALSE;
|
nibble = ISC_FALSE, plusquest = ISC_FALSE, pluscomm = ISC_FALSE,
|
||||||
|
multiline = ISC_FALSE;
|
||||||
|
|
||||||
isc_uint16_t bufsize = 0;
|
isc_uint16_t bufsize = 0;
|
||||||
isc_boolean_t forcecomment = ISC_FALSE;
|
isc_boolean_t forcecomment = ISC_FALSE;
|
||||||
@@ -183,6 +185,7 @@ show_usage(void) {
|
|||||||
" +rrlimit=### (Limit number of rr's in xfr)\n"
|
" +rrlimit=### (Limit number of rr's in xfr)\n"
|
||||||
" +namelimit=### (Limit number of names in xfr)\n"
|
" +namelimit=### (Limit number of names in xfr)\n"
|
||||||
" +[no]dnssec (Request DNSSEC records)\n"
|
" +[no]dnssec (Request DNSSEC records)\n"
|
||||||
|
" +[no]multiline (Print records in an expanded format)\n"
|
||||||
" global d-opts and servers (before host name) affect all queries.\n"
|
" global d-opts and servers (before host name) affect all queries.\n"
|
||||||
" local d-opts and servers (after host name) affect only that lookup.\n"
|
" local d-opts and servers (after host name) affect only that lookup.\n"
|
||||||
, stderr);
|
, stderr);
|
||||||
@@ -341,6 +344,12 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
|
|||||||
dns_messagetextflag_t flags;
|
dns_messagetextflag_t flags;
|
||||||
isc_buffer_t *buf = NULL;
|
isc_buffer_t *buf = NULL;
|
||||||
unsigned int len = OUTPUTBUF;
|
unsigned int len = OUTPUTBUF;
|
||||||
|
const dns_master_style_t *style;
|
||||||
|
|
||||||
|
if (multiline)
|
||||||
|
style = &dns_master_style_default;
|
||||||
|
else
|
||||||
|
style = &dns_master_style_debug;
|
||||||
|
|
||||||
if (query->lookup->cmdline[0] != 0) {
|
if (query->lookup->cmdline[0] != 0) {
|
||||||
fputs(query->lookup->cmdline, stdout);
|
fputs(query->lookup->cmdline, stdout);
|
||||||
@@ -420,7 +429,7 @@ repopulate_buffer:
|
|||||||
{
|
{
|
||||||
result = dns_message_pseudosectiontotext(msg,
|
result = dns_message_pseudosectiontotext(msg,
|
||||||
DNS_PSEUDOSECTION_OPT,
|
DNS_PSEUDOSECTION_OPT,
|
||||||
flags, buf);
|
style, flags, buf);
|
||||||
if (result == ISC_R_NOSPACE) {
|
if (result == ISC_R_NOSPACE) {
|
||||||
buftoosmall:
|
buftoosmall:
|
||||||
len += OUTPUTBUF;
|
len += OUTPUTBUF;
|
||||||
@@ -439,7 +448,7 @@ buftoosmall:
|
|||||||
if (!short_form) {
|
if (!short_form) {
|
||||||
result = dns_message_sectiontotext(msg,
|
result = dns_message_sectiontotext(msg,
|
||||||
DNS_SECTION_QUESTION,
|
DNS_SECTION_QUESTION,
|
||||||
flags, buf);
|
style, flags, buf);
|
||||||
if (result == ISC_R_NOSPACE)
|
if (result == ISC_R_NOSPACE)
|
||||||
goto buftoosmall;
|
goto buftoosmall;
|
||||||
check_result(result, "dns_message_sectiontotext");
|
check_result(result, "dns_message_sectiontotext");
|
||||||
@@ -449,7 +458,7 @@ buftoosmall:
|
|||||||
if (!short_form) {
|
if (!short_form) {
|
||||||
result = dns_message_sectiontotext(msg,
|
result = dns_message_sectiontotext(msg,
|
||||||
DNS_SECTION_ANSWER,
|
DNS_SECTION_ANSWER,
|
||||||
flags, buf);
|
style, flags, buf);
|
||||||
if (result == ISC_R_NOSPACE)
|
if (result == ISC_R_NOSPACE)
|
||||||
goto buftoosmall;
|
goto buftoosmall;
|
||||||
check_result(result, "dns_message_sectiontotext");
|
check_result(result, "dns_message_sectiontotext");
|
||||||
@@ -464,7 +473,7 @@ buftoosmall:
|
|||||||
if (!short_form) {
|
if (!short_form) {
|
||||||
result = dns_message_sectiontotext(msg,
|
result = dns_message_sectiontotext(msg,
|
||||||
DNS_SECTION_AUTHORITY,
|
DNS_SECTION_AUTHORITY,
|
||||||
flags, buf);
|
style, flags, buf);
|
||||||
if (result == ISC_R_NOSPACE)
|
if (result == ISC_R_NOSPACE)
|
||||||
goto buftoosmall;
|
goto buftoosmall;
|
||||||
check_result(result, "dns_message_sectiontotext");
|
check_result(result, "dns_message_sectiontotext");
|
||||||
@@ -474,7 +483,7 @@ buftoosmall:
|
|||||||
if (!short_form) {
|
if (!short_form) {
|
||||||
result = dns_message_sectiontotext(msg,
|
result = dns_message_sectiontotext(msg,
|
||||||
DNS_SECTION_ADDITIONAL,
|
DNS_SECTION_ADDITIONAL,
|
||||||
flags, buf);
|
style, flags, buf);
|
||||||
if (result == ISC_R_NOSPACE)
|
if (result == ISC_R_NOSPACE)
|
||||||
goto buftoosmall;
|
goto buftoosmall;
|
||||||
check_result(result, "dns_message_sectiontotext");
|
check_result(result, "dns_message_sectiontotext");
|
||||||
@@ -485,7 +494,7 @@ buftoosmall:
|
|||||||
result = dns_message_pseudosectiontotext(
|
result = dns_message_pseudosectiontotext(
|
||||||
msg,
|
msg,
|
||||||
DNS_PSEUDOSECTION_TSIG,
|
DNS_PSEUDOSECTION_TSIG,
|
||||||
flags, buf);
|
style, flags, buf);
|
||||||
if (result == ISC_R_NOSPACE)
|
if (result == ISC_R_NOSPACE)
|
||||||
goto buftoosmall;
|
goto buftoosmall;
|
||||||
check_result(result,
|
check_result(result,
|
||||||
@@ -493,7 +502,7 @@ buftoosmall:
|
|||||||
result = dns_message_pseudosectiontotext(
|
result = dns_message_pseudosectiontotext(
|
||||||
msg,
|
msg,
|
||||||
DNS_PSEUDOSECTION_SIG0,
|
DNS_PSEUDOSECTION_SIG0,
|
||||||
flags, buf);
|
style, flags, buf);
|
||||||
if (result == ISC_R_NOSPACE)
|
if (result == ISC_R_NOSPACE)
|
||||||
goto buftoosmall;
|
goto buftoosmall;
|
||||||
check_result(result,
|
check_result(result,
|
||||||
@@ -731,6 +740,9 @@ plus_option(char *option, isc_boolean_t is_batchfile,
|
|||||||
lookup->ignore = ISC_TRUE;
|
lookup->ignore = ISC_TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'm': /* multiline */
|
||||||
|
multiline = state;
|
||||||
|
break;
|
||||||
case 'n':
|
case 'n':
|
||||||
switch (cmd[1]) {
|
switch (cmd[1]) {
|
||||||
case 'd': /* ndots */
|
case 'd': /* ndots */
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: nsupdate.c,v 1.84 2001/03/22 00:06:59 bwelling Exp $ */
|
/* $Id: nsupdate.c,v 1.85 2001/03/28 02:42:51 bwelling Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
@@ -48,6 +48,7 @@
|
|||||||
#include <dns/dispatch.h>
|
#include <dns/dispatch.h>
|
||||||
#include <dns/events.h>
|
#include <dns/events.h>
|
||||||
#include <dns/fixedname.h>
|
#include <dns/fixedname.h>
|
||||||
|
#include <dns/masterdump.h>
|
||||||
#include <dns/message.h>
|
#include <dns/message.h>
|
||||||
#include <dns/name.h>
|
#include <dns/name.h>
|
||||||
#include <dns/rdata.h>
|
#include <dns/rdata.h>
|
||||||
@@ -127,6 +128,7 @@ static isc_boolean_t shuttingdown = ISC_FALSE;
|
|||||||
static FILE *input;
|
static FILE *input;
|
||||||
static isc_boolean_t interactive = ISC_TRUE;
|
static isc_boolean_t interactive = ISC_TRUE;
|
||||||
static isc_boolean_t seenerror = ISC_FALSE;
|
static isc_boolean_t seenerror = ISC_FALSE;
|
||||||
|
static const dns_master_style_t *style = &dns_master_style_debug;
|
||||||
|
|
||||||
typedef struct nsu_requestinfo {
|
typedef struct nsu_requestinfo {
|
||||||
dns_message_t *msg;
|
dns_message_t *msg;
|
||||||
@@ -1209,7 +1211,7 @@ show_message(dns_message_t *msg) {
|
|||||||
isc_buffer_free(&buf);
|
isc_buffer_free(&buf);
|
||||||
result = isc_buffer_allocate(mctx, &buf, bufsz);
|
result = isc_buffer_allocate(mctx, &buf, bufsz);
|
||||||
check_result(result, "isc_buffer_allocate");
|
check_result(result, "isc_buffer_allocate");
|
||||||
result = dns_message_totext(msg, 0, buf);
|
result = dns_message_totext(msg, style, 0, buf);
|
||||||
bufsz *= 2;
|
bufsz *= 2;
|
||||||
} while (result == ISC_R_NOSPACE);
|
} while (result == ISC_R_NOSPACE);
|
||||||
if (result != ISC_R_SUCCESS) {
|
if (result != ISC_R_SUCCESS) {
|
||||||
@@ -1336,7 +1338,7 @@ update_completed(isc_task_t *task, isc_event_t *event) {
|
|||||||
isc_buffer_free(&buf);
|
isc_buffer_free(&buf);
|
||||||
result = isc_buffer_allocate(mctx, &buf, bufsz);
|
result = isc_buffer_allocate(mctx, &buf, bufsz);
|
||||||
check_result(result, "isc_buffer_allocate");
|
check_result(result, "isc_buffer_allocate");
|
||||||
result = dns_message_totext(rcvmsg, 0, buf);
|
result = dns_message_totext(rcvmsg, style, 0, buf);
|
||||||
bufsz *= 2;
|
bufsz *= 2;
|
||||||
} while (result == ISC_R_NOSPACE);
|
} while (result == ISC_R_NOSPACE);
|
||||||
check_result(result, "dns_message_totext");
|
check_result(result, "dns_message_totext");
|
||||||
@@ -1468,7 +1470,7 @@ recvsoa(isc_task_t *task, isc_event_t *event) {
|
|||||||
}
|
}
|
||||||
result = isc_buffer_allocate(mctx, &buf, bufsz);
|
result = isc_buffer_allocate(mctx, &buf, bufsz);
|
||||||
check_result(result, "isc_buffer_allocate");
|
check_result(result, "isc_buffer_allocate");
|
||||||
result = dns_message_totext(rcvmsg, 0, buf);
|
result = dns_message_totext(rcvmsg, style, 0, buf);
|
||||||
} while (result == ISC_R_NOSPACE);
|
} while (result == ISC_R_NOSPACE);
|
||||||
check_result(result, "dns_message_totext");
|
check_result(result, "dns_message_totext");
|
||||||
fprintf(stderr, "Reply from SOA query:\n%.*s\n",
|
fprintf(stderr, "Reply from SOA query:\n%.*s\n",
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: sig0_test.c,v 1.7 2001/03/13 02:48:53 bwelling Exp $ */
|
/* $Id: sig0_test.c,v 1.8 2001/03/28 02:42:53 bwelling Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
@@ -42,6 +42,7 @@
|
|||||||
#include <dns/events.h>
|
#include <dns/events.h>
|
||||||
#include <dns/fixedname.h>
|
#include <dns/fixedname.h>
|
||||||
#include <dns/keyvalues.h>
|
#include <dns/keyvalues.h>
|
||||||
|
#include <dns/masterdump.h>
|
||||||
#include <dns/message.h>
|
#include <dns/message.h>
|
||||||
#include <dns/name.h>
|
#include <dns/name.h>
|
||||||
#include <dns/rdataset.h>
|
#include <dns/rdataset.h>
|
||||||
@@ -73,6 +74,7 @@ isc_socket_t *s;
|
|||||||
isc_sockaddr_t address;
|
isc_sockaddr_t address;
|
||||||
char output[10 * 1024];
|
char output[10 * 1024];
|
||||||
isc_buffer_t outbuf;
|
isc_buffer_t outbuf;
|
||||||
|
static const dns_master_style_t *style = &dns_master_style_debug;
|
||||||
|
|
||||||
static void
|
static void
|
||||||
senddone(isc_task_t *task, isc_event_t *event) {
|
senddone(isc_task_t *task, isc_event_t *event) {
|
||||||
@@ -114,7 +116,7 @@ recvdone(isc_task_t *task, isc_event_t *event) {
|
|||||||
CHECK("dns_message_parse", result);
|
CHECK("dns_message_parse", result);
|
||||||
|
|
||||||
isc_buffer_init(&outbuf, output, sizeof(output));
|
isc_buffer_init(&outbuf, output, sizeof(output));
|
||||||
result = dns_message_totext(response, 0, &outbuf);
|
result = dns_message_totext(response, style, 0, &outbuf);
|
||||||
CHECK("dns_message_totext", result);
|
CHECK("dns_message_totext", result);
|
||||||
printf("%.*s\n", (int)isc_buffer_usedlength(&outbuf),
|
printf("%.*s\n", (int)isc_buffer_usedlength(&outbuf),
|
||||||
(char *)isc_buffer_base(&outbuf));
|
(char *)isc_buffer_base(&outbuf));
|
||||||
@@ -180,7 +182,7 @@ buildquery(void) {
|
|||||||
dns_compress_invalidate(&cctx);
|
dns_compress_invalidate(&cctx);
|
||||||
|
|
||||||
isc_buffer_init(&outbuf, output, sizeof(output));
|
isc_buffer_init(&outbuf, output, sizeof(output));
|
||||||
result = dns_message_totext(query, 0, &outbuf);
|
result = dns_message_totext(query, style, 0, &outbuf);
|
||||||
CHECK("dns_message_totext", result);
|
CHECK("dns_message_totext", result);
|
||||||
printf("%.*s\n", (int)isc_buffer_usedlength(&outbuf),
|
printf("%.*s\n", (int)isc_buffer_usedlength(&outbuf),
|
||||||
(char *)isc_buffer_base(&outbuf));
|
(char *)isc_buffer_base(&outbuf));
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: message.h,v 1.96 2001/03/28 00:50:00 gson Exp $ */
|
/* $Id: message.h,v 1.97 2001/03/28 02:42:56 bwelling Exp $ */
|
||||||
|
|
||||||
#ifndef DNS_MESSAGE_H
|
#ifndef DNS_MESSAGE_H
|
||||||
#define DNS_MESSAGE_H 1
|
#define DNS_MESSAGE_H 1
|
||||||
@@ -28,6 +28,7 @@
|
|||||||
#include <isc/magic.h>
|
#include <isc/magic.h>
|
||||||
|
|
||||||
#include <dns/compress.h>
|
#include <dns/compress.h>
|
||||||
|
#include <dns/masterdump.h>
|
||||||
#include <dns/types.h>
|
#include <dns/types.h>
|
||||||
|
|
||||||
#include <dst/dst.h>
|
#include <dst/dst.h>
|
||||||
@@ -296,12 +297,14 @@ dns_message_destroy(dns_message_t **msgp);
|
|||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
dns_message_sectiontotext(dns_message_t *msg, dns_section_t section,
|
dns_message_sectiontotext(dns_message_t *msg, dns_section_t section,
|
||||||
|
const dns_master_style_t *style,
|
||||||
dns_messagetextflag_t flags,
|
dns_messagetextflag_t flags,
|
||||||
isc_buffer_t *target);
|
isc_buffer_t *target);
|
||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
dns_message_pseudosectiontotext(dns_message_t *msg,
|
dns_message_pseudosectiontotext(dns_message_t *msg,
|
||||||
dns_pseudosection_t section,
|
dns_pseudosection_t section,
|
||||||
|
const dns_master_style_t *style,
|
||||||
dns_messagetextflag_t flags,
|
dns_messagetextflag_t flags,
|
||||||
isc_buffer_t *target);
|
isc_buffer_t *target);
|
||||||
/*
|
/*
|
||||||
@@ -315,6 +318,8 @@ dns_message_pseudosectiontotext(dns_message_t *msg,
|
|||||||
*
|
*
|
||||||
* 'msg' is a valid message.
|
* 'msg' is a valid message.
|
||||||
*
|
*
|
||||||
|
* 'style' is a valid master dump style.
|
||||||
|
*
|
||||||
* 'target' is a valid buffer.
|
* 'target' is a valid buffer.
|
||||||
*
|
*
|
||||||
* 'section' is a valid section label.
|
* 'section' is a valid section label.
|
||||||
@@ -335,8 +340,8 @@ dns_message_pseudosectiontotext(dns_message_t *msg,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
dns_message_totext(dns_message_t *msg, dns_messagetextflag_t flags,
|
dns_message_totext(dns_message_t *msg, const dns_master_style_t *style,
|
||||||
isc_buffer_t *target);
|
dns_messagetextflag_t flags, isc_buffer_t *target);
|
||||||
/*
|
/*
|
||||||
* Convert all sections of message 'msg' to a cleartext representation
|
* Convert all sections of message 'msg' to a cleartext representation
|
||||||
*
|
*
|
||||||
@@ -352,6 +357,8 @@ dns_message_totext(dns_message_t *msg, dns_messagetextflag_t flags,
|
|||||||
*
|
*
|
||||||
* 'msg' is a valid message.
|
* 'msg' is a valid message.
|
||||||
*
|
*
|
||||||
|
* 'style' is a valid master dump style.
|
||||||
|
*
|
||||||
* 'target' is a valid buffer.
|
* 'target' is a valid buffer.
|
||||||
*
|
*
|
||||||
* Ensures:
|
* Ensures:
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: message.c,v 1.188 2001/03/28 00:58:13 gson Exp $ */
|
/* $Id: message.c,v 1.189 2001/03/28 02:42:54 bwelling Exp $ */
|
||||||
|
|
||||||
/***
|
/***
|
||||||
*** Imports
|
*** Imports
|
||||||
@@ -2803,6 +2803,7 @@ dns_message_checksig(dns_message_t *msg, dns_view_t *view) {
|
|||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
dns_message_sectiontotext(dns_message_t *msg, dns_section_t section,
|
dns_message_sectiontotext(dns_message_t *msg, dns_section_t section,
|
||||||
|
const dns_master_style_t *style,
|
||||||
dns_messagetextflag_t flags,
|
dns_messagetextflag_t flags,
|
||||||
isc_buffer_t *target) {
|
isc_buffer_t *target) {
|
||||||
dns_name_t *name, empty_name;
|
dns_name_t *name, empty_name;
|
||||||
@@ -2842,12 +2843,12 @@ dns_message_sectiontotext(dns_message_t *msg, dns_section_t section,
|
|||||||
ADD_STRING(target, ";");
|
ADD_STRING(target, ";");
|
||||||
result = dns_master_questiontotext(name,
|
result = dns_master_questiontotext(name,
|
||||||
rdataset,
|
rdataset,
|
||||||
&dns_master_style_debug,
|
style,
|
||||||
target);
|
target);
|
||||||
} else {
|
} else {
|
||||||
result = dns_master_rdatasettotext(name,
|
result = dns_master_rdatasettotext(name,
|
||||||
rdataset,
|
rdataset,
|
||||||
&dns_master_style_debug,
|
style,
|
||||||
target);
|
target);
|
||||||
}
|
}
|
||||||
if (result != ISC_R_SUCCESS)
|
if (result != ISC_R_SUCCESS)
|
||||||
@@ -2866,6 +2867,7 @@ dns_message_sectiontotext(dns_message_t *msg, dns_section_t section,
|
|||||||
isc_result_t
|
isc_result_t
|
||||||
dns_message_pseudosectiontotext(dns_message_t *msg,
|
dns_message_pseudosectiontotext(dns_message_t *msg,
|
||||||
dns_pseudosection_t section,
|
dns_pseudosection_t section,
|
||||||
|
const dns_master_style_t *style,
|
||||||
dns_messagetextflag_t flags,
|
dns_messagetextflag_t flags,
|
||||||
isc_buffer_t *target) {
|
isc_buffer_t *target) {
|
||||||
dns_rdataset_t *ps = NULL;
|
dns_rdataset_t *ps = NULL;
|
||||||
@@ -2907,9 +2909,7 @@ dns_message_pseudosectiontotext(dns_message_t *msg,
|
|||||||
return (ISC_R_SUCCESS);
|
return (ISC_R_SUCCESS);
|
||||||
if ((flags & DNS_MESSAGETEXTFLAG_NOCOMMENTS) == 0)
|
if ((flags & DNS_MESSAGETEXTFLAG_NOCOMMENTS) == 0)
|
||||||
ADD_STRING(target, ";; TSIG PSEUDOSECTION:\n");
|
ADD_STRING(target, ";; TSIG PSEUDOSECTION:\n");
|
||||||
result = dns_master_rdatasettotext(name, ps,
|
result = dns_master_rdatasettotext(name, ps, style, target);
|
||||||
&dns_master_style_debug,
|
|
||||||
target);
|
|
||||||
if ((flags & DNS_MESSAGETEXTFLAG_NOHEADERS) == 0 &&
|
if ((flags & DNS_MESSAGETEXTFLAG_NOHEADERS) == 0 &&
|
||||||
(flags & DNS_MESSAGETEXTFLAG_NOCOMMENTS) == 0)
|
(flags & DNS_MESSAGETEXTFLAG_NOCOMMENTS) == 0)
|
||||||
ADD_STRING(target, "\n");
|
ADD_STRING(target, "\n");
|
||||||
@@ -2920,9 +2920,7 @@ dns_message_pseudosectiontotext(dns_message_t *msg,
|
|||||||
return (ISC_R_SUCCESS);
|
return (ISC_R_SUCCESS);
|
||||||
if ((flags & DNS_MESSAGETEXTFLAG_NOCOMMENTS) == 0)
|
if ((flags & DNS_MESSAGETEXTFLAG_NOCOMMENTS) == 0)
|
||||||
ADD_STRING(target, ";; SIG0 PSEUDOSECTION:\n");
|
ADD_STRING(target, ";; SIG0 PSEUDOSECTION:\n");
|
||||||
result = dns_master_rdatasettotext(name, ps,
|
result = dns_master_rdatasettotext(name, ps, style, target);
|
||||||
&dns_master_style_debug,
|
|
||||||
target);
|
|
||||||
if ((flags & DNS_MESSAGETEXTFLAG_NOHEADERS) == 0 &&
|
if ((flags & DNS_MESSAGETEXTFLAG_NOHEADERS) == 0 &&
|
||||||
(flags & DNS_MESSAGETEXTFLAG_NOCOMMENTS) == 0)
|
(flags & DNS_MESSAGETEXTFLAG_NOCOMMENTS) == 0)
|
||||||
ADD_STRING(target, "\n");
|
ADD_STRING(target, "\n");
|
||||||
@@ -2932,8 +2930,8 @@ dns_message_pseudosectiontotext(dns_message_t *msg,
|
|||||||
}
|
}
|
||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
dns_message_totext(dns_message_t *msg, dns_messagetextflag_t flags,
|
dns_message_totext(dns_message_t *msg, const dns_master_style_t *style,
|
||||||
isc_buffer_t *target) {
|
dns_messagetextflag_t flags, isc_buffer_t *target) {
|
||||||
char buf[sizeof "1234567890"];
|
char buf[sizeof "1234567890"];
|
||||||
isc_result_t result;
|
isc_result_t result;
|
||||||
|
|
||||||
@@ -2991,36 +2989,36 @@ dns_message_totext(dns_message_t *msg, dns_messagetextflag_t flags,
|
|||||||
}
|
}
|
||||||
result = dns_message_pseudosectiontotext(msg,
|
result = dns_message_pseudosectiontotext(msg,
|
||||||
DNS_PSEUDOSECTION_OPT,
|
DNS_PSEUDOSECTION_OPT,
|
||||||
flags, target);
|
style, flags, target);
|
||||||
if (result != ISC_R_SUCCESS)
|
if (result != ISC_R_SUCCESS)
|
||||||
return (result);
|
return (result);
|
||||||
|
|
||||||
result = dns_message_sectiontotext(msg, DNS_SECTION_QUESTION,
|
result = dns_message_sectiontotext(msg, DNS_SECTION_QUESTION,
|
||||||
flags, target);
|
style, flags, target);
|
||||||
if (result != ISC_R_SUCCESS)
|
if (result != ISC_R_SUCCESS)
|
||||||
return (result);
|
return (result);
|
||||||
result = dns_message_sectiontotext(msg, DNS_SECTION_ANSWER,
|
result = dns_message_sectiontotext(msg, DNS_SECTION_ANSWER,
|
||||||
flags, target);
|
style, flags, target);
|
||||||
if (result != ISC_R_SUCCESS)
|
if (result != ISC_R_SUCCESS)
|
||||||
return (result);
|
return (result);
|
||||||
result = dns_message_sectiontotext(msg, DNS_SECTION_AUTHORITY,
|
result = dns_message_sectiontotext(msg, DNS_SECTION_AUTHORITY,
|
||||||
flags, target);
|
style, flags, target);
|
||||||
if (result != ISC_R_SUCCESS)
|
if (result != ISC_R_SUCCESS)
|
||||||
return (result);
|
return (result);
|
||||||
result = dns_message_sectiontotext(msg, DNS_SECTION_ADDITIONAL,
|
result = dns_message_sectiontotext(msg, DNS_SECTION_ADDITIONAL,
|
||||||
flags, target);
|
style, flags, target);
|
||||||
if (result != ISC_R_SUCCESS)
|
if (result != ISC_R_SUCCESS)
|
||||||
return (result);
|
return (result);
|
||||||
|
|
||||||
result = dns_message_pseudosectiontotext(msg,
|
result = dns_message_pseudosectiontotext(msg,
|
||||||
DNS_PSEUDOSECTION_TSIG,
|
DNS_PSEUDOSECTION_TSIG,
|
||||||
flags, target);
|
style, flags, target);
|
||||||
if (result != ISC_R_SUCCESS)
|
if (result != ISC_R_SUCCESS)
|
||||||
return (result);
|
return (result);
|
||||||
|
|
||||||
result = dns_message_pseudosectiontotext(msg,
|
result = dns_message_pseudosectiontotext(msg,
|
||||||
DNS_PSEUDOSECTION_SIG0,
|
DNS_PSEUDOSECTION_SIG0,
|
||||||
flags, target);
|
style, flags, target);
|
||||||
if (result != ISC_R_SUCCESS)
|
if (result != ISC_R_SUCCESS)
|
||||||
return (result);
|
return (result);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user