BIND 10 trac1144, updated. a9ddfa91f81e00400f04548e71ab9519892a6dea [1144] cleanall.sh re-done w/o non-POSIX find options
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu Aug 11 21:44:09 UTC 2011
The branch, trac1144 has been updated
via a9ddfa91f81e00400f04548e71ab9519892a6dea (commit)
via 04749187843604f51ddcab4f53811dac9a9ed8a0 (commit)
from a03d7d9aae8ac258d266c66c62c63e03ff5d2558 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit a9ddfa91f81e00400f04548e71ab9519892a6dea
Author: Dima Volodin <dvv at isc.org>
Date: Thu Aug 11 16:46:50 2011 -0400
[1144] cleanall.sh re-done w/o non-POSIX find options
commit 04749187843604f51ddcab4f53811dac9a9ed8a0
Author: Dima Volodin <dvv at isc.org>
Date: Thu Aug 11 16:35:03 2011 -0400
[1144] DS and DLV common implementation hidden behind private pointers
so that the implementation weren't seen in rdataclass.h
-----------------------------------------------------------------------
Summary of changes:
src/lib/dns/Makefile.am | 2 +
src/lib/dns/rdata/generic/detail/ds_like.h | 138 +++++++++++-----------------
src/lib/dns/rdata/generic/dlv_32769.h | 42 ++++----
src/lib/dns/rdata/generic/ds_43.h | 42 ++++----
tests/system/cleanall.sh | 5 +-
5 files changed, 100 insertions(+), 129 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/dns/Makefile.am b/src/lib/dns/Makefile.am
index a8bcb72..45525c3 100644
--- a/src/lib/dns/Makefile.am
+++ b/src/lib/dns/Makefile.am
@@ -24,11 +24,13 @@ EXTRA_DIST += rdata/generic/cname_5.h
EXTRA_DIST += rdata/generic/detail/nsec_bitmap.cc
EXTRA_DIST += rdata/generic/detail/nsec_bitmap.h
EXTRA_DIST += rdata/generic/detail/ds_like.h
+EXTRA_DIST += rdata/generic/dlv_32769.cc
EXTRA_DIST += rdata/generic/dlv_32769.h
EXTRA_DIST += rdata/generic/dname_39.cc
EXTRA_DIST += rdata/generic/dname_39.h
EXTRA_DIST += rdata/generic/dnskey_48.cc
EXTRA_DIST += rdata/generic/dnskey_48.h
+EXTRA_DIST += rdata/generic/ds_43.cc
EXTRA_DIST += rdata/generic/ds_43.h
EXTRA_DIST += rdata/generic/mx_15.cc
EXTRA_DIST += rdata/generic/mx_15.h
diff --git a/src/lib/dns/rdata/generic/detail/ds_like.h b/src/lib/dns/rdata/generic/detail/ds_like.h
index 3ed190f..5249abf 100644
--- a/src/lib/dns/rdata/generic/detail/ds_like.h
+++ b/src/lib/dns/rdata/generic/detail/ds_like.h
@@ -20,62 +20,37 @@
#include <string>
#include <vector>
-struct DSImpl {
- // straightforward representation of DS RDATA fields
- DSImpl(uint16_t tag, uint8_t algorithm, uint8_t digest_type,
- const vector<uint8_t>& digest) :
- tag_(tag), algorithm_(algorithm), digest_type_(digest_type),
- digest_(digest)
- {}
-
- uint16_t tag_;
- uint8_t algorithm_;
- uint8_t digest_type_;
- const vector<uint8_t> digest_;
-};
-
-template<uint16_t typeCode>class DS_LIKE : public Rdata {
+template<class Type, uint16_t typeCode>class DSLikeImpl {
public:
- DS_LIKE(const string& ds_str) :
- impl_(NULL)
+ DSLikeImpl(const string& ds_str)
{
istringstream iss(ds_str);
- unsigned int tag, algorithm, digest_type;
stringbuf digestbuf;
+ uint32_t tag, algorithm, digest_type;
iss >> tag >> algorithm >> digest_type >> &digestbuf;
if (iss.bad() || iss.fail()) {
- isc_throw(InvalidRdataText, "Invalid " +
- RRParamRegistry::getRegistry().codeToTypeText(typeCode) +
- " text");
+ isc_throw(InvalidRdataText, "Invalid " << RRType(typeCode) << " text");
}
if (tag > 0xffff) {
- isc_throw(InvalidRdataText,
- RRParamRegistry::getRegistry().codeToTypeText(typeCode) +
- " tag out of range");
+ isc_throw(InvalidRdataText, RRType(typeCode) << " tag out of range");
}
if (algorithm > 0xff) {
- isc_throw(InvalidRdataText,
- RRParamRegistry::getRegistry().codeToTypeText(typeCode) +
- " algorithm out of range");
+ isc_throw(InvalidRdataText, RRType(typeCode) << " algorithm out of range");
}
if (digest_type > 0xff) {
- isc_throw(InvalidRdataText,
- RRParamRegistry::getRegistry().codeToTypeText(typeCode) +
- " digest type out of range");
+ isc_throw(InvalidRdataText, RRType(typeCode) << " digest type out of range");
}
- vector<uint8_t> digest;
- decodeHex(digestbuf.str(), digest);
-
- impl_ = new DSImpl(tag, algorithm, digest_type, digest);
+ tag_ = tag;
+ algorithm_ = algorithm;
+ digest_type_ = digest_type;
+ decodeHex(digestbuf.str(), digest_);
}
- DS_LIKE(InputBuffer& buffer, size_t rdata_len) {
+ DSLikeImpl(InputBuffer& buffer, size_t rdata_len) {
if (rdata_len < 4) {
- isc_throw(InvalidRdataLength,
- RRParamRegistry::getRegistry().codeToTypeText(typeCode) +
- " too short");
+ isc_throw(InvalidRdataLength, RRType(typeCode) << " too short");
}
uint16_t tag = buffer.readUint16();
@@ -83,76 +58,63 @@ public:
uint16_t digest_type = buffer.readUint8();
rdata_len -= 4;
- vector<uint8_t> digest(rdata_len);
- buffer.readData(&digest[0], rdata_len);
-
- impl_ = new DSImpl(tag, algorithm, digest_type, digest);
- }
+ digest_.resize(rdata_len);
+ buffer.readData(&digest_[0], rdata_len);
- DS_LIKE(const DS_LIKE& source) :
- Rdata(), impl_(new DSImpl(*source.impl_))
- {}
-
- DS_LIKE&
- operator=(const DS_LIKE& source) {
- if (impl_ == source.impl_) {
- return (*this);
- }
-
- DSImpl* newimpl = new DSImpl(*source.impl_);
- delete impl_;
- impl_ = newimpl;
-
- return (*this);
+ tag_ = tag;
+ algorithm_ = algorithm;
+ digest_type_ = digest_type;
}
- ~DS_LIKE() {
- delete impl_;
+ DSLikeImpl(const DSLikeImpl& source)
+ {
+ digest_ = source.digest_;
+ tag_ = source.tag_;
+ algorithm_ = source.algorithm_;
+ digest_type_ = source.digest_type_;
}
string
toText() const {
using namespace boost;
- return (lexical_cast<string>(static_cast<int>(impl_->tag_)) +
- " " + lexical_cast<string>(static_cast<int>(impl_->algorithm_)) +
- " " + lexical_cast<string>(static_cast<int>(impl_->digest_type_)) +
- " " + encodeHex(impl_->digest_));
+ return (lexical_cast<string>(static_cast<int>(tag_)) +
+ " " + lexical_cast<string>(static_cast<int>(algorithm_)) +
+ " " + lexical_cast<string>(static_cast<int>(digest_type_)) +
+ " " + encodeHex(digest_));
}
void
toWire(OutputBuffer& buffer) const {
- buffer.writeUint16(impl_->tag_);
- buffer.writeUint8(impl_->algorithm_);
- buffer.writeUint8(impl_->digest_type_);
- buffer.writeData(&impl_->digest_[0], impl_->digest_.size());
+ buffer.writeUint16(tag_);
+ buffer.writeUint8(algorithm_);
+ buffer.writeUint8(digest_type_);
+ buffer.writeData(&digest_[0], digest_.size());
}
void
toWire(AbstractMessageRenderer& renderer) const {
- renderer.writeUint16(impl_->tag_);
- renderer.writeUint8(impl_->algorithm_);
- renderer.writeUint8(impl_->digest_type_);
- renderer.writeData(&impl_->digest_[0], impl_->digest_.size());
+ renderer.writeUint16(tag_);
+ renderer.writeUint8(algorithm_);
+ renderer.writeUint8(digest_type_);
+ renderer.writeData(&digest_[0], digest_.size());
}
int
- compare(const Rdata& other) const {
- const DS_LIKE& other_ds = dynamic_cast<const DS_LIKE&>(other);
-
- if (impl_->tag_ != other_ds.impl_->tag_) {
- return (impl_->tag_ < other_ds.impl_->tag_ ? -1 : 1);
+ compare(const DSLikeImpl& other_ds) const {
+ if (tag_ != other_ds.tag_) {
+ return (tag_ < other_ds.tag_ ? -1 : 1);
}
- if (impl_->algorithm_ != other_ds.impl_->algorithm_) {
- return (impl_->algorithm_ < other_ds.impl_->algorithm_ ? -1 : 1);
+ if (algorithm_ != other_ds.algorithm_) {
+ return (algorithm_ < other_ds.algorithm_ ? -1 : 1);
}
- if (impl_->digest_type_ != other_ds.impl_->digest_type_) {
- return (impl_->digest_type_ < other_ds.impl_->digest_type_ ? -1 : 1);
+ if (digest_type_ != other_ds.digest_type_) {
+ return (digest_type_ < other_ds.digest_type_ ? -1 : 1);
}
- size_t this_len = impl_->digest_.size();
- size_t other_len = other_ds.impl_->digest_.size();
+ size_t this_len = digest_.size();
+ size_t other_len = other_ds.digest_.size();
size_t cmplen = min(this_len, other_len);
- int cmp = memcmp(&impl_->digest_[0], &other_ds.impl_->digest_[0], cmplen);
+ int cmp = memcmp(&digest_[0], &other_ds.digest_[0], cmplen);
if (cmp != 0) {
return (cmp);
} else {
@@ -162,11 +124,15 @@ public:
uint16_t
getTag() const {
- return (impl_->tag_);
+ return (tag_);
}
private:
- DSImpl* impl_;
+ // straightforward representation of DS RDATA fields
+ uint16_t tag_;
+ uint8_t algorithm_;
+ uint8_t digest_type_;
+ vector<uint8_t> digest_;
};
#endif // __DS_LIKE_H
diff --git a/src/lib/dns/rdata/generic/dlv_32769.h b/src/lib/dns/rdata/generic/dlv_32769.h
index f1d2761..84b1d1c 100644
--- a/src/lib/dns/rdata/generic/dlv_32769.h
+++ b/src/lib/dns/rdata/generic/dlv_32769.h
@@ -14,28 +14,14 @@
// BEGIN_HEADER_GUARD
-#include <iostream>
-#include <string>
-#include <sstream>
-#include <vector>
-
-#include <boost/lexical_cast.hpp>
+#include <stdint.h>
-#include <util/buffer.h>
-#include <util/encode/hex.h>
+#include <string>
-#include <dns/messagerenderer.h>
#include <dns/name.h>
+#include <dns/rrtype.h>
+#include <dns/rrttl.h>
#include <dns/rdata.h>
-#include <dns/rdataclass.h>
-#include <dns/rrparamregistry.h>
-
-#include <stdio.h>
-#include <time.h>
-
-using namespace std;
-using namespace isc::util;
-using namespace isc::util::encode;
// BEGIN_ISC_NAMESPACE
@@ -44,9 +30,23 @@ using namespace isc::util::encode;
// BEGIN_RDATA_NAMESPACE
-#include <dns/rdata/generic/detail/ds_like.h>
-
-typedef DS_LIKE<32769> DLV;
+template<class Type, uint16_t typeCode> class DSLikeImpl;
+
+class DLV : public Rdata {
+public:
+ // BEGIN_COMMON_MEMBERS
+ // END_COMMON_MEMBERS
+ DLV& operator=(const DLV& source);
+ ~DLV();
+
+ ///
+ /// Specialized methods
+ ///
+ uint16_t getTag() const;
+private:
+ typedef DSLikeImpl<DLV, 32769> DLVImpl;
+ DLVImpl* impl_;
+};
// 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 eae22cb..ef441b6 100644
--- a/src/lib/dns/rdata/generic/ds_43.h
+++ b/src/lib/dns/rdata/generic/ds_43.h
@@ -14,28 +14,14 @@
// BEGIN_HEADER_GUARD
-#include <iostream>
-#include <string>
-#include <sstream>
-#include <vector>
-
-#include <boost/lexical_cast.hpp>
+#include <stdint.h>
-#include <util/buffer.h>
-#include <util/encode/hex.h>
+#include <string>
-#include <dns/messagerenderer.h>
#include <dns/name.h>
+#include <dns/rrtype.h>
+#include <dns/rrttl.h>
#include <dns/rdata.h>
-#include <dns/rdataclass.h>
-#include <dns/rrparamregistry.h>
-
-#include <stdio.h>
-#include <time.h>
-
-using namespace std;
-using namespace isc::util;
-using namespace isc::util::encode;
// BEGIN_ISC_NAMESPACE
@@ -44,9 +30,23 @@ using namespace isc::util::encode;
// BEGIN_RDATA_NAMESPACE
-#include <dns/rdata/generic/detail/ds_like.h>
-
-typedef DS_LIKE<43> DS;
+template<class Type, uint16_t typeCode> class DSLikeImpl;
+
+class DS : public Rdata {
+public:
+ // BEGIN_COMMON_MEMBERS
+ // END_COMMON_MEMBERS
+ DS& operator=(const DS& source);
+ ~DS();
+
+ ///
+ /// Specialized methods
+ ///
+ uint16_t getTag() const;
+private:
+ typedef DSLikeImpl<DS, 43> DSImpl;
+ DSImpl* impl_;
+};
// END_RDATA_NAMESPACE
// END_ISC_NAMESPACE
diff --git a/tests/system/cleanall.sh b/tests/system/cleanall.sh
index 17c3d4a..d23d103 100755
--- a/tests/system/cleanall.sh
+++ b/tests/system/cleanall.sh
@@ -27,7 +27,10 @@ find . -type f \( \
status=0
-for d in `find . -type d -maxdepth 1 -mindepth 1 -print`
+for d in ./.* ./*
do
+ case $d in ./.|./..) continue ;; esac
+ test -d $d || continue
+
test ! -f $d/clean.sh || ( cd $d && sh clean.sh )
done
More information about the bind10-changes
mailing list