BIND 10 trac2518, updated. fc5c7370d09294a8920da0780c615dcb77d7efd7 [2518] Untabify code
BIND 10 source code commits
bind10-changes at lists.isc.org
Fri Jan 17 07:57:50 UTC 2014
The branch, trac2518 has been updated
via fc5c7370d09294a8920da0780c615dcb77d7efd7 (commit)
via 362a47928d1c939a51d694ab81e68bf47ec564f9 (commit)
from 18c3e8911a8e7c007fc95a33d449ca4e25d9d176 (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 fc5c7370d09294a8920da0780c615dcb77d7efd7
Author: Mukund Sivaraman <muks at isc.org>
Date: Fri Jan 17 13:27:38 2014 +0530
[2518] Untabify code
commit 362a47928d1c939a51d694ab81e68bf47ec564f9
Author: Mukund Sivaraman <muks at isc.org>
Date: Fri Jan 17 13:27:28 2014 +0530
[2518] Introduce isc::dns::Exception and organize all DNS exceptions under it
-----------------------------------------------------------------------
Summary of changes:
src/lib/dns/exceptions.h | 28 +++++++++++++++++-----------
src/lib/dns/master_lexer.h | 6 +++---
src/lib/dns/message.h | 18 +++++++++---------
src/lib/dns/rdata.h | 14 +++++++-------
src/lib/dns/rrclass-placeholder.h | 10 +++++-----
src/lib/dns/rrparamregistry.h | 10 +++++-----
src/lib/dns/rrset.h | 6 +++---
src/lib/dns/rrttl.h | 10 +++++-----
src/lib/dns/rrtype-placeholder.h | 10 +++++-----
src/lib/dns/tsig.cc | 30 +++++++++++++++---------------
src/lib/dns/tsigkey.cc | 2 +-
11 files changed, 75 insertions(+), 69 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/dns/exceptions.h b/src/lib/dns/exceptions.h
index d7adedd..34413aa 100644
--- a/src/lib/dns/exceptions.h
+++ b/src/lib/dns/exceptions.h
@@ -30,10 +30,25 @@ namespace dns {
///
class Rcode; // forward declaration
-class DNSProtocolError : public isc::Exception {
+class Exception : public isc::Exception {
public:
- DNSProtocolError(const char* file, size_t line, const char* what) :
+ Exception(const char* file, size_t line, const char* what) :
isc::Exception(file, line, what) {}
+};
+
+///
+/// \brief Base class for name parser exceptions.
+///
+class NameParserException : public isc::dns::Exception {
+public:
+ NameParserException(const char* file, size_t line, const char* what) :
+ isc::dns::Exception(file, line, what) {}
+};
+
+class DNSProtocolError : public isc::dns::Exception {
+public:
+ DNSProtocolError(const char* file, size_t line, const char* what) :
+ isc::dns::Exception(file, line, what) {}
virtual const Rcode& getRcode() const = 0;
};
@@ -51,15 +66,6 @@ public:
virtual const Rcode& getRcode() const;
};
-///
-/// \brief Base class for name parser exceptions.
-///
-class NameParserException : public isc::Exception {
-public:
- NameParserException(const char* file, size_t line, const char* what) :
- isc::Exception(file, line, what) {}
-};
-
}
}
#endif // DNS_EXCEPTIONS_H
diff --git a/src/lib/dns/master_lexer.h b/src/lib/dns/master_lexer.h
index e33f964..1184f04 100644
--- a/src/lib/dns/master_lexer.h
+++ b/src/lib/dns/master_lexer.h
@@ -15,7 +15,7 @@
#ifndef MASTER_LEXER_H
#define MASTER_LEXER_H 1
-#include <exceptions/exceptions.h>
+#include <dns/exceptions.h>
#include <istream>
#include <string>
@@ -324,10 +324,10 @@ public:
///
/// The \c token_ member variable (read-only) is set to a \c MasterToken
/// object of type ERROR indicating the reason for the error.
- class LexerError : public Exception {
+ class LexerError : public isc::dns::Exception {
public:
LexerError(const char* file, size_t line, MasterToken error_token) :
- Exception(file, line, error_token.getErrorText().c_str()),
+ isc::dns::Exception(file, line, error_token.getErrorText().c_str()),
token_(error_token)
{}
const MasterToken token_;
diff --git a/src/lib/dns/message.h b/src/lib/dns/message.h
index 1c83e1e..2d4e15d 100644
--- a/src/lib/dns/message.h
+++ b/src/lib/dns/message.h
@@ -21,7 +21,7 @@
#include <string>
#include <ostream>
-#include <exceptions/exceptions.h>
+#include <dns/exceptions.h>
#include <dns/edns.h>
#include <dns/question.h>
@@ -41,10 +41,10 @@ class TSIGRecord;
/// message parser encounters a short length of data that don't even contain
/// the full header section.
///
-class MessageTooShort : public Exception {
+class MessageTooShort : public isc::dns::Exception {
public:
MessageTooShort(const char* file, size_t line, const char* what) :
- isc::Exception(file, line, what) {}
+ isc::dns::Exception(file, line, what) {}
};
///
@@ -52,10 +52,10 @@ public:
/// is being constructed for an incompatible section. Specifically, this
/// happens RRset iterator is being constructed for a Question section.
///
-class InvalidMessageSection : public Exception {
+class InvalidMessageSection : public isc::dns::Exception {
public:
InvalidMessageSection(const char* file, size_t line, const char* what) :
- isc::Exception(file, line, what) {}
+ isc::dns::Exception(file, line, what) {}
};
///
@@ -63,10 +63,10 @@ public:
/// class method is called that is prohibited for the current mode of
/// the message.
///
-class InvalidMessageOperation : public Exception {
+class InvalidMessageOperation : public isc::dns::Exception {
public:
InvalidMessageOperation(const char* file, size_t line, const char* what) :
- isc::Exception(file, line, what) {}
+ isc::dns::Exception(file, line, what) {}
};
///
@@ -74,10 +74,10 @@ public:
/// smaller than the standard default maximum (DEFAULT_MAX_UDPSIZE) is
/// being specified for the message.
///
-class InvalidMessageUDPSize : public Exception {
+class InvalidMessageUDPSize : public isc::dns::Exception {
public:
InvalidMessageUDPSize(const char* file, size_t line, const char* what) :
- isc::Exception(file, line, what) {}
+ isc::dns::Exception(file, line, what) {}
};
typedef uint16_t qid_t;
diff --git a/src/lib/dns/rdata.h b/src/lib/dns/rdata.h
index 3fe0c74..a1115fd 100644
--- a/src/lib/dns/rdata.h
+++ b/src/lib/dns/rdata.h
@@ -19,7 +19,7 @@
#include <dns/master_loader.h>
#include <dns/master_loader_callbacks.h>
-#include <exceptions/exceptions.h>
+#include <dns/exceptions.h>
#include <boost/shared_ptr.hpp>
@@ -42,20 +42,20 @@ namespace rdata {
/// \brief A standard DNS module exception that is thrown if RDATA parser
/// encounters an invalid or inconsistent data length.
///
-class InvalidRdataLength : public Exception {
+class InvalidRdataLength : public isc::dns::Exception {
public:
InvalidRdataLength(const char* file, size_t line, const char* what) :
- isc::Exception(file, line, what) {}
+ isc::dns::Exception(file, line, what) {}
};
///
/// \brief A standard DNS module exception that is thrown if RDATA parser
/// fails to recognize a given textual representation.
///
-class InvalidRdataText : public Exception {
+class InvalidRdataText : public isc::dns::Exception {
public:
InvalidRdataText(const char* file, size_t line, const char* what) :
- isc::Exception(file, line, what) {}
+ isc::dns::Exception(file, line, what) {}
};
///
@@ -63,10 +63,10 @@ public:
/// encounters a character-string (as defined in RFC1035) exceeding
/// the maximum allowable length (\c MAX_CHARSTRING_LEN).
///
-class CharStringTooLong : public Exception {
+class CharStringTooLong : public isc::dns::Exception {
public:
CharStringTooLong(const char* file, size_t line, const char* what) :
- isc::Exception(file, line, what) {}
+ isc::dns::Exception(file, line, what) {}
};
// Forward declaration to define RdataPtr.
diff --git a/src/lib/dns/rrclass-placeholder.h b/src/lib/dns/rrclass-placeholder.h
index b4f1851..56d9474 100644
--- a/src/lib/dns/rrclass-placeholder.h
+++ b/src/lib/dns/rrclass-placeholder.h
@@ -20,7 +20,7 @@
#include <string>
#include <ostream>
-#include <exceptions/exceptions.h>
+#include <dns/exceptions.h>
#include <boost/optional.hpp>
@@ -39,20 +39,20 @@ class AbstractMessageRenderer;
/// \brief A standard DNS module exception that is thrown if an RRClass object
/// is being constructed from an unrecognized string.
///
-class InvalidRRClass : public Exception {
+class InvalidRRClass : public isc::dns::Exception {
public:
InvalidRRClass(const char* file, size_t line, const char* what) :
- isc::Exception(file, line, what) {}
+ isc::dns::Exception(file, line, what) {}
};
///
/// \brief A standard DNS module exception that is thrown if an RRClass object
/// is being constructed from a incomplete (too short) wire-format data.
///
-class IncompleteRRClass : public Exception {
+class IncompleteRRClass : public isc::dns::Exception {
public:
IncompleteRRClass(const char* file, size_t line, const char* what) :
- isc::Exception(file, line, what) {}
+ isc::dns::Exception(file, line, what) {}
};
///
diff --git a/src/lib/dns/rrparamregistry.h b/src/lib/dns/rrparamregistry.h
index 1d59e01..3e30a36 100644
--- a/src/lib/dns/rrparamregistry.h
+++ b/src/lib/dns/rrparamregistry.h
@@ -21,7 +21,7 @@
#include <boost/shared_ptr.hpp>
-#include <exceptions/exceptions.h>
+#include <dns/exceptions.h>
#include <dns/rdata.h>
@@ -35,20 +35,20 @@ struct RRParamRegistryImpl;
/// \brief A standard DNS module exception that is thrown if a new RR type is
/// being registered with a different type string.
///
-class RRTypeExists : public Exception {
+class RRTypeExists : public isc::dns::Exception {
public:
RRTypeExists(const char* file, size_t line, const char* what) :
- isc::Exception(file, line, what) {}
+ isc::dns::Exception(file, line, what) {}
};
///
/// \brief A standard DNS module exception that is thrown if a new RR class is
/// being registered with a different type string.
///
-class RRClassExists : public Exception {
+class RRClassExists : public isc::dns::Exception {
public:
RRClassExists(const char* file, size_t line, const char* what) :
- isc::Exception(file, line, what) {}
+ isc::dns::Exception(file, line, what) {}
};
namespace rdata {
diff --git a/src/lib/dns/rrset.h b/src/lib/dns/rrset.h
index 395cbdd..01e59f8 100644
--- a/src/lib/dns/rrset.h
+++ b/src/lib/dns/rrset.h
@@ -20,7 +20,7 @@
#include <boost/shared_ptr.hpp>
-#include <exceptions/exceptions.h>
+#include <dns/exceptions.h>
#include <dns/rdata.h>
#include <dns/rrtype.h>
@@ -36,10 +36,10 @@ namespace dns {
/// \brief A standard DNS module exception that is thrown if an RRset object
/// does not contain any RDATA where required.
///
-class EmptyRRset : public Exception {
+class EmptyRRset : public isc::dns::Exception {
public:
EmptyRRset(const char* file, size_t line, const char* what) :
- isc::Exception(file, line, what) {}
+ isc::dns::Exception(file, line, what) {}
};
// forward declarations
diff --git a/src/lib/dns/rrttl.h b/src/lib/dns/rrttl.h
index 35403b6..7804234 100644
--- a/src/lib/dns/rrttl.h
+++ b/src/lib/dns/rrttl.h
@@ -15,7 +15,7 @@
#ifndef RRTTL_H
#define RRTTL_H 1
-#include <exceptions/exceptions.h>
+#include <dns/exceptions.h>
#include <boost/optional.hpp>
@@ -36,20 +36,20 @@ class AbstractMessageRenderer;
/// \brief A standard DNS module exception that is thrown if an RRTTL object
/// is being constructed from an unrecognized string.
///
-class InvalidRRTTL : public Exception {
+class InvalidRRTTL : public isc::dns::Exception {
public:
InvalidRRTTL(const char* file, size_t line, const char* what) :
- isc::Exception(file, line, what) {}
+ isc::dns::Exception(file, line, what) {}
};
///
/// \brief A standard DNS module exception that is thrown if an RRTTL object
/// is being constructed from a incomplete (too short) wire-format data.
///
-class IncompleteRRTTL : public Exception {
+class IncompleteRRTTL : public isc::dns::Exception {
public:
IncompleteRRTTL(const char* file, size_t line, const char* what) :
- isc::Exception(file, line, what) {}
+ isc::dns::Exception(file, line, what) {}
};
///
diff --git a/src/lib/dns/rrtype-placeholder.h b/src/lib/dns/rrtype-placeholder.h
index 5541635..08ab287 100644
--- a/src/lib/dns/rrtype-placeholder.h
+++ b/src/lib/dns/rrtype-placeholder.h
@@ -20,7 +20,7 @@
#include <string>
#include <ostream>
-#include <exceptions/exceptions.h>
+#include <dns/exceptions.h>
// Solaris x86 defines DS in <sys/regset.h>, which gets pulled in by Boost
#if defined(__sun) && defined(DS)
@@ -42,20 +42,20 @@ class AbstractMessageRenderer;
/// \brief A standard DNS module exception that is thrown if an RRType object
/// is being constructed from an unrecognized string.
///
-class InvalidRRType : public Exception {
+class InvalidRRType : public isc::dns::Exception {
public:
InvalidRRType(const char* file, size_t line, const char* what) :
- isc::Exception(file, line, what) {}
+ isc::dns::Exception(file, line, what) {}
};
///
/// \brief A standard DNS module exception that is thrown if an RRType object
/// is being constructed from a incomplete (too short) wire-format data.
///
-class IncompleteRRType : public Exception {
+class IncompleteRRType : public isc::dns::Exception {
public:
IncompleteRRType(const char* file, size_t line, const char* what) :
- isc::Exception(file, line, what) {}
+ isc::dns::Exception(file, line, what) {}
};
///
diff --git a/src/lib/dns/tsig.cc b/src/lib/dns/tsig.cc
index d7ffcf8..b6e1716 100644
--- a/src/lib/dns/tsig.cc
+++ b/src/lib/dns/tsig.cc
@@ -79,7 +79,7 @@ struct TSIGContext::TSIGContextImpl {
key_.getSecret(), key_.getSecretLength(),
key_.getAlgorithm()),
deleteHMAC);
- } catch (const Exception&) {
+ } catch (const isc::Exception&) {
return;
}
digest_len_ = hmac_->getOutputLength();
@@ -289,20 +289,20 @@ TSIGContext::getTSIGLength() const {
//
// The space required for an TSIG record is:
//
- // n1 bytes for the (key) name
- // 2 bytes for the type
- // 2 bytes for the class
- // 4 bytes for the ttl
- // 2 bytes for the rdlength
- // n2 bytes for the algorithm name
- // 6 bytes for the time signed
- // 2 bytes for the fudge
- // 2 bytes for the MAC size
- // x bytes for the MAC
- // 2 bytes for the original id
- // 2 bytes for the error
- // 2 bytes for the other data length
- // y bytes for the other data (at most)
+ // n1 bytes for the (key) name
+ // 2 bytes for the type
+ // 2 bytes for the class
+ // 4 bytes for the ttl
+ // 2 bytes for the rdlength
+ // n2 bytes for the algorithm name
+ // 6 bytes for the time signed
+ // 2 bytes for the fudge
+ // 2 bytes for the MAC size
+ // x bytes for the MAC
+ // 2 bytes for the original id
+ // 2 bytes for the error
+ // 2 bytes for the other data length
+ // y bytes for the other data (at most)
// ---------------------------------
// 26 + n1 + n2 + x + y bytes
//
diff --git a/src/lib/dns/tsigkey.cc b/src/lib/dns/tsigkey.cc
index 24a6f57..862d300 100644
--- a/src/lib/dns/tsigkey.cc
+++ b/src/lib/dns/tsigkey.cc
@@ -141,7 +141,7 @@ TSIGKey::TSIGKey(const std::string& str) : impl_(NULL) {
impl_ = new TSIGKeyImpl(Name(keyname_str), algo_name, algorithm,
secret.empty() ? NULL : &secret[0],
secret.size());
- } catch (const Exception& e) {
+ } catch (const isc::Exception& e) {
// 'reduce' the several types of exceptions name parsing and
// Base64 decoding can throw to just the InvalidParameter
isc_throw(InvalidParameter, e.what());
More information about the bind10-changes
mailing list