;; (.no.example.com. (qname, NXDOMAIN)
;; ).no.example.com. (exist)
;; *.no.example.com. (best possible wildcard, not exist)
-).no.example.com. 3600 IN AAAA 2001:db8::53
+\).no.example.com. 3600 IN AAAA 2001:db8::53
;; NSEC records.
example.com. 3600 IN NSEC cname.example.com. NS SOA NSEC RRSIG
-mx.example.com. 3600 IN NSEC ).no.example.com. MX NSEC RRSIG
-).no.example.com. 3600 IN NSEC nz.no.example.com. AAAA NSEC RRSIG
+mx.example.com. 3600 IN NSEC \).no.example.com. MX NSEC RRSIG
+\).no.example.com. 3600 IN NSEC nz.no.example.com. AAAA NSEC RRSIG
;; We'll also test the case where a single NSEC proves both NXDOMAIN and the
;; non existence of wildcard. The following records will be used for that
;; test.
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
+#include <datasrc/master_loader_callbacks.h>
#include <datasrc/memory/zone_data_loader.h>
#include <datasrc/memory/zone_data_updater.h>
#include <datasrc/memory/logger.h>
#include <datasrc/memory/segment_object_holder.h>
#include <datasrc/memory/util_internal.h>
+#include <dns/master_loader.h>
+#include <dns/rrcollator.h>
#include <dns/rdataclass.h>
#include <dns/rrset.h>
-#include <dns/masterload.h>
+#include <dns/rrcollator.h>
#include <boost/foreach.hpp>
#include <boost/bind.hpp>
return (holder.release());
}
-// A wrapper for dns::masterLoad used by loadZoneData() below. Essentially it
-// converts the two callback types. Note the mostly redundant wrapper of
+// A wrapper for dns::MasterLoader used by loadZoneData() below. Essentially
+// it converts the two callback types. Note the mostly redundant wrapper of
// boost::bind. It converts function<void(ConstRRsetPtr)> to
-// function<void(RRsetPtr)> (masterLoad() expects the latter). SunStudio
+// function<void(RRsetPtr)> (MasterLoader expects the latter). SunStudio
// doesn't seem to do this conversion if we just pass 'callback'.
void
-masterLoadWrapper(const char* const filename, const Name& origin,
- const RRClass& zone_class, LoadCallback callback)
+masterLoaderWrapper(const char* const filename, const Name& origin,
+ const RRClass& zone_class, LoadCallback callback)
{
+ bool load_ok = false; // (we don't use it)
+ dns::RRCollator collator(boost::bind(callback, _1));
+
try {
- masterLoad(filename, origin, zone_class, boost::bind(callback, _1));
- } catch (MasterLoadError& e) {
+ dns::MasterLoader(filename, origin, zone_class,
+ createMasterLoaderCallbacks(origin, zone_class,
+ &load_ok),
+ collator.getCallback()).load();
+ collator.finish();
+ } catch (const dns::MasterLoaderError& e) {
isc_throw(ZoneLoaderException, e.what());
}
}
const std::string& zone_file)
{
return (loadZoneDataInternal(mem_sgmt, rrclass, zone_name,
- boost::bind(masterLoadWrapper,
+ boost::bind(masterLoaderWrapper,
zone_file.c_str(),
zone_name, rrclass,
_1)));