Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
ISC Open Source Projects
BIND
Commits
186817c9
Commit
186817c9
authored
Sep 09, 1999
by
Michael Graff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make dns_message_findtype() public
parent
49f7148b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
7 deletions
+31
-7
lib/dns/include/dns/message.h
lib/dns/include/dns/message.h
+17
-0
lib/dns/message.c
lib/dns/message.c
+14
-7
No files found.
lib/dns/include/dns/message.h
View file @
186817c9
...
@@ -495,6 +495,23 @@ dns_message_findname(dns_message_t *msg, dns_section_t section,
...
@@ -495,6 +495,23 @@ dns_message_findname(dns_message_t *msg, dns_section_t section,
* type does not.
* type does not.
*/
*/
dns_result_t
dns_message_findtype
(
dns_name_t
*
name
,
dns_rdatatype_t
type
,
dns_rdatatype_t
covers
,
dns_rdataset_t
**
rdataset
);
/*
* Search the name for the specified type. If it is found, *rdataset is
* filled in with a pointer to that rdataset.
*
* Requires:
* if '**rdataset' is non-NULL, *rdataset needs to be NULL.
*
* 'type' be a valid type, and NOT dns_rdatatype_any.
*
* Returns:
* DNS_R_SUCCESS -- all is well.
* DNS_R_NOTFOUND -- the desired type does not exist.
*/
void
void
dns_message_movename
(
dns_message_t
*
msg
,
dns_name_t
*
name
,
dns_message_movename
(
dns_message_t
*
msg
,
dns_name_t
*
name
,
dns_section_t
fromsection
,
dns_section_t
fromsection
,
...
...
lib/dns/message.c
View file @
186817c9
...
@@ -682,12 +682,16 @@ findname(dns_name_t **foundname, dns_name_t *target, dns_namelist_t *section)
...
@@ -682,12 +682,16 @@ findname(dns_name_t **foundname, dns_name_t *target, dns_namelist_t *section)
return
(
DNS_R_NOTFOUND
);
return
(
DNS_R_NOTFOUND
);
}
}
static
dns_result_t
dns_result_t
findtype
(
dns_rdataset_t
**
rdataset
,
dns_name_t
*
name
,
dns_rdatatype_t
type
,
dns_message_findtype
(
dns_name_t
*
name
,
dns_rdatatype_t
type
,
dns_rdatatype_t
covers
)
dns_rdatatype_t
covers
,
dns_rdataset_t
**
rdataset
)
{
{
dns_rdataset_t
*
curr
;
dns_rdataset_t
*
curr
;
if
(
rdataset
!=
NULL
)
{
REQUIRE
(
*
rdataset
==
NULL
);
}
for
(
curr
=
ISC_LIST_TAIL
(
name
->
list
)
;
for
(
curr
=
ISC_LIST_TAIL
(
name
->
list
)
;
curr
!=
NULL
;
curr
!=
NULL
;
curr
=
ISC_LIST_PREV
(
curr
,
link
))
{
curr
=
ISC_LIST_PREV
(
curr
,
link
))
{
...
@@ -890,7 +894,7 @@ getquestions(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx)
...
@@ -890,7 +894,7 @@ getquestions(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx)
/*
/*
* Can't ask the same question twice.
* Can't ask the same question twice.
*/
*/
result
=
findtype
(
NULL
,
name
,
rdtype
,
0
);
result
=
dns_message_
findtype
(
name
,
rdtype
,
0
,
NULL
);
if
(
result
==
DNS_R_SUCCESS
)
if
(
result
==
DNS_R_SUCCESS
)
return
(
DNS_R_FORMERR
);
return
(
DNS_R_FORMERR
);
...
@@ -1091,8 +1095,11 @@ getsection(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx,
...
@@ -1091,8 +1095,11 @@ getsection(isc_buffer_t *source, dns_message_t *msg, dns_decompress_t *dctx,
if
(
preserve_order
||
msg
->
opcode
==
dns_opcode_update
||
if
(
preserve_order
||
msg
->
opcode
==
dns_opcode_update
||
skip_search
)
skip_search
)
result
=
DNS_R_NOTFOUND
;
result
=
DNS_R_NOTFOUND
;
else
else
{
result
=
findtype
(
&
rdataset
,
name
,
rdtype
,
covers
);
rdataset
=
NULL
;
result
=
dns_message_findtype
(
name
,
rdtype
,
covers
,
&
rdataset
);
}
/*
/*
* If we found an rdataset that matches, we need to
* If we found an rdataset that matches, we need to
...
@@ -1602,7 +1609,7 @@ dns_message_findname(dns_message_t *msg, dns_section_t section,
...
@@ -1602,7 +1609,7 @@ dns_message_findname(dns_message_t *msg, dns_section_t section,
if
(
type
==
dns_rdatatype_any
)
if
(
type
==
dns_rdatatype_any
)
return
(
DNS_R_SUCCESS
);
return
(
DNS_R_SUCCESS
);
result
=
findtype
(
rdataset
,
foundname
,
type
,
covers
);
result
=
dns_message_findtype
(
foundname
,
type
,
covers
,
rdataset
);
if
(
result
==
DNS_R_NOTFOUND
)
if
(
result
==
DNS_R_NOTFOUND
)
return
(
DNS_R_NXRDATASET
);
return
(
DNS_R_NXRDATASET
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment