[svn] commit: r1181 - in /trunk/src/lib: auth/ cc/ config/ dns/ dns/rdata/ch_3/ dns/rdata/generic/ dns/rdata/hs_4/ dns/rdata/in_1/ exceptions/
BIND 10 source code commits
bind10-changes at lists.isc.org
Sun Mar 7 07:06:42 UTC 2010
Author: jinmei
Date: Sun Mar 7 07:06:42 2010
New Revision: 1181
Log:
s/dns_throw/isc_throw/
now that the generic exception code is a separate library in the isc namespace
it doesn't make sense to call it dns_something.
I know it's a big change, but I believe we should do this cleanup sooner
than later.
Modified:
trunk/src/lib/auth/data_source.cc
trunk/src/lib/auth/query.cc
trunk/src/lib/cc/data.cc
trunk/src/lib/cc/data.h
trunk/src/lib/config/ccsession.cc
trunk/src/lib/config/config_data.cc
trunk/src/lib/dns/base32.cc
trunk/src/lib/dns/base64.cc
trunk/src/lib/dns/buffer.h
trunk/src/lib/dns/dnstime.cc
trunk/src/lib/dns/hex.cc
trunk/src/lib/dns/message.cc
trunk/src/lib/dns/name.cc
trunk/src/lib/dns/name.h
trunk/src/lib/dns/rdata.cc
trunk/src/lib/dns/rdata/ch_3/a_1.cc
trunk/src/lib/dns/rdata/generic/dnskey_48.cc
trunk/src/lib/dns/rdata/generic/ds_43.cc
trunk/src/lib/dns/rdata/generic/mx_15.cc
trunk/src/lib/dns/rdata/generic/nsec3_50.cc
trunk/src/lib/dns/rdata/generic/nsec3param_51.cc
trunk/src/lib/dns/rdata/generic/nsec_47.cc
trunk/src/lib/dns/rdata/generic/opt_41.cc
trunk/src/lib/dns/rdata/generic/rrsig_46.cc
trunk/src/lib/dns/rdata/generic/soa_6.cc
trunk/src/lib/dns/rdata/generic/txt_16.cc
trunk/src/lib/dns/rdata/hs_4/a_1.cc
trunk/src/lib/dns/rdata/in_1/a_1.cc
trunk/src/lib/dns/rdata/in_1/aaaa_28.cc
trunk/src/lib/dns/rrclass.cc
trunk/src/lib/dns/rrparamregistry-placeholder.cc
trunk/src/lib/dns/rrset.cc
trunk/src/lib/dns/rrsetlist.cc
trunk/src/lib/dns/rrttl.cc
trunk/src/lib/dns/rrtype.cc
trunk/src/lib/exceptions/exceptions.h
trunk/src/lib/exceptions/exceptions_unittest.cc
Modified: trunk/src/lib/auth/data_source.cc
==============================================================================
--- trunk/src/lib/auth/data_source.cc (original)
+++ trunk/src/lib/auth/data_source.cc Sun Mar 7 07:06:42 2010
@@ -587,7 +587,7 @@
continue;
default:
- dns_throw (Unexpected, "unexpected query state");
+ isc_throw (Unexpected, "unexpected query state");
}
} else if (result == ERROR || result == NOT_IMPLEMENTED) {
m.setRcode(Rcode::SERVFAIL());
@@ -773,7 +773,7 @@
MetaDataSrc::addDataSrc(ConstDataSrcPtr data_src)
{
if (getClass() != RRClass::ANY() && data_src->getClass() != getClass()) {
- dns_throw(Unexpected, "class mismatch");
+ isc_throw(Unexpected, "class mismatch");
}
data_sources.push_back(data_src);
Modified: trunk/src/lib/auth/query.cc
==============================================================================
--- trunk/src/lib/auth/query.cc (original)
+++ trunk/src/lib/auth/query.cc Sun Mar 7 07:06:42 2010
@@ -60,7 +60,7 @@
state(GETANSWER), flags(0)
{
if (op != SIMPLE_QUERY) {
- dns_throw(Unexpected, "invalid constructor for this task operation");
+ isc_throw(Unexpected, "invalid constructor for this task operation");
}
}
@@ -71,7 +71,7 @@
op(o), state(GETANSWER), flags(0)
{
if (op != REF_QUERY) {
- dns_throw(Unexpected, "invalid constructor for this task operation");
+ isc_throw(Unexpected, "invalid constructor for this task operation");
}
}
@@ -82,7 +82,7 @@
state(st), flags(0)
{
if (op != GLUE_QUERY && op != NOGLUE_QUERY) {
- dns_throw(Unexpected, "invalid constructor for this task operation");
+ isc_throw(Unexpected, "invalid constructor for this task operation");
}
}
@@ -94,7 +94,7 @@
{
// Check message formatting
if (message_->getRRCount(Section::QUESTION()) != 1) {
- dns_throw(Unexpected, "malformed message: too many questions");
+ isc_throw(Unexpected, "malformed message: too many questions");
}
// Populate the query task queue with the initial question
Modified: trunk/src/lib/cc/data.cc
==============================================================================
--- trunk/src/lib/cc/data.cc (original)
+++ trunk/src/lib/cc/data.cc Sun Mar 7 07:06:42 2010
@@ -1009,7 +1009,7 @@
return;
}
if (a->getType() != Element::map || b->getType() != Element::map) {
- dns_throw(TypeError, "Non-map Elements passed to removeIdentical");
+ isc_throw(TypeError, "Non-map Elements passed to removeIdentical");
}
std::map<std::string, ElementPtr> m = a->mapValue();
@@ -1028,7 +1028,7 @@
{
if (element->getType() != Element::map ||
other->getType() != Element::map) {
- dns_throw(TypeError, "merge arguments not MapElements");
+ isc_throw(TypeError, "merge arguments not MapElements");
}
std::map<std::string, ElementPtr> m = other->mapValue();
Modified: trunk/src/lib/cc/data.h
==============================================================================
--- trunk/src/lib/cc/data.h (original)
+++ trunk/src/lib/cc/data.h Sun Mar 7 07:06:42 2010
@@ -138,12 +138,12 @@
/// If you want an exception-safe getter method, use
/// getValue() below
//@{
- virtual int intValue() { dns_throw(TypeError, "intValue() called on non-integer Element"); };
- virtual double doubleValue() { dns_throw(TypeError, "doubleValue() called on non-double Element"); };
- virtual bool boolValue() { dns_throw(TypeError, "boolValue() called on non-Bool Element"); };
- virtual std::string stringValue() { dns_throw(TypeError, "stringValue() called on non-string Element"); };
- virtual const std::vector<boost::shared_ptr<Element> >& listValue() { dns_throw(TypeError, "listValue() called on non-list Element"); }; // replace with real exception or empty vector?
- virtual const std::map<std::string, boost::shared_ptr<Element> >& mapValue() { dns_throw(TypeError, "mapValue() called on non-map Element"); }; // replace with real exception or empty map?
+ virtual int intValue() { isc_throw(TypeError, "intValue() called on non-integer Element"); };
+ virtual double doubleValue() { isc_throw(TypeError, "doubleValue() called on non-double Element"); };
+ virtual bool boolValue() { isc_throw(TypeError, "boolValue() called on non-Bool Element"); };
+ virtual std::string stringValue() { isc_throw(TypeError, "stringValue() called on non-string Element"); };
+ virtual const std::vector<boost::shared_ptr<Element> >& listValue() { isc_throw(TypeError, "listValue() called on non-list Element"); }; // replace with real exception or empty vector?
+ virtual const std::map<std::string, boost::shared_ptr<Element> >& mapValue() { isc_throw(TypeError, "mapValue() called on non-map Element"); }; // replace with real exception or empty map?
//@}
/// \name Exception-safe getters
@@ -190,21 +190,21 @@
/// Returns the ElementPtr at the given index. If the index is out
/// of bounds, this function throws an std::out_of_range exception.
/// \param i The position of the ElementPtr to return
- virtual ElementPtr get(const int i) { dns_throw(TypeError, "get(int) called on a non-list Element"); };
+ virtual ElementPtr get(const int i) { isc_throw(TypeError, "get(int) called on a non-list Element"); };
/// Sets the ElementPtr at the given index. If the index is out
/// of bounds, this function throws an std::out_of_range exception.
/// \param i The position of the ElementPtr to set
/// \param element The ElementPtr to set at the position
- virtual void set(const size_t i, ElementPtr element) { dns_throw(TypeError, "set(int, element) called on a non-list Element"); };
+ virtual void set(const size_t i, ElementPtr element) { isc_throw(TypeError, "set(int, element) called on a non-list Element"); };
/// Adds an ElementPtr to the list
/// \param element The ElementPtr to add
- virtual void add(ElementPtr element) { dns_throw(TypeError, "add() called on a non-list Element"); };
+ virtual void add(ElementPtr element) { isc_throw(TypeError, "add() called on a non-list Element"); };
/// Removes the element at the given position. If the index is out
/// of nothing happens.
/// \param i The index of the element to remove.
- virtual void remove(const int i) { dns_throw(TypeError, "remove(int) called on a non-list Element"); };
+ virtual void remove(const int i) { isc_throw(TypeError, "remove(int) called on a non-list Element"); };
/// Returns the number of elements in the list.
- virtual size_t size() { dns_throw(TypeError, "size() called on a non-list Element"); };
+ virtual size_t size() { isc_throw(TypeError, "size() called on a non-list Element"); };
//@}
/// \name MapElement functions
@@ -215,17 +215,17 @@
/// Returns the ElementPtr at the given key
/// \param name The key of the Element to return
/// \return The ElementPtr at the given key
- virtual ElementPtr get(const std::string& name) { dns_throw(TypeError, "get(string) called on a non-map Element"); } ;
+ virtual ElementPtr get(const std::string& name) { isc_throw(TypeError, "get(string) called on a non-map Element"); } ;
/// Sets the ElementPtr at the given key
/// \param name The key of the Element to set
- virtual void set(const std::string& name, ElementPtr element) { dns_throw(TypeError, "set(name, element) called on a non-map Element"); };
+ virtual void set(const std::string& name, ElementPtr element) { isc_throw(TypeError, "set(name, element) called on a non-map Element"); };
/// Remove the ElementPtr at the given key
/// \param name The key of the Element to remove
- virtual void remove(const std::string& name) { dns_throw(TypeError, "remove(string) called on a non-map Element"); };
+ virtual void remove(const std::string& name) { isc_throw(TypeError, "remove(string) called on a non-map Element"); };
/// Checks if there is data at the given key
/// \param name The key of the Element to remove
/// \return true if there is data at the key, false if not.
- virtual bool contains(const std::string& name) { dns_throw(TypeError, "contains(string) called on a non-map Element"); }
+ virtual bool contains(const std::string& name) { isc_throw(TypeError, "contains(string) called on a non-map Element"); }
/// Recursively finds any data at the given identifier. The
/// identifier is a /-separated list of names of nested maps, with
/// the last name being the leaf that is returned.
@@ -239,7 +239,7 @@
/// \return The ElementPtr at the given identifier. Returns a
/// null ElementPtr if it is not found, which can be checked with
/// Element::is_null(ElementPtr e).
- virtual ElementPtr find(const std::string& identifier) { dns_throw(TypeError, "find(string) called on a non-map Element"); };
+ virtual ElementPtr find(const std::string& identifier) { isc_throw(TypeError, "find(string) called on a non-map Element"); };
/// See \c Element::find()
/// \param identifier The identifier of the element to find
/// \param t Reference to store the resulting ElementPtr, if found.
Modified: trunk/src/lib/config/ccsession.cc
==============================================================================
--- trunk/src/lib/config/ccsession.cc (original)
+++ trunk/src/lib/config/ccsession.cc Sun Mar 7 07:06:42 2010
@@ -86,13 +86,13 @@
{
if (!msg->contains("result")) {
// TODO: raise CCSessionError exception
- dns_throw(CCSessionError, "No result in answer message");
+ isc_throw(CCSessionError, "No result in answer message");
} else {
ElementPtr result = msg->get("result");
if (result->get(0)->getType() != Element::integer) {
- dns_throw(CCSessionError, "First element of result is not an rcode in answer message");
+ isc_throw(CCSessionError, "First element of result is not an rcode in answer message");
} else if (result->get(0)->intValue() != 0 && result->get(1)->getType() != Element::string) {
- dns_throw(CCSessionError, "Rcode in answer message is non-zero, but other argument is not a StringElement");
+ isc_throw(CCSessionError, "Rcode in answer message is non-zero, but other argument is not a StringElement");
}
rcode = result->get(0)->intValue();
if (result->size() > 1) {
Modified: trunk/src/lib/config/config_data.cc
==============================================================================
--- trunk/src/lib/config/config_data.cc (original)
+++ trunk/src/lib/config/config_data.cc Sun Mar 7 07:06:42 2010
@@ -31,12 +31,12 @@
{
//std::cout << "[XX] find_spec_part for " << identifier << std::endl;
if (!spec) {
- dns_throw(DataNotFoundError, "Empty specification");
+ isc_throw(DataNotFoundError, "Empty specification");
}
//std::cout << "in: " << std::endl << spec << std::endl;
ElementPtr spec_part = spec;
if (identifier == "") {
- dns_throw(DataNotFoundError, "Empty identifier");
+ isc_throw(DataNotFoundError, "Empty identifier");
}
std::string id = identifier;
size_t sep = id.find('/');
@@ -54,7 +54,7 @@
}
}
if (!found) {
- dns_throw(DataNotFoundError, identifier);
+ isc_throw(DataNotFoundError, identifier);
}
}
id = id.substr(sep + 1);
@@ -72,7 +72,7 @@
}
}
if (!found) {
- dns_throw(DataNotFoundError, identifier);
+ isc_throw(DataNotFoundError, identifier);
}
} else if (spec_part->getType() == Element::map) {
if (spec_part->contains("map_item_spec")) {
@@ -86,10 +86,10 @@
}
}
if (!found) {
- dns_throw(DataNotFoundError, identifier);
+ isc_throw(DataNotFoundError, identifier);
}
} else {
- dns_throw(DataNotFoundError, identifier);
+ isc_throw(DataNotFoundError, identifier);
}
}
}
Modified: trunk/src/lib/dns/base32.cc
==============================================================================
--- trunk/src/lib/dns/base32.cc (original)
+++ trunk/src/lib/dns/base32.cc Sun Mar 7 07:06:42 2010
@@ -129,7 +129,7 @@
// base32 text should be a multiple of 8 bytes long
if (comp.str().length() % 8 != 0) {
- dns_throw (BadBase32String, "Invalid length");
+ isc_throw (BadBase32String, "Invalid length");
}
istringstream iss(comp.str());
@@ -140,7 +140,7 @@
iss >> setw(8) >> group;
if (iss.bad() || iss.fail()) {
- dns_throw (BadBase32String, "Could not parse base32 input");
+ isc_throw (BadBase32String, "Could not parse base32 input");
}
uint8_t octet = 0;
@@ -149,7 +149,7 @@
int value;
if (c != '=' && seenpad) {
- dns_throw (BadBase32String, "Invalid base32 input");
+ isc_throw (BadBase32String, "Invalid base32 input");
} else
if (c == '=' && !seenpad) {
@@ -158,7 +158,7 @@
} else {
const char* pos = strchr(base32hex, c);
if (!pos) {
- dns_throw (BadBase32String, "Invalid base32 input");
+ isc_throw (BadBase32String, "Invalid base32 input");
}
value = pos - base32hex;
assert (value < 32);
Modified: trunk/src/lib/dns/base64.cc
==============================================================================
--- trunk/src/lib/dns/base64.cc (original)
+++ trunk/src/lib/dns/base64.cc Sun Mar 7 07:06:42 2010
@@ -150,7 +150,7 @@
char ch = *srit;
if (ch == BASE64_PADDING_CHAR) {
if (++padlen > BASE64_MAX_PADDING_CHARS) {
- dns_throw(BadBase64String,
+ isc_throw(BadBase64String,
"Too many Base64 padding characters");
}
} else if (!isspace(ch)) {
@@ -167,7 +167,7 @@
base64.end(),
base64.end())));
} catch (dataflow_exception& ex) {
- dns_throw(BadBase64String, ex.what());
+ isc_throw(BadBase64String, ex.what());
}
// Confirm the original base64 text is the canonical encoding of the
@@ -176,7 +176,7 @@
vector<uint8_t>::const_reverse_iterator rit = result.rbegin();
for (int i = 0; i < padlen; ++i, ++rit) {
if (*rit != 0) {
- dns_throw(BadBase64String, "Non 0 bits included in padding");
+ isc_throw(BadBase64String, "Non 0 bits included in padding");
}
}
Modified: trunk/src/lib/dns/buffer.h
==============================================================================
--- trunk/src/lib/dns/buffer.h (original)
+++ trunk/src/lib/dns/buffer.h Sun Mar 7 07:06:42 2010
@@ -123,7 +123,7 @@
void setPosition(size_t position)
{
if (position > len_)
- dns_throw(InvalidBufferPosition, "position is too large");
+ isc_throw(InvalidBufferPosition, "position is too large");
position_ = position;
}
//@}
@@ -138,7 +138,7 @@
uint8_t readUint8()
{
if (position_ + sizeof(uint8_t) > len_) {
- dns_throw(InvalidBufferPosition, "read beyond end of buffer");
+ isc_throw(InvalidBufferPosition, "read beyond end of buffer");
}
return (data_[position_++]);
@@ -154,7 +154,7 @@
const uint8_t* cp;
if (position_ + sizeof(data) > len_) {
- dns_throw(InvalidBufferPosition, "read beyond end of buffer");
+ isc_throw(InvalidBufferPosition, "read beyond end of buffer");
}
cp = &data_[position_];
@@ -175,7 +175,7 @@
const uint8_t* cp;
if (position_ + sizeof(data) > len_) {
- dns_throw(InvalidBufferPosition, "read beyond end of buffer");
+ isc_throw(InvalidBufferPosition, "read beyond end of buffer");
}
cp = &data_[position_];
@@ -197,7 +197,7 @@
void readData(void* data, size_t len)
{
if (position_ + len > len_) {
- dns_throw(InvalidBufferPosition, "read beyond end of buffer");
+ isc_throw(InvalidBufferPosition, "read beyond end of buffer");
}
memcpy(data, &data_[position_], len);
@@ -309,7 +309,7 @@
uint8_t operator[](size_t pos) const
{
if (pos >= data_.size()) {
- dns_throw(InvalidBufferPosition, "read at invalid position");
+ isc_throw(InvalidBufferPosition, "read at invalid position");
}
return (data_[pos]);
}
@@ -359,7 +359,7 @@
void writeUint16At(uint16_t data, size_t pos)
{
if (pos + sizeof(data) > data_.size()) {
- dns_throw(InvalidBufferPosition, "write at invalid position");
+ isc_throw(InvalidBufferPosition, "write at invalid position");
}
data_[pos] = static_cast<uint8_t>((data & 0xff00U) >> 8);
Modified: trunk/src/lib/dns/dnstime.cc
==============================================================================
--- trunk/src/lib/dns/dnstime.cc (original)
+++ trunk/src/lib/dns/dnstime.cc Sun Mar 7 07:06:42 2010
@@ -67,7 +67,7 @@
}
ostringstream oss;
oss << "Invalid " << valname << " value: " << value;
- dns_throw(InvalidTime, oss.str().c_str());
+ isc_throw(InvalidTime, oss.str().c_str());
}
static int days[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
@@ -90,7 +90,7 @@
{
ostringstream oss;
oss << "Couldn't convert time value: " << time_txt;
- dns_throw(InvalidTime, oss.str().c_str());
+ isc_throw(InvalidTime, oss.str().c_str());
}
checkRange(1970, 9999, year, "year");
Modified: trunk/src/lib/dns/hex.cc
==============================================================================
--- trunk/src/lib/dns/hex.cc (original)
+++ trunk/src/lib/dns/hex.cc Sun Mar 7 07:06:42 2010
@@ -65,7 +65,7 @@
iss >> c2;
const char* pos = strchr(hexdigits, toupper(c2));
if (!pos) {
- dns_throw (BadHexString, "Invalid hex digit");
+ isc_throw (BadHexString, "Invalid hex digit");
}
n = pos - hexdigits;
@@ -77,7 +77,7 @@
const char* pos1 = strchr(hexdigits, toupper(c1));
const char* pos2 = strchr(hexdigits, toupper(c2));
if (!pos1 || !pos2) {
- dns_throw (BadHexString, "Invalid hex digit");
+ isc_throw (BadHexString, "Invalid hex digit");
}
n = (pos1 - hexdigits) << 4;
Modified: trunk/src/lib/dns/message.cc
==============================================================================
--- trunk/src/lib/dns/message.cc (original)
+++ trunk/src/lib/dns/message.cc Sun Mar 7 07:06:42 2010
@@ -162,7 +162,7 @@
Rcode::Rcode(uint16_t code) : code_(code)
{
if (code_ > MAX_RCODE) {
- dns_throw(OutOfRange, "Rcode is too large to construct");
+ isc_throw(OutOfRange, "Rcode is too large to construct");
}
}
@@ -287,7 +287,7 @@
Message::setDNSSECSupported(bool on)
{
if (impl_->mode_ != Message::RENDER) {
- dns_throw(InvalidMessageOperation,
+ isc_throw(InvalidMessageOperation,
"setDNSSECSupported performed in non-render mode");
}
impl_->dnssec_ok_ = on;
@@ -303,11 +303,11 @@
Message::setUDPSize(uint16_t size)
{
if (impl_->mode_ != Message::RENDER) {
- dns_throw(InvalidMessageOperation,
+ isc_throw(InvalidMessageOperation,
"setUDPSize performed in non-render mode");
}
if (size < DEFAULT_MAX_UDPSIZE) {
- dns_throw(InvalidMessageUDPSize,
+ isc_throw(InvalidMessageUDPSize,
"Specified UDP message size is too small");
}
impl_->udpsize_ = size;
@@ -496,7 +496,7 @@
Message::fromWire(InputBuffer& buffer)
{
if ((buffer.getLength() - buffer.getPosition()) < HEADERLEN) {
- dns_throw(MessageTooShort, "");
+ isc_throw(MessageTooShort, "");
}
impl_->qid_ = buffer.readUint16();
@@ -531,7 +531,7 @@
if ((buffer.getLength() - buffer.getPosition()) <
2 * sizeof(uint16_t)) {
- dns_throw(MessageTooShort, "");
+ isc_throw(MessageTooShort, "");
}
RRType rrtype(buffer.readUint16());
RRClass rrclass(buffer.readUint16());
@@ -575,7 +575,7 @@
// buffer must store at least RR TYPE, RR CLASS, TTL, and RDLEN.
if ((buffer.getLength() - buffer.getPosition()) <
3 * sizeof(uint16_t) + sizeof(uint32_t)) {
- dns_throw(MessageTooShort, "");
+ isc_throw(MessageTooShort, "");
}
RRType rrtype(buffer.readUint16());
@@ -589,11 +589,11 @@
// implementation. We'll revisit this part later.
if (rrtype == RRType::OPT()) {
if (section != Section::ADDITIONAL()) {
- dns_throw(DNSMessageFORMERR,
+ isc_throw(DNSMessageFORMERR,
"EDNS OPT RR found in an invalid section");
}
if (remote_edns_ != NULL) {
- dns_throw(DNSMessageFORMERR, "multiple EDNS OPT RR found");
+ isc_throw(DNSMessageFORMERR, "multiple EDNS OPT RR found");
}
if (((ttl.getValue() & EDNSVERSION_MASK) >> 16) >
Message::EDNS_SUPPORTED_VERSION) {
@@ -603,10 +603,10 @@
// This is probably because why BIND 9 does the version check
// in the client code.
// This is a TODO item. Right now we simply reject it.
- dns_throw(DNSMessageBADVERS, "unsupported EDNS version");
+ isc_throw(DNSMessageBADVERS, "unsupported EDNS version");
}
if (name != Name::ROOT_NAME()) {
- dns_throw(DNSMessageFORMERR,
+ isc_throw(DNSMessageFORMERR,
"invalid owner name for EDNS OPT RR");
}
@@ -770,7 +770,7 @@
Message::makeResponse()
{
if (impl_->mode_ != Message::PARSE) {
- dns_throw(InvalidMessageOperation,
+ isc_throw(InvalidMessageOperation,
"makeResponse() is performed in non-parse mode");
}
@@ -904,7 +904,7 @@
Message::beginSection(const Section& section) const
{
if (section == Section::QUESTION()) {
- dns_throw(InvalidMessageSection, "");
+ isc_throw(InvalidMessageSection, "");
}
return (RRsetIterator(
@@ -916,7 +916,7 @@
Message::endSection(const Section& section) const
{
if (section == Section::QUESTION()) {
- dns_throw(InvalidMessageSection, "");
+ isc_throw(InvalidMessageSection, "");
}
return (RRsetIterator(
Modified: trunk/src/lib/dns/name.cc
==============================================================================
--- trunk/src/lib/dns/name.cc (original)
+++ trunk/src/lib/dns/name.cc Sun Mar 7 07:06:42 2010
@@ -161,7 +161,7 @@
//
if (c == '.') {
if (s != send) {
- dns_throw(EmptyLabel, "non terminating empty label");
+ isc_throw(EmptyLabel, "non terminating empty label");
}
is_root = true;
} else if (c == '@' && s == send) {
@@ -189,7 +189,7 @@
case ft_ordinary:
if (c == '.') {
if (count == 0) {
- dns_throw(EmptyLabel, "duplicate period");
+ isc_throw(EmptyLabel, "duplicate period");
}
ndata.at(offsets.back()) = count;
offsets.push_back(ndata.size());
@@ -202,7 +202,7 @@
state = ft_escape;
} else {
if (++count > MAX_LABELLEN) {
- dns_throw(TooLongLabel, "label is too long");
+ isc_throw(TooLongLabel, "label is too long");
}
ndata.push_back(downcase ? maptolower[c] : c);
}
@@ -211,14 +211,14 @@
if (c == '[') {
// This looks like a bitstring label, which was deprecated.
// Intentionally drop it.
- dns_throw(BadLabelType, "invalid label type");
+ isc_throw(BadLabelType, "invalid label type");
}
state = ft_escape;
// FALLTHROUGH
case ft_escape:
if (!isdigit(c & 0xff)) {
if (++count > MAX_LABELLEN) {
- dns_throw(TooLongLabel, "label is too long");
+ isc_throw(TooLongLabel, "label is too long");
}
ndata.push_back(downcase ? maptolower[c] : c);
state = ft_ordinary;
@@ -230,17 +230,17 @@
// FALLTHROUGH
case ft_escdecimal:
if (!isdigit(c & 0xff)) {
- dns_throw(BadEscape, "mixture of escaped digit and non-digit");
+ isc_throw(BadEscape, "mixture of escaped digit and non-digit");
}
value *= 10;
value += digitvalue[c];
digits++;
if (digits == 3) {
if (value > 255) {
- dns_throw(BadEscape, "escaped decimal is too large");
+ isc_throw(BadEscape, "escaped decimal is too large");
}
if (++count > MAX_LABELLEN) {
- dns_throw(TooLongLabel, "label is too long");
+ isc_throw(TooLongLabel, "label is too long");
}
ndata.push_back(downcase ? maptolower[value] : value);
state = ft_ordinary;
@@ -254,11 +254,11 @@
if (!done) { // no trailing '.' was found.
if (ndata.size() == Name::MAX_WIRE) {
- dns_throw(TooLongName, "name is too long for termination");
+ isc_throw(TooLongName, "name is too long for termination");
}
assert(s == send);
if (state != ft_ordinary && state != ft_at) {
- dns_throw(IncompleteName, "incomplete textual name");
+ isc_throw(IncompleteName, "incomplete textual name");
}
if (state == ft_ordinary) {
assert(count != 0);
@@ -332,7 +332,7 @@
if (c <= MAX_LABELLEN) {
offsets.push_back(nused);
if (nused + c + 1 > Name::MAX_WIRE) {
- dns_throw(TooLongName, "wire name is too long");
+ isc_throw(TooLongName, "wire name is too long");
}
nused += c + 1;
ndata_.push_back(c);
@@ -351,7 +351,7 @@
} else {
// this case includes local compression pointer, which hasn't
// been standardized.
- dns_throw(BadLabelType, "unknown label character");
+ isc_throw(BadLabelType, "unknown label character");
}
break;
case fw_ordinary:
@@ -370,7 +370,7 @@
break;
}
if (new_current >= biggest_pointer) {
- dns_throw(BadPointer, "bad compression pointer: out of range");
+ isc_throw(BadPointer, "bad compression pointer: out of range");
}
biggest_pointer = new_current;
current = new_current;
@@ -384,7 +384,7 @@
}
if (!done) {
- dns_throw(IncompleteName, "incomplete wire-format name");
+ isc_throw(IncompleteName, "incomplete wire-format name");
}
labelcount_ = offsets.size();
@@ -475,7 +475,7 @@
}
}
} else {
- dns_throw(BadLabelType, "unknown label type in name data");
+ isc_throw(BadLabelType, "unknown label type in name data");
}
}
@@ -611,7 +611,7 @@
unsigned int length = this->length_ + suffix.length_ - 1;
if (length > Name::MAX_WIRE) {
- dns_throw(TooLongName, "names are too long to concatenate");
+ isc_throw(TooLongName, "names are too long to concatenate");
}
Name retname;
@@ -675,7 +675,7 @@
Name::split(unsigned int first, unsigned int n) const
{
if (n == 0 || first + n > labelcount_) {
- dns_throw(OutOfRange, "Name::split: invalid split range");
+ isc_throw(OutOfRange, "Name::split: invalid split range");
}
Name retname;
Modified: trunk/src/lib/dns/name.h
==============================================================================
--- trunk/src/lib/dns/name.h (original)
+++ trunk/src/lib/dns/name.h Sun Mar 7 07:06:42 2010
@@ -304,7 +304,7 @@
const uint8_t at(size_t pos) const
{
if (pos >= length_) {
- dns_throw(OutOfRange, "Out of range access in Name::at()");
+ isc_throw(OutOfRange, "Out of range access in Name::at()");
}
return (ndata_[pos]);
}
Modified: trunk/src/lib/dns/rdata.cc
==============================================================================
--- trunk/src/lib/dns/rdata.cc (original)
+++ trunk/src/lib/dns/rdata.cc Sun Mar 7 07:06:42 2010
@@ -58,7 +58,7 @@
InputBuffer& buffer, size_t len)
{
if (len > MAX_RDLENGTH) {
- dns_throw(InvalidRdataLength, "RDLENGTH too large");
+ isc_throw(InvalidRdataLength, "RDLENGTH too large");
}
size_t old_pos = buffer.getPosition();
@@ -68,7 +68,7 @@
len);
if (buffer.getPosition() - old_pos != len) {
- dns_throw(InvalidRdataLength, "RDLENGTH mismatch");
+ isc_throw(InvalidRdataLength, "RDLENGTH mismatch");
}
return (rdata);
@@ -110,7 +110,7 @@
Generic::Generic(InputBuffer& buffer, size_t rdata_len)
{
if (rdata_len > MAX_RDLENGTH) {
- dns_throw(InvalidRdataLength, "RDLENGTH too large");
+ isc_throw(InvalidRdataLength, "RDLENGTH too large");
}
vector<uint8_t> data(rdata_len);
@@ -125,7 +125,7 @@
string unknown_mark;
iss >> unknown_mark;
if (unknown_mark != "\\#") {
- dns_throw(InvalidRdataText,
+ isc_throw(InvalidRdataText,
"Missing the special token (\\#) for generic RDATA encoding");
}
@@ -136,11 +136,11 @@
int32_t rdlen;
iss_rdlen >> rdlen;
if (iss_rdlen.rdstate() != ios::eofbit) {
- dns_throw(InvalidRdataText,
+ isc_throw(InvalidRdataText,
"Invalid representation for a generic RDLENGTH");
}
if (rdlen < 0 || rdlen > 0xffff) {
- dns_throw(InvalidRdataLength, "RDATA length is out of range");
+ isc_throw(InvalidRdataLength, "RDATA length is out of range");
}
iss >> ws; // skip any white spaces
@@ -152,7 +152,7 @@
char buf[2];
iss.read(buf, sizeof(buf));
if ((iss.rdstate() & (ios::badbit | ios::failbit)) != 0) {
- dns_throw(InvalidRdataText,
+ isc_throw(InvalidRdataText,
"Invalid hex encoding of generic RDATA");
}
@@ -161,7 +161,7 @@
unsigned int ch;
iss_byte >> hex >> ch;
if (iss_byte.rdstate() != ios::eofbit) {
- dns_throw(InvalidRdataText,
+ isc_throw(InvalidRdataText,
"Invalid hex encoding of generic RDATA");
}
data.push_back(ch);
@@ -169,12 +169,12 @@
}
if (!iss.eof()) {
- dns_throw(InvalidRdataLength,
+ isc_throw(InvalidRdataLength,
"RDLENGTH is too small for generic RDATA");
}
if (data.size() != rdlen) {
- dns_throw(InvalidRdataLength,
+ isc_throw(InvalidRdataLength,
"Generic RDATA code doesn't match RDLENGTH");
}
Modified: trunk/src/lib/dns/rdata/ch_3/a_1.cc
==============================================================================
--- trunk/src/lib/dns/rdata/ch_3/a_1.cc (original)
+++ trunk/src/lib/dns/rdata/ch_3/a_1.cc Sun Mar 7 07:06:42 2010
@@ -58,7 +58,7 @@
A::toText() const
{
// TBD
- dns_throw(InvalidRdataText, "Not implemented yet");
+ isc_throw(InvalidRdataText, "Not implemented yet");
}
int
Modified: trunk/src/lib/dns/rdata/generic/dnskey_48.cc
==============================================================================
--- trunk/src/lib/dns/rdata/generic/dnskey_48.cc (original)
+++ trunk/src/lib/dns/rdata/generic/dnskey_48.cc Sun Mar 7 07:06:42 2010
@@ -59,23 +59,23 @@
iss >> flags >> protocol >> algorithm >> &keydatabuf;
if (iss.bad() || iss.fail()) {
- dns_throw(InvalidRdataText, "Invalid DNSKEY text");
+ isc_throw(InvalidRdataText, "Invalid DNSKEY text");
}
if (flags > 0xffff) {
- dns_throw(InvalidRdataText, "DNSKEY flags out of range");
+ isc_throw(InvalidRdataText, "DNSKEY flags out of range");
}
if (protocol > 0xff) {
- dns_throw(InvalidRdataText, "DNSKEY protocol out of range");
+ isc_throw(InvalidRdataText, "DNSKEY protocol out of range");
}
if (algorithm > 0xff) {
- dns_throw(InvalidRdataText, "DNSKEY algorithm out of range");
+ isc_throw(InvalidRdataText, "DNSKEY algorithm out of range");
}
vector<uint8_t> keydata;
decodeBase64(keydatabuf.str(), keydata);
if (algorithm == 1 && keydata.size() < 3) {
- dns_throw(InvalidRdataLength, "DNSKEY keydata too short");
+ isc_throw(InvalidRdataLength, "DNSKEY keydata too short");
}
impl_ = new DNSKEYImpl(flags, protocol, algorithm, keydata);
@@ -84,7 +84,7 @@
DNSKEY::DNSKEY(InputBuffer& buffer, size_t rdata_len)
{
if (rdata_len < 4) {
- dns_throw(InvalidRdataLength, "DNSKEY too short");
+ isc_throw(InvalidRdataLength, "DNSKEY too short");
}
uint16_t flags = buffer.readUint16();
Modified: trunk/src/lib/dns/rdata/generic/ds_43.cc
==============================================================================
--- trunk/src/lib/dns/rdata/generic/ds_43.cc (original)
+++ trunk/src/lib/dns/rdata/generic/ds_43.cc Sun Mar 7 07:06:42 2010
@@ -58,16 +58,16 @@
iss >> tag >> algorithm >> digest_type >> &digestbuf;
if (iss.bad() || iss.fail()) {
- dns_throw(InvalidRdataText, "Invalid DS text");
+ isc_throw(InvalidRdataText, "Invalid DS text");
}
if (tag > 0xffff) {
- dns_throw(InvalidRdataText, "DS tag out of range");
+ isc_throw(InvalidRdataText, "DS tag out of range");
}
if (algorithm > 0xff) {
- dns_throw(InvalidRdataText, "DS algorithm out of range");
+ isc_throw(InvalidRdataText, "DS algorithm out of range");
}
if (digest_type > 0xff) {
- dns_throw(InvalidRdataText, "DS digest type out of range");
+ isc_throw(InvalidRdataText, "DS digest type out of range");
}
vector<uint8_t> digest;
@@ -79,7 +79,7 @@
DS::DS(InputBuffer& buffer, size_t rdata_len)
{
if (rdata_len < 4) {
- dns_throw(InvalidRdataLength, "DS too short");
+ isc_throw(InvalidRdataLength, "DS too short");
}
uint16_t tag = buffer.readUint16();
Modified: trunk/src/lib/dns/rdata/generic/mx_15.cc
==============================================================================
--- trunk/src/lib/dns/rdata/generic/mx_15.cc (original)
+++ trunk/src/lib/dns/rdata/generic/mx_15.cc Sun Mar 7 07:06:42 2010
@@ -48,7 +48,7 @@
iss >> pref >> mxname;
if (iss.bad() || iss.fail() || !iss.eof()) {
- dns_throw(InvalidRdataText, "Invalid MX text format");
+ isc_throw(InvalidRdataText, "Invalid MX text format");
}
preference_ = pref;
Modified: trunk/src/lib/dns/rdata/generic/nsec3_50.cc
==============================================================================
--- trunk/src/lib/dns/rdata/generic/nsec3_50.cc (original)
+++ trunk/src/lib/dns/rdata/generic/nsec3_50.cc Sun Mar 7 07:06:42 2010
@@ -65,16 +65,16 @@
iss >> hashalg >> flags >> iterations >> salthex;
if (iss.bad() || iss.fail()) {
- dns_throw(InvalidRdataText, "Invalid NSEC3 text");
+ isc_throw(InvalidRdataText, "Invalid NSEC3 text");
}
if (hashalg > 0xf) {
- dns_throw(InvalidRdataText, "NSEC3 hash algorithm out of range");
+ isc_throw(InvalidRdataText, "NSEC3 hash algorithm out of range");
}
if (flags > 0xff) {
- dns_throw(InvalidRdataText, "NSEC3 flags out of range");
+ isc_throw(InvalidRdataText, "NSEC3 flags out of range");
}
if (iterations > 0xffff) {
- dns_throw(InvalidRdataText, "NSEC3 iterations out of range");
+ isc_throw(InvalidRdataText, "NSEC3 iterations out of range");
}
vector<uint8_t> salt;
@@ -84,7 +84,7 @@
iss >> setw(32) >> nextstr;
vector<uint8_t> next;
if (iss.bad() || iss.fail()) {
- dns_throw(InvalidRdataText, "Invalid NSEC3 hash algorithm");
+ isc_throw(InvalidRdataText, "Invalid NSEC3 hash algorithm");
}
decodeBase32(nextstr, next);
@@ -101,7 +101,7 @@
code = RRType(type).getCode();
bitmap[code / 8] |= (0x80 >> (code % 8));
} catch (...) {
- dns_throw(InvalidRdataText, "Invalid RRtype in NSEC3");
+ isc_throw(InvalidRdataText, "Invalid RRtype in NSEC3");
}
}
} while(!iss.eof());
@@ -128,7 +128,7 @@
NSEC3::NSEC3(InputBuffer& buffer, size_t rdata_len)
{
if (rdata_len < 5) {
- dns_throw(InvalidRdataLength, "NSEC3 too short");
+ isc_throw(InvalidRdataLength, "NSEC3 too short");
}
uint8_t hashalg = buffer.readUint8();
@@ -140,7 +140,7 @@
--rdata_len;
if (rdata_len < saltlen) {
- dns_throw(InvalidRdataLength, "NSEC3 salt too short");
+ isc_throw(InvalidRdataLength, "NSEC3 salt too short");
}
vector<uint8_t> salt(saltlen);
@@ -151,7 +151,7 @@
--rdata_len;
if (rdata_len < nextlen) {
- dns_throw(InvalidRdataLength, "NSEC3 next hash too short");
+ isc_throw(InvalidRdataLength, "NSEC3 next hash too short");
}
vector<uint8_t> next(nextlen);
@@ -159,7 +159,7 @@
rdata_len -= nextlen;
if (rdata_len == 0) {
- dns_throw(InvalidRdataLength, "NSEC3 type bitmap too short");
+ isc_throw(InvalidRdataLength, "NSEC3 type bitmap too short");
}
// FIXIT: we cannot naively copy the data because the bitmaps have
Modified: trunk/src/lib/dns/rdata/generic/nsec3param_51.cc
==============================================================================
--- trunk/src/lib/dns/rdata/generic/nsec3param_51.cc (original)
+++ trunk/src/lib/dns/rdata/generic/nsec3param_51.cc Sun Mar 7 07:06:42 2010
@@ -57,13 +57,13 @@
iss >> hashalg >> flags >> iterations >> &saltbuf;
if (iss.bad() || iss.fail()) {
- dns_throw(InvalidRdataText, "Invalid NSEC3PARAM text");
+ isc_throw(InvalidRdataText, "Invalid NSEC3PARAM text");
}
if (hashalg > 0xf) {
- dns_throw(InvalidRdataText, "NSEC3PARAM hash algorithm out of range");
+ isc_throw(InvalidRdataText, "NSEC3PARAM hash algorithm out of range");
}
if (flags > 0xff) {
- dns_throw(InvalidRdataText, "NSEC3PARAM flags out of range");
+ isc_throw(InvalidRdataText, "NSEC3PARAM flags out of range");
}
vector<uint8_t> salt;
@@ -75,7 +75,7 @@
NSEC3PARAM::NSEC3PARAM(InputBuffer& buffer, size_t rdata_len)
{
if (rdata_len < 4) {
- dns_throw(InvalidRdataLength, "NSEC3PARAM too short");
+ isc_throw(InvalidRdataLength, "NSEC3PARAM too short");
}
uint8_t hashalg = buffer.readUint8();
@@ -87,7 +87,7 @@
--rdata_len;
if (rdata_len < saltlen) {
- dns_throw(InvalidRdataLength, "NSEC3PARAM salt too short");
+ isc_throw(InvalidRdataLength, "NSEC3PARAM salt too short");
}
vector<uint8_t> salt(saltlen);
Modified: trunk/src/lib/dns/rdata/generic/nsec_47.cc
==============================================================================
--- trunk/src/lib/dns/rdata/generic/nsec_47.cc (original)
+++ trunk/src/lib/dns/rdata/generic/nsec_47.cc Sun Mar 7 07:06:42 2010
@@ -56,7 +56,7 @@
iss >> nextname;
if (iss.bad() || iss.fail()) {
- dns_throw(InvalidRdataText, "Invalid NSEC name");
+ isc_throw(InvalidRdataText, "Invalid NSEC name");
}
memset(bitmap, 0, sizeof(bitmap));
@@ -68,7 +68,7 @@
code = RRType(type).getCode();
bitmap[code / 8] |= (0x80 >> (code % 8));
} catch (...) {
- dns_throw(InvalidRdataText, "Invalid RRtype in NSEC");
+ isc_throw(InvalidRdataText, "Invalid RRtype in NSEC");
}
} while(!iss.eof());
@@ -98,7 +98,7 @@
// rdata_len must be sufficiently large to hold non empty bitmap.
if (rdata_len <= buffer.getPosition() - pos) {
- dns_throw(InvalidRdataLength, "NSEC too short");
+ isc_throw(InvalidRdataLength, "NSEC too short");
}
rdata_len -= (buffer.getPosition() - pos);
Modified: trunk/src/lib/dns/rdata/generic/opt_41.cc
==============================================================================
--- trunk/src/lib/dns/rdata/generic/opt_41.cc (original)
+++ trunk/src/lib/dns/rdata/generic/opt_41.cc Sun Mar 7 07:06:42 2010
@@ -27,7 +27,7 @@
OPT::OPT(const string& type_str)
{
- dns_throw(InvalidRdataText, "OPT RR cannot be constructed from text");
+ isc_throw(InvalidRdataText, "OPT RR cannot be constructed from text");
}
OPT::OPT(InputBuffer& buffer, size_t rdata_len)
@@ -35,7 +35,7 @@
// setPosition() will throw against a short buffer anyway, but it's safer
// to check it explicitly here.
if (buffer.getLength() - buffer.getPosition() < rdata_len) {
- dns_throw(InvalidRdataLength, "RDLEN of OPT is too large");
+ isc_throw(InvalidRdataLength, "RDLEN of OPT is too large");
}
// This simple implementation ignores any options
Modified: trunk/src/lib/dns/rdata/generic/rrsig_46.cc
==============================================================================
--- trunk/src/lib/dns/rdata/generic/rrsig_46.cc (original)
+++ trunk/src/lib/dns/rdata/generic/rrsig_46.cc Sun Mar 7 07:06:42 2010
@@ -85,13 +85,13 @@
>> expire_txt >> inception_txt >> tag >> signer_txt
>> &signaturebuf;
if (iss.bad() || iss.fail()) {
- dns_throw(InvalidRdataText, "Invalid RRSIG text");
+ isc_throw(InvalidRdataText, "Invalid RRSIG text");
}
if (algorithm > 0xff) {
- dns_throw(InvalidRdataText, "RRSIG algorithm out of range");
+ isc_throw(InvalidRdataText, "RRSIG algorithm out of range");
}
if (labels > 0xff) {
- dns_throw(InvalidRdataText, "RRSIG labels out of range");
+ isc_throw(InvalidRdataText, "RRSIG labels out of range");
}
uint32_t timeexpire = DNSSECTimeFromText(expire_txt);
@@ -110,7 +110,7 @@
size_t pos = buffer.getPosition();
if (rdata_len < RRSIG_MINIMUM_LEN) {
- dns_throw(InvalidRdataLength, "RRSIG too short");
+ isc_throw(InvalidRdataLength, "RRSIG too short");
}
RRType covered(buffer);
@@ -124,7 +124,7 @@
// rdata_len must be sufficiently large to hold non empty signature data.
if (rdata_len <= buffer.getPosition() - pos) {
- dns_throw(InvalidRdataLength, "RRSIG too short");
+ isc_throw(InvalidRdataLength, "RRSIG too short");
}
rdata_len -= (buffer.getPosition() - pos);
Modified: trunk/src/lib/dns/rdata/generic/soa_6.cc
==============================================================================
--- trunk/src/lib/dns/rdata/generic/soa_6.cc (original)
+++ trunk/src/lib/dns/rdata/generic/soa_6.cc Sun Mar 7 07:06:42 2010
@@ -47,19 +47,19 @@
iss >> token;
if (iss.bad() || iss.fail()) {
- dns_throw(InvalidRdataText, "Invalid SOA MNAME");
+ isc_throw(InvalidRdataText, "Invalid SOA MNAME");
}
mname_ = Name(token);
iss >> token;
if (iss.bad() || iss.fail()) {
- dns_throw(InvalidRdataText, "Invalid SOA RNAME");
+ isc_throw(InvalidRdataText, "Invalid SOA RNAME");
}
rname_ = Name(token);
uint32_t serial, refresh, retry, expire, minimum;
iss >> serial >> refresh >> retry >> expire >> minimum;
if (iss.rdstate() != ios::eofbit) {
- dns_throw(InvalidRdataText, "Invalid SOA format");
+ isc_throw(InvalidRdataText, "Invalid SOA format");
}
OutputBuffer buffer(20);
buffer.writeUint32(serial);
Modified: trunk/src/lib/dns/rdata/generic/txt_16.cc
==============================================================================
--- trunk/src/lib/dns/rdata/generic/txt_16.cc (original)
+++ trunk/src/lib/dns/rdata/generic/txt_16.cc Sun Mar 7 07:06:42 2010
@@ -53,7 +53,7 @@
length -= 2;
}
if (length > MAX_CHARSTRING_LEN) {
- dns_throw(CharStringTooLong, "");
+ isc_throw(CharStringTooLong, "");
}
vector<uint8_t> data;
Modified: trunk/src/lib/dns/rdata/hs_4/a_1.cc
==============================================================================
--- trunk/src/lib/dns/rdata/hs_4/a_1.cc (original)
+++ trunk/src/lib/dns/rdata/hs_4/a_1.cc Sun Mar 7 07:06:42 2010
@@ -58,7 +58,7 @@
A::toText() const
{
// TBD
- dns_throw(InvalidRdataText, "Not implemented yet");
+ isc_throw(InvalidRdataText, "Not implemented yet");
}
int
Modified: trunk/src/lib/dns/rdata/in_1/a_1.cc
==============================================================================
--- trunk/src/lib/dns/rdata/in_1/a_1.cc (original)
+++ trunk/src/lib/dns/rdata/in_1/a_1.cc Sun Mar 7 07:06:42 2010
@@ -40,7 +40,7 @@
// This is exactly what inet_pton() accepts for AF_INET. In particular,
// it rejects an abbreviated form such as "10.1" meaning "10.0.0.1".
if (inet_pton(AF_INET, addrstr.c_str(), &addr_) != 1) {
- dns_throw(InvalidRdataText,
+ isc_throw(InvalidRdataText,
"failed to parse IPv4 address for IN/A RDATA");
}
}
@@ -48,7 +48,7 @@
A::A(InputBuffer& buffer, size_t rdata_len)
{
if (rdata_len != sizeof(addr_)) {
- dns_throw(InvalidRdataLength, "Length mismatch for IN/A RDATA");
+ isc_throw(InvalidRdataLength, "Length mismatch for IN/A RDATA");
}
buffer.readData(&addr_, sizeof(addr_));
}
@@ -75,7 +75,7 @@
char addr_string[sizeof("255.255.255.255")];
if (inet_ntop(AF_INET, &addr_, addr_string, sizeof(addr_string)) == NULL) {
- dns_throw(Unexpected, "inet_ntop failed for an IPv4 address");
+ isc_throw(Unexpected, "inet_ntop failed for an IPv4 address");
}
return (string(addr_string));
Modified: trunk/src/lib/dns/rdata/in_1/aaaa_28.cc
==============================================================================
--- trunk/src/lib/dns/rdata/in_1/aaaa_28.cc (original)
+++ trunk/src/lib/dns/rdata/in_1/aaaa_28.cc Sun Mar 7 07:06:42 2010
@@ -36,7 +36,7 @@
AAAA::AAAA(const string& addrstr)
{
if (inet_pton(AF_INET6, addrstr.c_str(), &addr_) != 1) {
- dns_throw(InvalidRdataText,
+ isc_throw(InvalidRdataText,
"failed to parse IPv6 address for IN/AAAA RDATA");
}
}
@@ -44,7 +44,7 @@
AAAA::AAAA(InputBuffer& buffer, size_t rdata_len)
{
if (rdata_len != sizeof(addr_)) {
- dns_throw(InvalidRdataLength, "Length mismatch for IN/AAAA RDATA");
+ isc_throw(InvalidRdataLength, "Length mismatch for IN/AAAA RDATA");
}
buffer.readData(&addr_, sizeof(addr_));
}
@@ -72,7 +72,7 @@
char addr_string[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")];
if (inet_ntop(AF_INET6, &addr_, addr_string, sizeof(addr_string)) == NULL) {
- dns_throw(Unexpected, "inet_ntop failed for an IPv6 address");
+ isc_throw(Unexpected, "inet_ntop failed for an IPv6 address");
}
return (string(addr_string));
Modified: trunk/src/lib/dns/rrclass.cc
==============================================================================
--- trunk/src/lib/dns/rrclass.cc (original)
+++ trunk/src/lib/dns/rrclass.cc Sun Mar 7 07:06:42 2010
@@ -38,7 +38,7 @@
RRClass::RRClass(InputBuffer& buffer)
{
if (buffer.getLength() - buffer.getPosition() < sizeof(uint16_t)) {
- dns_throw(IncompleteRRClass, "incomplete wire-format RR class");
+ isc_throw(IncompleteRRClass, "incomplete wire-format RR class");
}
classcode_ = buffer.readUint16();
}
Modified: trunk/src/lib/dns/rrparamregistry-placeholder.cc
==============================================================================
--- trunk/src/lib/dns/rrparamregistry-placeholder.cc (original)
+++ trunk/src/lib/dns/rrparamregistry-placeholder.cc Sun Mar 7 07:06:42 2010
@@ -352,7 +352,7 @@
typename MC::const_iterator found = codemap.find(code);
if (found != codemap.end()) {
if (found->second->code_string_ != code_string) {
- dns_throw(ET, "Duplicate RR parameter registration");
+ isc_throw(ET, "Duplicate RR parameter registration");
}
return (false);
}
@@ -418,7 +418,7 @@
return (code);
}
}
- dns_throw(ET, "Unrecognized RR parameter string");
+ isc_throw(ET, "Unrecognized RR parameter string");
}
template <typename PT, typename MC>
Modified: trunk/src/lib/dns/rrset.cc
==============================================================================
--- trunk/src/lib/dns/rrset.cc (original)
+++ trunk/src/lib/dns/rrset.cc Sun Mar 7 07:06:42 2010
@@ -48,7 +48,7 @@
it->first();
if (it->isLast()) {
- dns_throw(EmptyRRset, "ToText() is attempted for an empty RRset");
+ isc_throw(EmptyRRset, "ToText() is attempted for an empty RRset");
}
do {
@@ -71,7 +71,7 @@
it->first();
if (it->isLast()) {
- dns_throw(EmptyRRset, "ToWire() is attempted for an empty RRset");
+ isc_throw(EmptyRRset, "ToWire() is attempted for an empty RRset");
}
// sort the set of Rdata based on rrset-order and sortlist, and possible
Modified: trunk/src/lib/dns/rrsetlist.cc
==============================================================================
--- trunk/src/lib/dns/rrsetlist.cc (original)
+++ trunk/src/lib/dns/rrsetlist.cc Sun Mar 7 07:06:42 2010
@@ -33,7 +33,7 @@
ConstRRsetPtr rrset_found = findRRset(rrsetptr->getType(),
rrsetptr->getClass());
if (rrset_found != NULL) {
- dns_throw(DuplicateRRset, "");
+ isc_throw(DuplicateRRset, "");
}
rrsets_.push_back(rrsetptr);
}
Modified: trunk/src/lib/dns/rrttl.cc
==============================================================================
--- trunk/src/lib/dns/rrttl.cc (original)
+++ trunk/src/lib/dns/rrttl.cc Sun Mar 7 07:06:42 2010
@@ -41,14 +41,14 @@
if (iss.rdstate() == ios::eofbit && val >= 0 && val <= 0xffffffff) {
ttlval_ = static_cast<uint32_t>(val);
} else {
- dns_throw(InvalidRRTTL, "invalid TTL");
+ isc_throw(InvalidRRTTL, "invalid TTL");
}
}
RRTTL::RRTTL(InputBuffer& buffer)
{
if (buffer.getLength() - buffer.getPosition() < sizeof(uint32_t)) {
- dns_throw(IncompleteRRTTL, "incomplete wire-format TTL value");
+ isc_throw(IncompleteRRTTL, "incomplete wire-format TTL value");
}
ttlval_ = buffer.readUint32();
}
Modified: trunk/src/lib/dns/rrtype.cc
==============================================================================
--- trunk/src/lib/dns/rrtype.cc (original)
+++ trunk/src/lib/dns/rrtype.cc Sun Mar 7 07:06:42 2010
@@ -39,7 +39,7 @@
RRType::RRType(InputBuffer& buffer)
{
if (buffer.getLength() - buffer.getPosition() < sizeof(uint16_t)) {
- dns_throw(IncompleteRRType, "incomplete wire-format RR type");
+ isc_throw(IncompleteRRType, "incomplete wire-format RR type");
}
typecode_ = buffer.readUint16();
}
Modified: trunk/src/lib/exceptions/exceptions.h
==============================================================================
--- trunk/src/lib/exceptions/exceptions.h (original)
+++ trunk/src/lib/exceptions/exceptions.h Sun Mar 7 07:06:42 2010
@@ -25,7 +25,7 @@
///
/// This is a base class for exceptions thrown from the DNS library module.
/// Normally, the exceptions are thrown via a convenient shortcut macro,
-/// @ref dns_throw, which automatically gives trivial parameters for the
+/// @ref isc_throw, which automatically gives trivial parameters for the
/// exception such as the file name and line number where the exception is
/// triggered.
///
@@ -125,7 +125,7 @@
///
/// A shortcut macro to insert known values into exception arguments.
///
-#define dns_throw(type, args...) throw type(__FILE__, __LINE__, args)
+#define isc_throw(type, args...) throw type(__FILE__, __LINE__, args)
}
#endif // __EXCEPTIONS_H
Modified: trunk/src/lib/exceptions/exceptions_unittest.cc
==============================================================================
--- trunk/src/lib/exceptions/exceptions_unittest.cc (original)
+++ trunk/src/lib/exceptions/exceptions_unittest.cc Sun Mar 7 07:06:42 2010
@@ -33,7 +33,7 @@
TEST_F(ExceptionTest, basicMethods) {
try {
- dns_throw(Exception, teststring);
+ isc_throw(Exception, teststring);
} catch (Exception& ex) {
EXPECT_EQ(ex.getMessage(), std::string(teststring));
EXPECT_EQ(ex.getFile(), std::string(__FILE__));
@@ -44,7 +44,7 @@
// Test to see if it works as a proper derived class of std::exception.
TEST_F(ExceptionTest, stdInheritance) {
try {
- dns_throw(Exception, teststring);
+ isc_throw(Exception, teststring);
} catch (std::exception& ex) {
EXPECT_EQ(std::string(ex.what()), std::string(teststring));
}
More information about the bind10-changes
mailing list