bind/bind-9.9.9-P3/lib/dns/masterdump.c
/*
 * Print the name, type, and class of an empty rdataset,
 * such as those used to represent the question section
 * of a DNS message.
 */
Print the name, type, and class of an empty rdataset,
such as those used to represent the question section
of a DNS message.
Print the name type and class of an empty rdataset such as those used to represent the question section of a DNS message .
static isc_result_t
question_totext(dns_rdataset_t *rdataset,
		dns_name_t *owner_name,
		dns_totext_ctx_t *ctx,
		isc_boolean_t omit_final_dot,
		isc_buffer_t *target)
{
	unsigned int column;
	isc_result_t result;
	isc_region_t r;
	REQUIRE(DNS_RDATASET_VALID(rdataset));
	result = dns_rdataset_first(rdataset);
	REQUIRE(result == ISC_R_NOMORE);
	column = 0;
	{
		unsigned int name_start = target->used;
		RETERR(dns_name_totext(owner_name,
				       omit_final_dot,
				       target));
		column += target->used - name_start;
	}
	{
		unsigned int class_start;
		INDENT_TO(class_column);
		class_start = target->used;
		result = dns_rdataclass_totext(rdataset->rdclass, target);
		if (result != ISC_R_SUCCESS)
			return (result);
		column += (target->used - class_start);
	}
	{
		unsigned int type_start;
		INDENT_TO(type_column);
		type_start = target->used;
		result = dns_rdatatype_totext(rdataset->type, target);
		if (result != ISC_R_SUCCESS)
			return (result);
		column += (target->used - type_start);
	}
	isc_buffer_availableregion(target, &r);
	if (r.length < 1)
		return (ISC_R_NOSPACE);
	r.base[0] = '\n';
	isc_buffer_add(target, 1);
	return (ISC_R_SUCCESS);
}
static isc_result_t question_totext ( dns_rdataset_t * rdataset , dns_name_t * owner_name , dns_totext_ctx_t * ctx , isc_boolean_t omit_final_dot , isc_buffer_t * target ) { unsigned int column ; isc_result_t result ; isc_region_t r ; REQUIRE ( DNS_RDATASET_VALID ( rdataset ) ) ; result = dns_rdataset_first ( rdataset ) ; REQUIRE ( result == ISC_R_NOMORE ) ; column = 0 ; { unsigned int name_start = target -> used ; RETERR ( dns_name_totext ( owner_name , omit_final_dot , target ) ) ; column += target -> used - name_start ; } { unsigned int class_start ; INDENT_TO ( class_column ) ; class_start = target -> used ; result = dns_rdataclass_totext ( rdataset -> rdclass , target ) ; if ( result != ISC_R_SUCCESS ) return ( result ) ; column += ( target -> used - class_start ) ; } { unsigned int type_start ; INDENT_TO ( type_column ) ; type_start = target -> used ; result = dns_rdatatype_totext ( rdataset -> type , target ) ; if ( result != ISC_R_SUCCESS ) return ( result ) ; column += ( target -> used - type_start ) ; } isc_buffer_availableregion ( target , & r ) ; if ( r . length < 1 ) return ( ISC_R_NOSPACE ) ; r . base [ 0 ] = ' \n ' ; isc_buffer_add ( target , 1 ) ; return ( ISC_R_SUCCESS ) ; }
Print the name, type, and class of an empty rdataset,
 such as those used to represent the question section
 of a DNS message.
Print the name type and class of an empty rdataset such as those used to represent the question section of a DNS message .
/* Owner name */ /* Class */ /* Type */