Commit 9857db04 authored by JINMEI Tatuya's avatar JINMEI Tatuya

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.


git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@1181 e5f2f494-b856-4b98-b285-d166d9295462
parent cd553ba8
......@@ -587,7 +587,7 @@ DataSrc::doQuery(Query& q)
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 @@ void
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);
......
......@@ -60,7 +60,7 @@ QueryTask::QueryTask(const isc::dns::Name& n, const isc::dns::RRClass& c,
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 @@ QueryTask::QueryTask(const isc::dns::Name& n, const isc::dns::RRClass& c,
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 @@ QueryTask::QueryTask(const isc::dns::Name& n, const isc::dns::RRClass& c,
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 @@ Query::Query(Message& m, bool dnssec) :
{
// 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
......
......@@ -1009,7 +1009,7 @@ isc::data::removeIdentical(ElementPtr a, const ElementPtr b)
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 @@ isc::data::merge(ElementPtr element, const ElementPtr other)
{
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();
......
......@@ -138,12 +138,12 @@ public:
/// 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 @@ public:
/// 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 @@ public:
/// 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 @@ public:
/// \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.
......
......@@ -86,13 +86,13 @@ parseAnswer(int &rcode, const ElementPtr msg)
{
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) {
......
......@@ -31,12 +31,12 @@ find_spec_part(ElementPtr spec, const std::string& identifier)
{
//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 @@ find_spec_part(ElementPtr spec, const std::string& identifier)
}
}
if (!found) {
dns_throw(DataNotFoundError, identifier);
isc_throw(DataNotFoundError, identifier);
}
}
id = id.substr(sep + 1);
......@@ -72,7 +72,7 @@ find_spec_part(ElementPtr spec, const std::string& identifier)
}
}
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 @@ find_spec_part(ElementPtr spec, const std::string& identifier)
}
}
if (!found) {
dns_throw(DataNotFoundError, identifier);
isc_throw(DataNotFoundError, identifier);
}
} else {
dns_throw(DataNotFoundError, identifier);
isc_throw(DataNotFoundError, identifier);
}
}
}
......
......@@ -129,7 +129,7 @@ decodeBase32(const string& base32, vector<uint8_t>& result)
// 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 @@ decodeBase32(const string& base32, vector<uint8_t>& result)
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 @@ decodeBase32(const string& base32, vector<uint8_t>& result)
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 @@ decodeBase32(const string& base32, vector<uint8_t>& result)
} 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);
......
......@@ -150,7 +150,7 @@ decodeBase64(const string& base64, vector<uint8_t>& result)
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 @@ decodeBase64(const string& base64, vector<uint8_t>& result)
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 @@ decodeBase64(const string& base64, vector<uint8_t>& result)
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");
}
}
......
......@@ -123,7 +123,7 @@ public:
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 @@ public:
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 @@ public:
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 @@ public:
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 @@ public:
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 @@ public:
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 @@ public:
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);
......
......@@ -67,7 +67,7 @@ checkRange(int min, int max, int value, const string& valname) {
}
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 @@ DNSSECTimeFromText(const string& time_txt)
{
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");
......
......@@ -65,7 +65,7 @@ decodeHex(const std::string& hex, std::vector<uint8_t>& result)
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 @@ decodeHex(const std::string& hex, std::vector<uint8_t>& result)
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;
......
......@@ -162,7 +162,7 @@ Opcode::toText() const
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 @@ void
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 @@ void
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 @@ void
Message::fromWire(InputBuffer& buffer)
{
if ((buffer.getLength() - buffer.getPosition()) < HEADERLEN) {
dns_throw(MessageTooShort, "");
isc_throw(MessageTooShort, "");
}
impl_->qid_ = buffer.readUint16();
......@@ -531,7 +531,7 @@ MessageImpl::parseQuestion(Message& message, InputBuffer& buffer)
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 @@ MessageImpl::parseSection(Message& message, const Section& section,
// 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 @@ MessageImpl::parseSection(Message& message, const Section& section,
// 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 @@ MessageImpl::parseSection(Message& message, const Section& section,
// 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 @@ void
Message::makeResponse()
{
if (impl_->mode_ != Message::PARSE) {
dns_throw(InvalidMessageOperation,
isc_throw(InvalidMessageOperation,
"makeResponse() is performed in non-parse mode");
}
......@@ -904,7 +904,7 @@ const SectionIterator<RRsetPtr>
Message::beginSection(const Section& section) const
{
if (section == Section::QUESTION()) {
dns_throw(InvalidMessageSection, "");
isc_throw(InvalidMessageSection, "");
}
return (RRsetIterator(
......@@ -916,7 +916,7 @@ const SectionIterator<RRsetPtr>
Message::endSection(const Section& section) const
{
if (section == Section::QUESTION()) {
dns_throw(InvalidMessageSection, "");
isc_throw(InvalidMessageSection, "");
}
return (RRsetIterator(
......
......@@ -161,7 +161,7 @@ Name::Name(const std::string &namestring, bool downcase)
//
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 @@ Name::Name(const std::string &namestring, bool downcase)
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 @@ Name::Name(const std::string &namestring, bool downcase)
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 @@ Name::Name(const std::string &namestring, bool downcase)
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 @@ Name::Name(const std::string &namestring, bool downcase)
// 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 @@ Name::Name(const std::string &namestring, bool downcase)
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 @@ Name::Name(InputBuffer& buffer, bool downcase)
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 @@ Name::Name(InputBuffer& buffer, bool downcase)
} 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 @@ Name::Name(InputBuffer& buffer, bool downcase)
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 @@ Name::Name(InputBuffer& buffer, bool downcase)
}
if (!done) {
dns_throw(IncompleteName, "incomplete wire-format name");
isc_throw(IncompleteName, "incomplete wire-format name");
}
labelcount_ = offsets.size();
......@@ -475,7 +475,7 @@ Name::toText(bool omit_final_dot) const
}
}
} else {
dns_throw(BadLabelType, "unknown label type in name data");
isc_throw(BadLabelType, "unknown label type in name data");
}
}
......@@ -611,7 +611,7 @@ Name::concatenate(const Name& suffix) const
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
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;
......
......@@ -304,7 +304,7 @@ public:
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]);
}
......
......@@ -58,7 +58,7 @@ createRdata(const RRType& rrtype, const RRClass& rrclass,
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 @@ createRdata(const RRType& rrtype, const RRClass& rrclass,
len);
if (buffer.getPosition() - old_pos != len) {