BIND 10 trac2387, updated. 4e379f979dede89254759e40974d9c04d90ed451 [2387] Remove now unused parseNSEC3ParamText() function
BIND 10 source code commits
bind10-changes at lists.isc.org
Tue Mar 12 02:38:28 UTC 2013
The branch, trac2387 has been updated
via 4e379f979dede89254759e40974d9c04d90ed451 (commit)
from fb7adf34e96efc9c2e0986ab3f567c6d38500a89 (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 4e379f979dede89254759e40974d9c04d90ed451
Author: Mukund Sivaraman <muks at isc.org>
Date: Tue Mar 12 08:07:59 2013 +0530
[2387] Remove now unused parseNSEC3ParamText() function
-----------------------------------------------------------------------
Summary of changes:
.../dns/rdata/generic/detail/nsec3param_common.cc | 50 --------------------
.../dns/rdata/generic/detail/nsec3param_common.h | 35 ++------------
2 files changed, 3 insertions(+), 82 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/dns/rdata/generic/detail/nsec3param_common.cc b/src/lib/dns/rdata/generic/detail/nsec3param_common.cc
index 0ce6bca..3fc0f0a 100644
--- a/src/lib/dns/rdata/generic/detail/nsec3param_common.cc
+++ b/src/lib/dns/rdata/generic/detail/nsec3param_common.cc
@@ -39,56 +39,6 @@ namespace detail {
namespace nsec3 {
ParseNSEC3ParamResult
-parseNSEC3ParamText(const char* const rrtype_name,
- const string& rdata_str, istringstream& iss,
- vector<uint8_t>& salt)
-{
- unsigned int hashalg, flags, iterations;
- string iterations_str, salthex;
-
- iss >> hashalg >> flags >> iterations_str >> salthex;
- if (iss.bad() || iss.fail()) {
- isc_throw(InvalidRdataText, "Invalid " << rrtype_name <<
- " text: " << rdata_str);
- }
- if (hashalg > 0xff) {
- isc_throw(InvalidRdataText, rrtype_name <<
- " hash algorithm out of range: " << hashalg);
- }
- if (flags > 0xff) {
- isc_throw(InvalidRdataText, rrtype_name << " flags out of range: " <<
- flags);
- }
- // Convert iteration. To reject an invalid case where there's no space
- // between iteration and salt, we extract this field as string and convert
- // to integer.
- try {
- iterations = boost::lexical_cast<unsigned int>(iterations_str);
- } catch (const boost::bad_lexical_cast&) {
- isc_throw(InvalidRdataText, "Bad " << rrtype_name <<
- " iteration: " << iterations_str);
- }
- if (iterations > 0xffff) {
- isc_throw(InvalidRdataText, rrtype_name <<
- " iterations out of range: " <<
- iterations);
- }
-
- // Salt is up to 255 bytes, and space is not allowed in the HEX encoding,
- // so the encoded string cannot be longer than the double of max length
- // of the actual salt.
- if (salthex.size() > 255 * 2) {
- isc_throw(InvalidRdataText, rrtype_name << " salt is too long: "
- << salthex.size() << " (encoded) bytes");
- }
- if (salthex != "-") { // "-" means a 0-length salt
- decodeHex(salthex, salt);
- }
-
- return (ParseNSEC3ParamResult(hashalg, flags, iterations));
-}
-
-ParseNSEC3ParamResult
parseNSEC3ParamFromLexer(const char* const rrtype_name,
MasterLexer& lexer, vector<uint8_t>& salt)
{
diff --git a/src/lib/dns/rdata/generic/detail/nsec3param_common.h b/src/lib/dns/rdata/generic/detail/nsec3param_common.h
index 7d7ed54..17e17f4 100644
--- a/src/lib/dns/rdata/generic/detail/nsec3param_common.h
+++ b/src/lib/dns/rdata/generic/detail/nsec3param_common.h
@@ -20,9 +20,6 @@
#include <util/buffer.h>
#include <stdint.h>
-
-#include <sstream>
-#include <string>
#include <vector>
namespace isc {
@@ -61,7 +58,7 @@ struct ParseNSEC3ParamResult {
/// \brief Convert textual representation of NSEC3 parameters.
///
-/// This function takes an input string stream that consists of a complete
+/// This function takes an input MasterLexer that points at a complete
/// textual representation of an NSEC3 or NSEC3PARAM RDATA and parses it
/// extracting the hash algorithm, flags, iterations, and salt fields.
///
@@ -69,37 +66,11 @@ struct ParseNSEC3ParamResult {
/// The salt will be stored in the given vector. The vector is expected
/// to be empty, but if not, the existing content will be overridden.
///
-/// On successful return the given input stream will reach the end of the
+/// On successful return the given MasterLexer will reach the end of the
/// salt field.
///
/// \exception isc::BadValue The salt is not a valid hex string.
-/// \exception InvalidRdataText The given string is otherwise invalid for
-/// NSEC3 or NSEC3PARAM fields.
-///
-/// \param rrtype_name Either "NSEC3" or "NSEC3PARAM"; used as part of
-/// exception messages.
-/// \param rdata_str A complete textual string of the RDATA; used as part of
-/// exception messages.
-/// \param iss Input stream that consists of a complete textual string of
-/// the RDATA.
-/// \param salt A placeholder for the salt field value of the RDATA.
-/// Expected to be empty, but it's not checked (and will be overridden).
-///
-/// \return The hash algorithm, flags, iterations in the form of
-/// ParseNSEC3ParamResult.
-ParseNSEC3ParamResult parseNSEC3ParamText(const char* const rrtype_name,
- const std::string& rdata_str,
- std::istringstream& iss,
- std::vector<uint8_t>& salt);
-
-/// \brief Convert textual representation of NSEC3 parameters
-/// (MasterLexer variant).
-///
-/// This function is identical to \c parseNSEC3ParamText(), except that
-/// it reads the NSEC3 parameters from a MasterLexer.
-///
-/// \exception isc::BadValue The salt is not a valid hex string.
-/// \exception InvalidRdataText The given string is otherwise invalid for
+/// \exception InvalidRdataText The given RDATA is otherwise invalid for
/// NSEC3 or NSEC3PARAM fields.
/// \exception MasterLexer::LexerError There was a failure reading a
/// field from the MasterLexer.
More information about the bind10-changes
mailing list