diff options
author | Dima Volodin <dvv@isc.org> | 2011-08-09 21:54:42 +0200 |
---|---|---|
committer | Dima Volodin <dvv@isc.org> | 2011-08-09 21:54:42 +0200 |
commit | eb5023d2a38e0862e2d9a5f1ca4a3788fc131405 (patch) | |
tree | 3222d1760eca1e9e974beafbbb943453b9c9adcf /src | |
parent | Merge branch 'master' into trac1144 (diff) | |
download | kea-eb5023d2a38e0862e2d9a5f1ca4a3788fc131405.tar.xz kea-eb5023d2a38e0862e2d9a5f1ca4a3788fc131405.zip |
[1144] fixes to address jinmei's review notes
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/dns/rdata/generic/detail/ds_like.h | 23 | ||||
-rw-r--r-- | src/lib/dns/rdata/generic/dlv_32769.cc | 32 | ||||
-rw-r--r-- | src/lib/dns/rdata/generic/dlv_32769.h | 37 | ||||
-rw-r--r-- | src/lib/dns/rdata/generic/ds_43.cc | 32 | ||||
-rw-r--r-- | src/lib/dns/rdata/generic/ds_43.h | 37 |
5 files changed, 81 insertions, 80 deletions
diff --git a/src/lib/dns/rdata/generic/detail/ds_like.h b/src/lib/dns/rdata/generic/detail/ds_like.h index 20cf09469d..8d4c5b2492 100644 --- a/src/lib/dns/rdata/generic/detail/ds_like.h +++ b/src/lib/dns/rdata/generic/detail/ds_like.h @@ -20,9 +20,6 @@ #include <string> #include <vector> -using namespace std; -using namespace isc::util; - struct DSImpl { // straightforward representation of DS RDATA fields DSImpl(uint16_t tag, uint8_t algorithm, uint8_t digest_type, @@ -48,16 +45,24 @@ public: iss >> tag >> algorithm >> digest_type >> &digestbuf; if (iss.bad() || iss.fail()) { - isc_throw(InvalidRdataText, "Invalid DS text"); + isc_throw(InvalidRdataText, "Invalid " + + RRParamRegistry::getRegistry().codeToTypeText(typeCode) + + " text"); } if (tag > 0xffff) { - isc_throw(InvalidRdataText, "DS tag out of range"); + isc_throw(InvalidRdataText, + RRParamRegistry::getRegistry().codeToTypeText(typeCode) + + " tag out of range"); } if (algorithm > 0xff) { - isc_throw(InvalidRdataText, "DS algorithm out of range"); + isc_throw(InvalidRdataText, + RRParamRegistry::getRegistry().codeToTypeText(typeCode) + + " algorithm out of range"); } if (digest_type > 0xff) { - isc_throw(InvalidRdataText, "DS digest type out of range"); + isc_throw(InvalidRdataText, + RRParamRegistry::getRegistry().codeToTypeText(typeCode) + + " digest type out of range"); } vector<uint8_t> digest; @@ -68,7 +73,9 @@ public: DS_LIKE(InputBuffer& buffer, size_t rdata_len) { if (rdata_len < 4) { - isc_throw(InvalidRdataLength, "DS too short"); + isc_throw(InvalidRdataLength, + RRParamRegistry::getRegistry().codeToTypeText(typeCode) + + " too short"); } uint16_t tag = buffer.readUint16(); diff --git a/src/lib/dns/rdata/generic/dlv_32769.cc b/src/lib/dns/rdata/generic/dlv_32769.cc index cf72d76882..d00282f739 100644 --- a/src/lib/dns/rdata/generic/dlv_32769.cc +++ b/src/lib/dns/rdata/generic/dlv_32769.cc @@ -15,5 +15,37 @@ // BEGIN_ISC_NAMESPACE // BEGIN_RDATA_NAMESPACE +DLV::DLV(const std::string& type_str) : + DS_LIKE(type_str) +{} + +DLV::DLV(isc::util::InputBuffer& buffer, size_t rdata_len) : + DS_LIKE(buffer, rdata_len) +{} + +DLV::DLV(const DLV& other) : + DS_LIKE(other) +{} + +std::string DLV::toText() const +{ + return DS_LIKE::toText(); +} + +void DLV::toWire(isc::util::OutputBuffer& buffer) const +{ + DS_LIKE::toWire(buffer); +} + +void DLV::toWire(AbstractMessageRenderer& renderer) const +{ + DS_LIKE::toWire(renderer); +} + +int DLV::compare(const Rdata& other) const +{ + return DS_LIKE::compare(other); +} + // END_RDATA_NAMESPACE // END_ISC_NAMESPACE diff --git a/src/lib/dns/rdata/generic/dlv_32769.h b/src/lib/dns/rdata/generic/dlv_32769.h index 1a8e7a3766..cf86234347 100644 --- a/src/lib/dns/rdata/generic/dlv_32769.h +++ b/src/lib/dns/rdata/generic/dlv_32769.h @@ -28,6 +28,7 @@ #include <dns/name.h> #include <dns/rdata.h> #include <dns/rdataclass.h> +#include <dns/rrparamregistry.h> #include <stdio.h> #include <time.h> @@ -46,48 +47,12 @@ using namespace isc::util::encode; #include <dns/rdata/generic/detail/ds_like.h> class DLV : public DS_LIKE<DLV, 32769> { - friend class DS_LIKE<DLV, 32769>; - static string const id; - public: // BEGIN_COMMON_MEMBERS // END_COMMON_MEMBERS }; -/// explicit DLV(const std::string& type_str); -inline DLV::DLV(const std::string& type_str) : DS_LIKE<DLV, 32769>(type_str) {} - -/// DLV(isc::util::InputBuffer& buffer, size_t rdata_len); -inline DLV::DLV(isc::util::InputBuffer& buffer, size_t rdata_len) : DS_LIKE<DLV, 32769>(buffer, rdata_len) {} - -/// DLV(const DLV& other); -inline DLV::DLV(const DLV& other) : DS_LIKE<DLV, 32769>(other) {} - -/// virtual std::string toText() const; -inline std::string DLV::toText() const -{ - return DS_LIKE<DLV, 32769>::toText(); -} - -/// virtual void toWire(isc::util::OutputBuffer& buffer) const; -inline void DLV::toWire(isc::util::OutputBuffer& buffer) const -{ - DS_LIKE<DLV, 32769>::toWire(buffer); -} - -/// virtual void toWire(AbstractMessageRenderer& renderer) const; -inline void DLV::toWire(AbstractMessageRenderer& renderer) const -{ - DS_LIKE<DLV, 32769>::toWire(renderer); -} - -/// virtual int compare(const Rdata& other) const; -inline int DLV::compare(const Rdata& other) const -{ - return DS_LIKE<DLV, 32769>::compare(other); -} - // END_RDATA_NAMESPACE // END_ISC_NAMESPACE // END_HEADER_GUARD diff --git a/src/lib/dns/rdata/generic/ds_43.cc b/src/lib/dns/rdata/generic/ds_43.cc index cf72d76882..fe73e52630 100644 --- a/src/lib/dns/rdata/generic/ds_43.cc +++ b/src/lib/dns/rdata/generic/ds_43.cc @@ -15,5 +15,37 @@ // BEGIN_ISC_NAMESPACE // BEGIN_RDATA_NAMESPACE +DS::DS(const std::string& type_str) : + DS_LIKE(type_str) +{} + +DS::DS(isc::util::InputBuffer& buffer, size_t rdata_len) : + DS_LIKE(buffer, rdata_len) +{} + +DS::DS(const DS& other) : + DS_LIKE(other) +{} + +std::string DS::toText() const +{ + return DS_LIKE::toText(); +} + +void DS::toWire(isc::util::OutputBuffer& buffer) const +{ + DS_LIKE::toWire(buffer); +} + +void DS::toWire(AbstractMessageRenderer& renderer) const +{ + DS_LIKE::toWire(renderer); +} + +int DS::compare(const Rdata& other) const +{ + return DS_LIKE::compare(other); +} + // END_RDATA_NAMESPACE // END_ISC_NAMESPACE diff --git a/src/lib/dns/rdata/generic/ds_43.h b/src/lib/dns/rdata/generic/ds_43.h index 0bb813587e..24715d997f 100644 --- a/src/lib/dns/rdata/generic/ds_43.h +++ b/src/lib/dns/rdata/generic/ds_43.h @@ -28,6 +28,7 @@ #include <dns/name.h> #include <dns/rdata.h> #include <dns/rdataclass.h> +#include <dns/rrparamregistry.h> #include <stdio.h> #include <time.h> @@ -46,48 +47,12 @@ using namespace isc::util::encode; #include <dns/rdata/generic/detail/ds_like.h> class DS : public DS_LIKE<DS, 43> { - friend class DS_LIKE<DS, 43>; - static string const id; - public: // BEGIN_COMMON_MEMBERS // END_COMMON_MEMBERS }; -/// explicit DS(const std::string& type_str); -inline DS::DS(const std::string& type_str) : DS_LIKE<DS, 43>(type_str) {} - -/// DS(isc::util::InputBuffer& buffer, size_t rdata_len); -inline DS::DS(isc::util::InputBuffer& buffer, size_t rdata_len) : DS_LIKE<DS, 43>(buffer, rdata_len) {} - -/// DS(const DS& other); -inline DS::DS(const DS& other) : DS_LIKE<DS, 43>(other) {} - -/// virtual std::string toText() const; -inline std::string DS::toText() const -{ - return DS_LIKE<DS, 43>::toText(); -} - -/// virtual void toWire(isc::util::OutputBuffer& buffer) const; -inline void DS::toWire(isc::util::OutputBuffer& buffer) const -{ - DS_LIKE<DS, 43>::toWire(buffer); -} - -/// virtual void toWire(AbstractMessageRenderer& renderer) const; -inline void DS::toWire(AbstractMessageRenderer& renderer) const -{ - DS_LIKE<DS, 43>::toWire(renderer); -} - -/// virtual int compare(const Rdata& other) const; -inline int DS::compare(const Rdata& other) const -{ - return DS_LIKE<DS, 43>::compare(other); -} - // END_RDATA_NAMESPACE // END_ISC_NAMESPACE // END_HEADER_GUARD |