Commit 435abcf2 authored by Bob Halley's avatar Bob Halley

add dns_message_renderreset()

parent 4777bac4
......@@ -450,6 +450,20 @@ dns_message_renderend(dns_message_t *msg);
* DNS_R_SUCCESS -- all is well.
*/
void
dns_message_renderreset(dns_message_t *msg);
/*
* Reset the message so that it may be rendered again.
*
* Notes:
*
* If dns_message_renderbegin() has been called, dns_message_renderend()
* must be called before calling this function.
*
* Requires:
*
* 'msg' be a valid message with rendering intent.
*/
isc_result_t
dns_message_firstname(dns_message_t *msg, dns_section_t section);
......
......@@ -1684,6 +1684,35 @@ dns_message_renderend(dns_message_t *msg)
return (DNS_R_SUCCESS);
}
void
dns_message_renderreset(dns_message_t *msg)
{
unsigned int i;
dns_name_t *name;
dns_rdataset_t *rds;
/*
* Reset the message so that it may be rendered again.
*/
REQUIRE(DNS_MESSAGE_VALID(msg));
REQUIRE(msg->from_to_wire == DNS_MESSAGE_INTENTRENDER);
for (i = 0; i < DNS_SECTION_MAX; i++) {
msg->cursors[i] = NULL;
msg->counts[i] = 0;
for (name = ISC_LIST_HEAD(msg->sections[i]);
name != NULL;
name = ISC_LIST_NEXT(name, link)) {
for (rds = ISC_LIST_HEAD(name->list);
rds != NULL;
rds = ISC_LIST_NEXT(rds, link)) {
rds->attributes &= ~DNS_RDATASETATTR_RENDERED;
}
}
}
}
isc_result_t
dns_message_firstname(dns_message_t *msg, dns_section_t section)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment