From: Michal 'vorner' Vaner Date: Mon, 3 Dec 2012 09:58:28 +0000 (+0100) Subject: [2377] Create Rdata X-Git-Tag: bind10-1.0.0-beta-release~24^2~59 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7e5b7f352db7ef0778b85dbf73be66210b739b46;p=thirdparty%2Fkea.git [2377] Create Rdata And fill it into the rrset. --- diff --git a/src/lib/dns/master_loader.cc b/src/lib/dns/master_loader.cc index d49070f6e9..4444afa377 100644 --- a/src/lib/dns/master_loader.cc +++ b/src/lib/dns/master_loader.cc @@ -19,6 +19,7 @@ #include #include #include +#include using std::string; @@ -74,14 +75,26 @@ public: const RRClass rrclass(getString()); const RRType rrtype(getString()); - // Create the RRset. We don't need the RRSIG, so we are good - // with the basic one - RRsetPtr rrset(new BasicRRset(name, rrclass, rrtype, ttl)); - - // TODO: Create the RData - - // OK now, so give the RRset with single RR to the caller - add_callback_(rrset); + // TODO: Origin handling + const rdata::RdataPtr data(rdata::createRdata(rrtype, rrclass, + lexer_, NULL, + options_, + callbacks_)); + // In case we get NULL, it means there was error creating + // the Rdata. The errors should have been reported by + // callbacks_ already, so we just need to not report the RR + if (data != rdata::RdataPtr()) { + // Create the RRset. We don't need the RRSIG, so we are good + // with the basic one + const RRsetPtr rrset(new BasicRRset(name, rrclass, rrtype, + ttl)); + rrset->addRdata(data); + // OK now, so give the RRset with single RR to the caller + add_callback_(rrset); + + // Good, we loaded another one + ++count; + }; } return (false); }