Commit ded7456a authored by Michael Graff's avatar Michael Graff

Implement searching for a name in a section.

parent 4756105b
......@@ -145,8 +145,8 @@ dns_message_create(isc_mem_t *mctx, dns_message_t **msg, unsigned int intent);
* structure.
*
* Returns:
* DNS_R_NOMEMORY - out of memory
* DNS_R_SUCCESS - success
* DNS_R_NOMEMORY -- out of memory
* DNS_R_SUCCESS -- success
*/
void
......@@ -245,9 +245,8 @@ dns_message_renderchangebuffer(dns_message_t *msg, isc_buffer_t *buffer);
*
* Returns:
*
* DNS_R_NOSPACE - new buffer is too small
*
* DNS_R_SUCCESS - all is well.
* DNS_R_NOSPACE -- new buffer is too small
* DNS_R_SUCCESS -- all is well.
*/
dns_result_t
......
......@@ -1155,6 +1155,8 @@ dns_message_findname(dns_message_t *msg, dns_section_t section,
dns_name_t *target, dns_rdatatype_t type,
dns_name_t **name, dns_rdataset_t **rdataset)
{
dns_name_t *foundname;
dns_result_t result;
/*
* XXX These requirements are probably too intensive, especially
......@@ -1174,8 +1176,24 @@ dns_message_findname(dns_message_t *msg, dns_section_t section,
REQUIRE(*rdataset == NULL);
}
return (ISC_R_NOTIMPLEMENTED);
/* XXX implement */
/*
* Search through, looking for the name.
*/
result = findname(&foundname, target, &msg->sections[section]);
if (result != DNS_R_SUCCESS)
return (result);
if (name != NULL)
*name = foundname;
/*
* And now look for the type.
*/
if (rdataset == NULL)
return (DNS_R_SUCCESS);
result = findtype(rdataset, foundname, type);
return (result);
}
void
......
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