BIND 10 trac1144, updated. e2add15ebab33eb4257a9deddd8db50e9ccc1e58 [1144] ds_like.h untabified
BIND 10 source code commits
bind10-changes at lists.isc.org
Tue Aug 16 12:14:32 UTC 2011
The branch, trac1144 has been updated
via e2add15ebab33eb4257a9deddd8db50e9ccc1e58 (commit)
from b51f0cfcedc2499aa1c0b85aaebf2fecf244c291 (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 e2add15ebab33eb4257a9deddd8db50e9ccc1e58
Author: Dima Volodin <dvv at isc.org>
Date: Tue Aug 16 07:29:37 2011 -0400
[1144] ds_like.h untabified
-----------------------------------------------------------------------
Summary of changes:
src/lib/dns/rdata/generic/detail/ds_like.h | 142 ++++++++++++++--------------
1 files changed, 71 insertions(+), 71 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/dns/rdata/generic/detail/ds_like.h b/src/lib/dns/rdata/generic/detail/ds_like.h
index 5249abf..4ebd6bf 100644
--- a/src/lib/dns/rdata/generic/detail/ds_like.h
+++ b/src/lib/dns/rdata/generic/detail/ds_like.h
@@ -24,107 +24,107 @@ template<class Type, uint16_t typeCode>class DSLikeImpl {
public:
DSLikeImpl(const string& ds_str)
{
- istringstream iss(ds_str);
- stringbuf digestbuf;
- uint32_t tag, algorithm, digest_type;
-
- iss >> tag >> algorithm >> digest_type >> &digestbuf;
- if (iss.bad() || iss.fail()) {
- isc_throw(InvalidRdataText, "Invalid " << RRType(typeCode) << " text");
- }
- if (tag > 0xffff) {
- isc_throw(InvalidRdataText, RRType(typeCode) << " tag out of range");
- }
- if (algorithm > 0xff) {
- isc_throw(InvalidRdataText, RRType(typeCode) << " algorithm out of range");
- }
- if (digest_type > 0xff) {
- isc_throw(InvalidRdataText, RRType(typeCode) << " digest type out of range");
- }
-
- tag_ = tag;
- algorithm_ = algorithm;
- digest_type_ = digest_type;
- decodeHex(digestbuf.str(), digest_);
+ istringstream iss(ds_str);
+ stringbuf digestbuf;
+ uint32_t tag, algorithm, digest_type;
+
+ iss >> tag >> algorithm >> digest_type >> &digestbuf;
+ if (iss.bad() || iss.fail()) {
+ isc_throw(InvalidRdataText, "Invalid " << RRType(typeCode) << " text");
+ }
+ if (tag > 0xffff) {
+ isc_throw(InvalidRdataText, RRType(typeCode) << " tag out of range");
+ }
+ if (algorithm > 0xff) {
+ isc_throw(InvalidRdataText, RRType(typeCode) << " algorithm out of range");
+ }
+ if (digest_type > 0xff) {
+ isc_throw(InvalidRdataText, RRType(typeCode) << " digest type out of range");
+ }
+
+ tag_ = tag;
+ algorithm_ = algorithm;
+ digest_type_ = digest_type;
+ decodeHex(digestbuf.str(), digest_);
}
DSLikeImpl(InputBuffer& buffer, size_t rdata_len) {
- if (rdata_len < 4) {
- isc_throw(InvalidRdataLength, RRType(typeCode) << " too short");
- }
+ if (rdata_len < 4) {
+ isc_throw(InvalidRdataLength, RRType(typeCode) << " too short");
+ }
- uint16_t tag = buffer.readUint16();
- uint16_t algorithm = buffer.readUint8();
- uint16_t digest_type = buffer.readUint8();
+ uint16_t tag = buffer.readUint16();
+ uint16_t algorithm = buffer.readUint8();
+ uint16_t digest_type = buffer.readUint8();
- rdata_len -= 4;
- digest_.resize(rdata_len);
- buffer.readData(&digest_[0], rdata_len);
+ rdata_len -= 4;
+ digest_.resize(rdata_len);
+ buffer.readData(&digest_[0], rdata_len);
- tag_ = tag;
- algorithm_ = algorithm;
- digest_type_ = digest_type;
+ tag_ = tag;
+ algorithm_ = algorithm;
+ digest_type_ = digest_type;
}
DSLikeImpl(const DSLikeImpl& source)
{
- digest_ = source.digest_;
- tag_ = source.tag_;
- algorithm_ = source.algorithm_;
- digest_type_ = source.digest_type_;
+ 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>(tag_)) +
- " " + lexical_cast<string>(static_cast<int>(algorithm_)) +
- " " + lexical_cast<string>(static_cast<int>(digest_type_)) +
- " " + encodeHex(digest_));
+ using namespace boost;
+ 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(tag_);
- buffer.writeUint8(algorithm_);
- buffer.writeUint8(digest_type_);
- buffer.writeData(&digest_[0], 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(tag_);
- renderer.writeUint8(algorithm_);
- renderer.writeUint8(digest_type_);
- renderer.writeData(&digest_[0], digest_.size());
+ renderer.writeUint16(tag_);
+ renderer.writeUint8(algorithm_);
+ renderer.writeUint8(digest_type_);
+ renderer.writeData(&digest_[0], digest_.size());
}
int
compare(const DSLikeImpl& other_ds) const {
- if (tag_ != other_ds.tag_) {
- return (tag_ < other_ds.tag_ ? -1 : 1);
- }
- if (algorithm_ != other_ds.algorithm_) {
- return (algorithm_ < other_ds.algorithm_ ? -1 : 1);
- }
- if (digest_type_ != other_ds.digest_type_) {
- return (digest_type_ < other_ds.digest_type_ ? -1 : 1);
- }
-
- 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(&digest_[0], &other_ds.digest_[0], cmplen);
- if (cmp != 0) {
- return (cmp);
- } else {
- return ((this_len == other_len) ? 0 : (this_len < other_len) ? -1 : 1);
- }
+ if (tag_ != other_ds.tag_) {
+ return (tag_ < other_ds.tag_ ? -1 : 1);
+ }
+ if (algorithm_ != other_ds.algorithm_) {
+ return (algorithm_ < other_ds.algorithm_ ? -1 : 1);
+ }
+ if (digest_type_ != other_ds.digest_type_) {
+ return (digest_type_ < other_ds.digest_type_ ? -1 : 1);
+ }
+
+ 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(&digest_[0], &other_ds.digest_[0], cmplen);
+ if (cmp != 0) {
+ return (cmp);
+ } else {
+ return ((this_len == other_len) ? 0 : (this_len < other_len) ? -1 : 1);
+ }
}
uint16_t
getTag() const {
- return (tag_);
+ return (tag_);
}
private:
More information about the bind10-changes
mailing list