mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-08 20:52:05 -04:00
new functions dns_master_rdatasettotext() and dns_master_questiontotext(),
replacing dns_rdataset_totext()
This commit is contained in:
parent
566cc190fa
commit
421551db8a
3 changed files with 77 additions and 17 deletions
|
|
@ -15,7 +15,7 @@
|
|||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: masterdump.h,v 1.18 2001/01/12 19:58:51 bwelling Exp $ */
|
||||
/* $Id: masterdump.h,v 1.19 2001/03/28 00:22:15 gson Exp $ */
|
||||
|
||||
#ifndef DNS_MASTERDUMP_H
|
||||
#define DNS_MASTERDUMP_H 1
|
||||
|
|
@ -119,6 +119,44 @@ dns_master_dump(isc_mem_t *mctx, dns_db_t *db,
|
|||
* Any dns_rdata_totext() error code.
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
dns_master_rdatasettotext(dns_name_t *owner_name,
|
||||
dns_rdataset_t *rdataset,
|
||||
const dns_master_style_t *style,
|
||||
isc_buffer_t *target);
|
||||
/*
|
||||
* Convert 'rdataset' to text format, storing the result in 'target'.
|
||||
*
|
||||
* Notes:
|
||||
* The rdata cursor position will be changed.
|
||||
*
|
||||
* Requires:
|
||||
* 'rdataset' is a valid non-question rdataset.
|
||||
*
|
||||
* 'rdataset' is not empty.
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
dns_master_questiontotext(dns_name_t *owner_name,
|
||||
dns_rdataset_t *rdataset,
|
||||
isc_buffer_t *target);
|
||||
/*
|
||||
* Print a text representation of 'rdataset', a pseudo-rdataset
|
||||
* representing a questino.
|
||||
*
|
||||
* Requires:
|
||||
* 'rdataset' is a valid question rdataset.
|
||||
*
|
||||
* 'rdataset' is not empty.
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
dns_rdataset_towire(dns_rdataset_t *rdataset,
|
||||
dns_name_t *owner_name,
|
||||
dns_compress_t *cctx,
|
||||
isc_buffer_t *target,
|
||||
unsigned int *countp);
|
||||
|
||||
isc_result_t
|
||||
dns_master_dumpnodetostream(isc_mem_t *mctx, dns_db_t *db,
|
||||
dns_dbversion_t *version,
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: rdataset.h,v 1.38 2001/01/09 21:53:17 bwelling Exp $ */
|
||||
/* $Id: rdataset.h,v 1.39 2001/03/28 00:22:16 gson Exp $ */
|
||||
|
||||
#ifndef DNS_RDATASET_H
|
||||
#define DNS_RDATASET_H 1
|
||||
|
|
@ -278,7 +278,7 @@ isc_result_t
|
|||
dns_rdataset_totext(dns_rdataset_t *rdataset,
|
||||
dns_name_t *owner_name,
|
||||
isc_boolean_t omit_final_dot,
|
||||
isc_boolean_t no_rdata_or_ttl,
|
||||
isc_boolean_t question,
|
||||
isc_buffer_t *target);
|
||||
/*
|
||||
* Convert 'rdataset' to text format, storing the result in 'target'.
|
||||
|
|
@ -286,18 +286,17 @@ dns_rdataset_totext(dns_rdataset_t *rdataset,
|
|||
* Notes:
|
||||
* The rdata cursor position will be changed.
|
||||
*
|
||||
* The no_rdata_or_ttl should normally be ISC_FALSE. If it is ISC_TRUE
|
||||
* the ttl and rdata fields are not printed. This is mainly for use
|
||||
* in the question section.
|
||||
* The 'question' flag should normally be ISC_FALSE. If it is
|
||||
* ISC_TRUE, the TTL and rdata fields are not printed. This is
|
||||
* for use when printing an rdata representing a question section.
|
||||
*
|
||||
* XXX may need to add 'origin' parameter if we go with that in rdata.
|
||||
* This interface is deprecated; use dns_master_rdatasettottext()
|
||||
* and/or dns_master_questiontotext() instead.
|
||||
*
|
||||
* Requires:
|
||||
* 'rdataset' is a valid rdataset.
|
||||
*
|
||||
* 'rdataset' is not empty.
|
||||
*
|
||||
* XXX Supply more Requires and Ensures XXX
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: masterdump.c,v 1.45 2001/03/07 22:30:21 gson Exp $ */
|
||||
/* $Id: masterdump.c,v 1.46 2001/03/28 00:22:13 gson Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
|
|
@ -526,16 +526,11 @@ question_totext(dns_rdataset_t *rdataset,
|
|||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
|
||||
/*
|
||||
* Provide a backwards compatible interface for printing a
|
||||
* single rdataset or question section. This is now used
|
||||
* only by wire_test.c.
|
||||
*/
|
||||
isc_result_t
|
||||
dns_rdataset_totext(dns_rdataset_t *rdataset,
|
||||
dns_name_t *owner_name,
|
||||
isc_boolean_t omit_final_dot,
|
||||
isc_boolean_t no_rdata_or_ttl,
|
||||
isc_boolean_t question,
|
||||
isc_buffer_t *target)
|
||||
{
|
||||
dns_totext_ctx_t ctx;
|
||||
|
|
@ -556,7 +551,7 @@ dns_rdataset_totext(dns_rdataset_t *rdataset,
|
|||
if (dns_name_countlabels(owner_name) == 0)
|
||||
owner_name = NULL;
|
||||
|
||||
if (no_rdata_or_ttl)
|
||||
if (question)
|
||||
return (question_totext(rdataset, owner_name, &ctx,
|
||||
omit_final_dot, target));
|
||||
else
|
||||
|
|
@ -564,6 +559,34 @@ dns_rdataset_totext(dns_rdataset_t *rdataset,
|
|||
omit_final_dot, target));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_master_rdatasettotext(dns_name_t *owner_name,
|
||||
dns_rdataset_t *rdataset,
|
||||
const dns_master_style_t *style,
|
||||
isc_buffer_t *target)
|
||||
{
|
||||
dns_totext_ctx_t ctx;
|
||||
isc_result_t result;
|
||||
result = totext_ctx_init(style, &ctx);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
UNEXPECTED_ERROR(__FILE__, __LINE__,
|
||||
"could not set master file style");
|
||||
return (ISC_R_UNEXPECTED);
|
||||
}
|
||||
|
||||
return (rdataset_totext(rdataset, owner_name, &ctx,
|
||||
ISC_FALSE, target));
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns_master_questiontotext(dns_name_t *owner_name,
|
||||
dns_rdataset_t *rdataset,
|
||||
isc_buffer_t *target)
|
||||
{
|
||||
return (question_totext(rdataset, owner_name, NULL,
|
||||
ISC_FALSE, target));
|
||||
}
|
||||
|
||||
/*
|
||||
* Print an rdataset. 'buffer' is a scratch buffer, which must have been
|
||||
* dynamically allocated by the caller. It must be large enough to
|
||||
|
|
|
|||
Loading…
Reference in a new issue