diff options
author | Mukund Sivaraman <muks@isc.org> | 2013-02-21 17:58:58 +0100 |
---|---|---|
committer | Mukund Sivaraman <muks@isc.org> | 2013-02-21 18:13:51 +0100 |
commit | 9fa47fa572b5db2de51f67728c999561473fe731 (patch) | |
tree | d5b195424ef053f37e7f1ffc314b3274545cba90 /src/lib/dns/rdata/generic | |
parent | [master] remove generated file from dist tarball (diff) | |
download | kea-9fa47fa572b5db2de51f67728c999561473fe731.tar.xz kea-9fa47fa572b5db2de51f67728c999561473fe731.zip |
[2386] Add DS and DLV implementations
Diffstat (limited to 'src/lib/dns/rdata/generic')
-rw-r--r-- | src/lib/dns/rdata/generic/detail/ds_like.h | 35 | ||||
-rw-r--r-- | src/lib/dns/rdata/generic/dlv_32769.cc | 5 | ||||
-rw-r--r-- | src/lib/dns/rdata/generic/ds_43.cc | 5 |
3 files changed, 45 insertions, 0 deletions
diff --git a/src/lib/dns/rdata/generic/detail/ds_like.h b/src/lib/dns/rdata/generic/detail/ds_like.h index 333de4c010..a73ee29be8 100644 --- a/src/lib/dns/rdata/generic/detail/ds_like.h +++ b/src/lib/dns/rdata/generic/detail/ds_like.h @@ -101,6 +101,41 @@ public: decodeHex(digestbuf.str(), digest_); } + DSLikeImpl(MasterLexer& lexer, const Name*, MasterLoader::Options, + MasterLoaderCallbacks&) + { + const uint32_t tag = + lexer.getNextToken(MasterToken::NUMBER).getNumber(); + if (tag > 0xffff) { + isc_throw(InvalidRdataText, + "Invalid " << RRType(typeCode) << " tag: " << tag); + } + + const uint32_t algorithm = + lexer.getNextToken(MasterToken::NUMBER).getNumber(); + if (algorithm > 0xff) { + isc_throw(InvalidRdataText, + "Invalid " << RRType(typeCode) << " algorithm: " + << algorithm); + } + + const uint32_t digest_type = + lexer.getNextToken(MasterToken::NUMBER).getNumber(); + if (digest_type > 0xff) { + isc_throw(InvalidRdataText, + "Invalid " << RRType(typeCode) << " digest type: " + << digest_type); + } + + const std::string digest = + lexer.getNextToken(MasterToken::STRING).getString(); + + tag_ = tag; + algorithm_ = algorithm; + digest_type_ = digest_type; + decodeHex(digest, digest_); + } + /// \brief Constructor from wire-format data. /// /// \param buffer A buffer storing the wire format data. diff --git a/src/lib/dns/rdata/generic/dlv_32769.cc b/src/lib/dns/rdata/generic/dlv_32769.cc index a3db998ebd..89a62e1b82 100644 --- a/src/lib/dns/rdata/generic/dlv_32769.cc +++ b/src/lib/dns/rdata/generic/dlv_32769.cc @@ -45,6 +45,11 @@ DLV::DLV(InputBuffer& buffer, size_t rdata_len) : impl_(new DLVImpl(buffer, rdata_len)) {} +DLV::DLV(MasterLexer& lexer, const Name* origin, MasterLoader::Options options, + MasterLoaderCallbacks& callbacks) : + impl_(new DLVImpl(lexer, origin, options, callbacks)) +{} + /// \brief Copy constructor /// /// A copy of the implementation object is allocated and constructed. diff --git a/src/lib/dns/rdata/generic/ds_43.cc b/src/lib/dns/rdata/generic/ds_43.cc index 4234f9d575..349238870d 100644 --- a/src/lib/dns/rdata/generic/ds_43.cc +++ b/src/lib/dns/rdata/generic/ds_43.cc @@ -39,6 +39,11 @@ DS::DS(InputBuffer& buffer, size_t rdata_len) : impl_(new DSImpl(buffer, rdata_len)) {} +DS::DS(MasterLexer& lexer, const Name* origin, MasterLoader::Options options, + MasterLoaderCallbacks& callbacks) : + impl_(new DSImpl(lexer, origin, options, callbacks)) +{} + DS::DS(const DS& source) : Rdata(), impl_(new DSImpl(*source.impl_)) {} |