|
@@ -49,20 +49,21 @@ using namespace isc::dns;
|
|
|
using namespace isc::dns::rdata;
|
|
|
|
|
|
namespace {
|
|
|
+
|
|
|
+struct MatchRRsetForType {
|
|
|
+ MatchRRsetForType(const RRType rrtype) : rrtype_(rrtype) {}
|
|
|
+ bool operator()(RRsetPtr rrset) {
|
|
|
+ return (rrset->getType() == rrtype_);
|
|
|
+ }
|
|
|
+ const RRType rrtype_;
|
|
|
+};
|
|
|
+
|
|
|
// This is a helper to retrieve a specified RR type of RRset from RRsetList.
|
|
|
// In our case the data source search logic should ensure that the class is
|
|
|
// valid. We use this find logic of our own so that we can support both
|
|
|
// specific RR class queries (normal case) and class ANY queries.
|
|
|
RRsetPtr
|
|
|
findRRsetFromList(RRsetList& list, const RRType rrtype) {
|
|
|
- struct MatchRRsetForType {
|
|
|
- MatchRRsetForType(const RRType rrtype) : rrtype_(rrtype) {}
|
|
|
- bool operator()(RRsetPtr rrset) {
|
|
|
- return (rrset->getType() == rrtype_);
|
|
|
- }
|
|
|
- const RRType rrtype_;
|
|
|
- };
|
|
|
-
|
|
|
RRsetList::iterator it(find_if(list.begin(), list.end(),
|
|
|
MatchRRsetForType(rrtype)));
|
|
|
return (it != list.end() ? *it : RRsetPtr());
|