use dns_master_rdatasettotext() &co; removed unused flag

DNS_MESSAGETEXTFLAG_OMITDOT
This commit is contained in:
Andreas Gustafsson
2001-03-28 00:50:05 +00:00
parent 421551db8a
commit 531eafa302
5 changed files with 29 additions and 32 deletions

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: masterdump.h,v 1.19 2001/03/28 00:22:15 gson Exp $ */
/* $Id: masterdump.h,v 1.20 2001/03/28 00:50:01 gson Exp $ */
#ifndef DNS_MASTERDUMP_H
#define DNS_MASTERDUMP_H 1
@@ -79,6 +79,11 @@ extern const dns_master_style_t dns_master_style_cache;
*/
extern const dns_master_style_t dns_master_style_simple;
/*
* The style used for debugging, "dig" output, etc.
*/
extern const dns_master_style_t dns_master_style_debug;
/***
*** Functions
***/

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: message.h,v 1.95 2001/03/05 21:15:47 bwelling Exp $ */
/* $Id: message.h,v 1.96 2001/03/28 00:50:00 gson Exp $ */
#ifndef DNS_MESSAGE_H
#define DNS_MESSAGE_H 1
@@ -127,7 +127,6 @@ typedef int dns_pseudosection_t;
typedef int dns_messagetextflag_t;
#define DNS_MESSAGETEXTFLAG_NOCOMMENTS 0x0001
#define DNS_MESSAGETEXTFLAG_NOHEADERS 0x0002
#define DNS_MESSAGETEXTFLAG_OMITDOT 0x0004
/*
* Dynamic update names for these sections.

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: masterdump.c,v 1.46 2001/03/28 00:22:13 gson Exp $ */
/* $Id: masterdump.c,v 1.47 2001/03/28 00:50:04 gson Exp $ */
#include <config.h>
@@ -165,7 +165,7 @@ dns_master_style_simple = {
/*
* A style suitable for dns_rdataset_totext().
*/
dns_master_style_t
const dns_master_style_t
dns_masterfile_style_debug = {
DNS_STYLEFLAG_REL_OWNER,
24, 32, 40, 48, 80, 8

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: message.c,v 1.186 2001/03/15 03:00:50 bwelling Exp $ */
/* $Id: message.c,v 1.187 2001/03/28 00:50:05 gson Exp $ */
/***
*** Imports
@@ -31,6 +31,7 @@
#include <dns/dnssec.h>
#include <dns/keyvalues.h>
#include <dns/log.h>
#include <dns/masterdump.h>
#include <dns/message.h>
#ifdef DNS_OPT_NEWCODES
#include <dns/opt.h>
@@ -2807,23 +2808,14 @@ dns_message_sectiontotext(dns_message_t *msg, dns_section_t section,
dns_name_t *name, empty_name;
dns_rdataset_t *rdataset;
isc_result_t result;
isc_boolean_t no_rdata;
isc_boolean_t omit_final_dot;
REQUIRE(DNS_MESSAGE_VALID(msg));
REQUIRE(target != NULL);
REQUIRE(VALID_SECTION(section));
omit_final_dot = ISC_TF((flags & DNS_MESSAGETEXTFLAG_OMITDOT) != 0);
if (ISC_LIST_EMPTY(msg->sections[section]))
return (ISC_R_SUCCESS);
if (section == DNS_SECTION_QUESTION)
no_rdata = ISC_TRUE;
else
no_rdata = ISC_FALSE;
if ((flags & DNS_MESSAGETEXTFLAG_NOCOMMENTS) == 0) {
ADD_STRING(target, ";; ");
if (msg->opcode != dns_opcode_update) {
@@ -2846,12 +2838,17 @@ dns_message_sectiontotext(dns_message_t *msg, dns_section_t section,
for (rdataset = ISC_LIST_HEAD(name->list);
rdataset != NULL;
rdataset = ISC_LIST_NEXT(rdataset, link)) {
if (no_rdata)
if (section == DNS_SECTION_QUESTION) {
ADD_STRING(target, ";");
result = dns_rdataset_totext(rdataset, name,
omit_final_dot,
no_rdata,
target);
result = dns_master_questiontotext(name,
rdataset,
target);
} else {
result = dns_master_rdatasettotext(name,
rdataset,
&dns_master_style_debug,
target);
}
if (result != ISC_R_SUCCESS)
return (result);
}
@@ -2873,7 +2870,6 @@ dns_message_pseudosectiontotext(dns_message_t *msg,
dns_rdataset_t *ps = NULL;
dns_name_t *name = NULL;
isc_result_t result;
isc_boolean_t omit_final_dot;
#ifndef DNS_OPT_NEWCODES
char buf[sizeof("1234567890")];
#endif /* DNS_OPT_NEWCODES */
@@ -2882,8 +2878,6 @@ dns_message_pseudosectiontotext(dns_message_t *msg,
REQUIRE(target != NULL);
REQUIRE(VALID_PSEUDOSECTION(section));
omit_final_dot = ISC_TF((flags & DNS_MESSAGETEXTFLAG_OMITDOT) != 0);
switch (section) {
case DNS_PSEUDOSECTION_OPT:
ps = dns_message_getopt(msg);
@@ -2912,8 +2906,9 @@ dns_message_pseudosectiontotext(dns_message_t *msg,
return (ISC_R_SUCCESS);
if ((flags & DNS_MESSAGETEXTFLAG_NOCOMMENTS) == 0)
ADD_STRING(target, ";; TSIG PSEUDOSECTION:\n");
result = dns_rdataset_totext(ps, name, omit_final_dot,
ISC_FALSE, target);
result = dns_master_rdatasettotext(name, ps,
&dns_master_style_debug,
target);
if ((flags & DNS_MESSAGETEXTFLAG_NOHEADERS) == 0 &&
(flags & DNS_MESSAGETEXTFLAG_NOCOMMENTS) == 0)
ADD_STRING(target, "\n");
@@ -2924,8 +2919,9 @@ dns_message_pseudosectiontotext(dns_message_t *msg,
return (ISC_R_SUCCESS);
if ((flags & DNS_MESSAGETEXTFLAG_NOCOMMENTS) == 0)
ADD_STRING(target, ";; SIG0 PSEUDOSECTION:\n");
result = dns_rdataset_totext(ps, name, omit_final_dot,
ISC_FALSE, target);
result = dns_master_rdatasettotext(name, ps,
&dns_master_style_debug,
target);
if ((flags & DNS_MESSAGETEXTFLAG_NOHEADERS) == 0 &&
(flags & DNS_MESSAGETEXTFLAG_NOCOMMENTS) == 0)
ADD_STRING(target, "\n");

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: opt.c,v 1.12 2001/01/09 21:51:11 bwelling Exp $ */
/* $Id: opt.c,v 1.13 2001/03/28 00:50:02 gson Exp $ */
/* DNS_OPT_NEWCODES_KEEP */
@@ -154,13 +154,10 @@ dns_opt_attrtotext(dns_optattr_t *attr, isc_buffer_t *target,
isc_result_t result = ISC_R_SUCCESS;
char store[sizeof("012345678")];
#ifdef DNS_OPT_NEWCODES
isc_boolean_t omit_final_dot;
dns_decompress_t dctx;
dns_fixedname_t fname;
isc_buffer_t source;
omit_final_dot = ISC_TF((flags & DNS_MESSAGETEXTFLAG_OMITDOT) != 0);
#else /* DNS_OPT_NEWCODES */
UNUSED (flags);
#endif /* DNS_OPT_NEWCODES */
@@ -178,7 +175,7 @@ dns_opt_attrtotext(dns_optattr_t *attr, isc_buffer_t *target,
ISC_FALSE, NULL);
if (result != ISC_R_SUCCESS)
goto zonefail1;
result = dns_name_totext(&fname.name, omit_final_dot,
result = dns_name_totext(&fname.name, ISC_FALSE,
target);
ADD_STRING(target, "\n", zonefail1);
zonefail1: