BIND 10 trac2155_2, updated. f687a6f097f17344cdf298e33b6592fd41fc8e43 [2155] update test case comments
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu Oct 25 12:04:15 UTC 2012
The branch, trac2155_2 has been updated
via f687a6f097f17344cdf298e33b6592fd41fc8e43 (commit)
via c6f40e97e8cde76793b79c54d3611fe9914bc166 (commit)
via 88259891ae9cdc24ac5e48b5c3b0cb6615f73d19 (commit)
via 3f3183672b5d824d03fb494dd0d21eaf5d1241cb (commit)
from 3f6ddec37ff9bb49440ce6ceaf02842c74d0b865 (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 f687a6f097f17344cdf298e33b6592fd41fc8e43
Author: Yoshitaka Aharen <aharen at jprs.co.jp>
Date: Thu Oct 25 20:57:16 2012 +0900
[2155] update test case comments
commit c6f40e97e8cde76793b79c54d3611fe9914bc166
Author: Yoshitaka Aharen <aharen at jprs.co.jp>
Date: Thu Oct 25 20:48:21 2012 +0900
[2155] add notes for SIG(0)
commit 88259891ae9cdc24ac5e48b5c3b0cb6615f73d19
Author: Yoshitaka Aharen <aharen at jprs.co.jp>
Date: Thu Oct 25 20:40:33 2012 +0900
[2155] call reset() instead of initializer
commit 3f3183672b5d824d03fb494dd0d21eaf5d1241cb
Author: Yoshitaka Aharen <aharen at jprs.co.jp>
Date: Thu Oct 25 20:36:08 2012 +0900
[2155] removed inline keywords from methods inside class definition
-----------------------------------------------------------------------
Summary of changes:
src/bin/auth/auth_srv.cc | 4 +++-
src/bin/auth/statistics.h | 35 +++++++++++++------------------
src/bin/auth/tests/auth_srv_unittest.cc | 16 +++++++-------
src/lib/statistics/counter.h | 8 +++----
src/lib/statistics/counter_dict.h | 28 ++++++++++++-------------
5 files changed, 43 insertions(+), 48 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/auth/auth_srv.cc b/src/bin/auth/auth_srv.cc
index a297301..8cc4a2d 100644
--- a/src/bin/auth/auth_srv.cc
+++ b/src/bin/auth/auth_srv.cc
@@ -564,7 +564,9 @@ AuthSrv::processMessage(const IOMessage& io_message, Message& message,
tsig_error = tsig_context->verify(tsig_record, io_message.getData(),
io_message.getDataSize());
// statistics: check TSIG attributes
- // SIG(0) is currently not implemented in Auth
+ // SIG(0) is currently not implemented in Auth, but it is implemented
+ // in BIND 9. At the point we support it, the code to check if the
+ // signature is valid would be around here.
stats_attrs.setQuerySig(true, false,
tsig_error == TSIGError::NOERROR());
}
diff --git a/src/bin/auth/statistics.h b/src/bin/auth/statistics.h
index 34d5f61..323c32f 100644
--- a/src/bin/auth/statistics.h
+++ b/src/bin/auth/statistics.h
@@ -62,51 +62,44 @@ public:
/// This constructor is mostly exception free. But it may still throw
/// a standard exception if memory allocation fails inside the method.
///
- inline QRAttributes() :
- req_ip_version_(0), req_transport_protocol_(0),
- req_opcode_(0),
- req_is_edns_0_(false), req_is_edns_badver_(false),
- req_is_dnssec_ok_(false),
- req_is_tsig_(false), req_is_sig0_(false), req_is_badsig_(false),
- zone_origin_(),
- answer_sent_(false),
- res_is_truncated_(false)
- {};
+ QRAttributes() {
+ reset();
+ };
/// The destructor.
///
/// This method never throws an exception.
///
- inline ~QRAttributes() {};
+ ~QRAttributes() {};
/// \brief Set query opcode.
/// \throw None
- inline void setQueryOpCode(const int opcode) {
+ void setQueryOpCode(const int opcode) {
req_opcode_ = opcode;
};
/// \brief Set IP version carrying a query.
/// \throw None
- inline void setQueryIPVersion(const int ip_version) {
+ void setQueryIPVersion(const int ip_version) {
req_ip_version_ = ip_version;
};
/// \brief Set transport protocol carrying a query.
/// \throw None
- inline void setQueryTransportProtocol(const int transport_protocol) {
+ void setQueryTransportProtocol(const int transport_protocol) {
req_transport_protocol_ = transport_protocol;
};
/// \brief Set query EDNS attributes.
/// \throw None
- inline void setQueryEDNS(const bool is_edns_0, const bool is_edns_badver) {
+ void setQueryEDNS(const bool is_edns_0, const bool is_edns_badver) {
req_is_edns_0_ = is_edns_0;
req_is_edns_badver_ = is_edns_badver;
};
/// \brief Set query DO bit.
/// \throw None
- inline void setQueryDO(const bool is_dnssec_ok) {
+ void setQueryDO(const bool is_dnssec_ok) {
req_is_dnssec_ok_ = is_dnssec_ok;
};
/// \brief Set query TSIG attributes.
/// \throw None
- inline void setQuerySig(const bool is_tsig, const bool is_sig0,
+ void setQuerySig(const bool is_tsig, const bool is_sig0,
const bool is_badsig)
{
req_is_tsig_ = is_tsig;
@@ -115,22 +108,22 @@ public:
};
/// \brief Set zone origin.
/// \throw None
- inline void setOrigin(const std::string& origin) {
+ void setOrigin(const std::string& origin) {
zone_origin_ = origin;
};
/// \brief Set if the answer was sent.
/// \throw None
- inline void answerWasSent() {
+ void answerWasSent() {
answer_sent_ = true;
};
/// \brief Set if the response is truncated.
/// \throw None
- inline void setResponseTruncated(const bool is_truncated) {
+ void setResponseTruncated(const bool is_truncated) {
res_is_truncated_ = is_truncated;
};
/// \brief Reset attributes.
/// \throw None
- inline void reset() {
+ void reset() {
req_ip_version_ = 0;
req_transport_protocol_ = 0;
req_opcode_ = 0;
diff --git a/src/bin/auth/tests/auth_srv_unittest.cc b/src/bin/auth/tests/auth_srv_unittest.cc
index 2d5e688..77ecccf 100644
--- a/src/bin/auth/tests/auth_srv_unittest.cc
+++ b/src/bin/auth/tests/auth_srv_unittest.cc
@@ -1087,9 +1087,9 @@ TEST_F(AuthSrvTest, queryCounterUDPNormal) {
server.processMessage(*io_message, *parse_message, *response_obuffer,
&dnsserv);
// After processing the UDP query, these counters should be incremented:
- // request.udp, opcode.query, qtype.ns, rcode.refused, response
+ // queries.udp, opcode.query, rcode.refused
// and these counters should not be incremented:
- // request.tcp
+ // queries.tcp
ConstElementPtr stats_after = server.getStatistics();
expectCounterItem(stats_after, "queries.udp", 1);
expectCounterItem(stats_after, "queries.tcp", 0);
@@ -1113,9 +1113,9 @@ TEST_F(AuthSrvTest, queryCounterTCPNormal) {
server.processMessage(*io_message, *parse_message, *response_obuffer,
&dnsserv);
// After processing the TCP query, these counters should be incremented:
- // request.tcp, opcode.query, qtype.ns, rcode.refused, response
+ // queries.tcp, opcode.query, rcode.refused
// and these counters should not be incremented:
- // request.udp
+ // queries.udp
ConstElementPtr stats_after = server.getStatistics();
expectCounterItem(stats_after, "queries.udp", 0);
expectCounterItem(stats_after, "queries.tcp", 1);
@@ -1140,9 +1140,9 @@ TEST_F(AuthSrvTest, queryCounterTCPAXFR) {
EXPECT_FALSE(dnsserv.hasAnswer());
// After processing the TCP AXFR query, these counters should be
// incremented:
- // request.tcp, opcode.query, qtype.axfr
+ // queries.tcp, opcode.query
// and these counters should not be incremented:
- // request.udp, response
+ // queries.udp
ConstElementPtr stats_after = server.getStatistics();
expectCounterItem(stats_after, "queries.udp", 0);
expectCounterItem(stats_after, "queries.tcp", 1);
@@ -1166,9 +1166,9 @@ TEST_F(AuthSrvTest, queryCounterTCPIXFR) {
EXPECT_FALSE(dnsserv.hasAnswer());
// After processing the TCP IXFR query, these counters should be
// incremented:
- // request.tcp, opcode.query, qtype.ixfr
+ // queries.tcp, opcode.query
// and these counters should not be incremented:
- // request.udp, response
+ // queries.udp
ConstElementPtr stats_after = server.getStatistics();
expectCounterItem(stats_after, "queries.udp", 0);
expectCounterItem(stats_after, "queries.tcp", 1);
diff --git a/src/lib/statistics/counter.h b/src/lib/statistics/counter.h
index af9a5f7..a5a1a1d 100644
--- a/src/lib/statistics/counter.h
+++ b/src/lib/statistics/counter.h
@@ -46,7 +46,7 @@ public:
/// \param items A number of counter items to hold (greater than 0)
///
/// \throw isc::InvalidParameter \a items is 0
- explicit inline Counter(const size_t items) :
+ explicit Counter(const size_t items) :
counters_(items, InitialValue)
{
if (items == 0) {
@@ -57,14 +57,14 @@ public:
/// The destructor.
///
/// This method never throws an exception.
- inline ~Counter() {};
+ ~Counter() {};
/// \brief Increment a counter item specified with \a type.
///
/// \param type %Counter item to increment
///
/// \throw isc::OutOfRange \a type is invalid
- inline void inc(const Counter::Type type) {
+ void inc(const Counter::Type type) {
if (type >= counters_.size()) {
isc_throw(isc::OutOfRange, "Counter type is out of range");
}
@@ -77,7 +77,7 @@ public:
/// \param type %Counter item to get the value of
///
/// \throw isc::OutOfRange \a type is invalid
- inline const Counter::Value& get(const Counter::Type type) const {
+ const Counter::Value& get(const Counter::Type type) const {
if (type >= counters_.size()) {
isc_throw(isc::OutOfRange, "Counter type is out of range");
}
diff --git a/src/lib/statistics/counter_dict.h b/src/lib/statistics/counter_dict.h
index 6861abf..863c0fb 100644
--- a/src/lib/statistics/counter_dict.h
+++ b/src/lib/statistics/counter_dict.h
@@ -48,7 +48,7 @@ private:
// specified at the construction of this class.
CounterDictionary();
public:
- explicit inline CounterDictionary(const size_t items) :
+ explicit CounterDictionary(const size_t items) :
items_(items)
{
// The number of items must not be 0
@@ -56,8 +56,8 @@ public:
isc_throw(isc::InvalidParameter, "Items must not be 0");
}
};
- inline ~CounterDictionary() {};
- inline void addElement(const std::string& name) {
+ ~CounterDictionary() {};
+ void addElement(const std::string& name) {
// throw if the element already exists
if (dictionary_.count(name) != 0) {
isc_throw(isc::InvalidParameter,
@@ -68,7 +68,7 @@ public:
dictionary_.insert(
DictionaryMap::value_type(name, CounterPtr(new Counter(items_))));
};
- inline void deleteElement(const std::string& name) {
+ void deleteElement(const std::string& name) {
size_t result = dictionary_.erase(name);
if (result != 1) {
// If an element with specified name does not exist, throw
@@ -77,7 +77,7 @@ public:
"Element " << name << " does not exist");
}
};
- inline Counter& getElement(const std::string& name) {
+ Counter& getElement(const std::string& name) {
DictionaryMap::const_iterator i = dictionary_.find(name);
if (i != dictionary_.end()) {
// the key was found. return the element.
@@ -89,7 +89,7 @@ public:
"Element " << name << " does not exist");
}
};
- inline Counter& operator[](const std::string& name) {
+ Counter& operator[](const std::string& name) {
return (getElement(name));
};
/// \brief \c ConstIterator is a constant iterator that provides an
@@ -112,31 +112,31 @@ public:
/// This constructor is mostly exception free. But it may still
/// throw a standard exception if memory allocation fails
/// inside the method.
- inline ConstIterator() {}
+ ConstIterator() {}
/// The destructor.
///
/// This method never throws an exception.
- inline ~ConstIterator() {}
+ ~ConstIterator() {}
/// Constructor from implementation detail DictionaryMap::const_iterator
- inline ConstIterator(
+ ConstIterator(
DictionaryMap::const_iterator iterator) :
iterator_(iterator)
{}
private:
/// \brief An internal method to increment this iterator.
- inline void increment() {
+ void increment() {
++iterator_;
return;
}
/// \brief An internal method to check equality.
- inline bool equal(const ConstIterator& other) const {
+ bool equal(const ConstIterator& other) const {
return (iterator_ == other.iterator_);
}
/// \brief An internal method to dereference this iterator.
- inline const value_type& dereference() const {
+ const value_type& dereference() const {
return (iterator_->first);
}
@@ -145,10 +145,10 @@ public:
DictionaryMap::const_iterator iterator_;
};
- inline ConstIterator begin() const {
+ ConstIterator begin() const {
return (CounterDictionary::ConstIterator(dictionary_.begin()));
};
- inline ConstIterator end() const {
+ ConstIterator end() const {
return (CounterDictionary::ConstIterator(dictionary_.end()));
};
More information about the bind10-changes
mailing list