Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
92cf23f1
Commit
92cf23f1
authored
Nov 16, 2012
by
Yoshitaka Aharen
Browse files
[2157] rename following the naming policy
parent
7a821cf7
Changes
10
Hide whitespace changes
Inline
Side-by-side
src/bin/auth/Makefile.am
View file @
92cf23f1
...
...
@@ -39,11 +39,11 @@ $(man_MANS):
endif
auth.spec
:
auth.spec.pre statistics_
qr
_items.def
b10-auth.xml
:
b10-auth.xml.pre statistics_
qr
_items.def
statistics_items.h
:
statistics_items.h.pre statistics_
qr
_items.def
statistics.cc
:
statistics.cc.pre statistics_
qr
_items.def
tests/statistics_unittest.cc
:
tests/statistics_unittest.cc.pre statistics_
qr
_items.def
auth.spec
:
auth.spec.pre statistics_
msg
_items.def
b10-auth.xml
:
b10-auth.xml.pre statistics_
msg
_items.def
statistics_items.h
:
statistics_items.h.pre statistics_
msg
_items.def
statistics.cc
:
statistics.cc.pre statistics_
msg
_items.def
tests/statistics_unittest.cc
:
tests/statistics_unittest.cc.pre statistics_
msg
_items.def
gen-statistics_items.py
:
gen-statistics_items.py.pre
$(SED)
-e
"s|@@LOCALSTATEDIR@@|
$(localstatedir)
|"
gen-statistics_items.py.pre
>
$@
...
...
@@ -76,7 +76,7 @@ b10_auth_SOURCES += main.cc
nodist_b10_auth_SOURCES
=
auth_messages.h auth_messages.cc
nodist_b10_auth_SOURCES
+=
statistics.cc statistics_items.h
EXTRA_DIST
+=
auth_messages.mes
EXTRA_DIST
+=
statistics_
qr
_items.def
EXTRA_DIST
+=
statistics_
msg
_items.def
EXTRA_DIST
+=
b10-auth.xml.pre
EXTRA_DIST
+=
statistics_items.h.pre statistics.cc.pre
EXTRA_DIST
+=
tests/statistics_unittest.cc.pre
...
...
src/bin/auth/auth_srv.cc
View file @
92cf23f1
...
...
@@ -83,7 +83,7 @@ using namespace isc::asiolink;
using
namespace
isc
::
asiodns
;
using
namespace
isc
::
server_common
::
portconfig
;
using
isc
::
auth
::
statistics
::
Counters
;
using
isc
::
auth
::
statistics
::
QR
Attributes
;
using
isc
::
auth
::
statistics
::
Message
Attributes
;
namespace
{
// A helper class for cleaning up message renderer.
...
...
@@ -272,8 +272,8 @@ public:
std
::
map
<
RRClass
,
boost
::
shared_ptr
<
ConfigurableClientList
>
>
client_lists_
;
///
Query / Respons
e attributes
QR
Attributes
stats_attrs_
;
///
Messag
e attributes
Message
Attributes
stats_attrs_
;
boost
::
shared_ptr
<
ConfigurableClientList
>
getClientList
(
const
RRClass
&
rrclass
)
...
...
@@ -494,9 +494,9 @@ AuthSrv::processMessage(const IOMessage& io_message, Message& message,
{
InputBuffer
request_buffer
(
io_message
.
getData
(),
io_message
.
getDataSize
());
impl_
->
stats_attrs_
.
set
Query
IPVersion
(
impl_
->
stats_attrs_
.
set
Request
IPVersion
(
io_message
.
getRemoteEndpoint
().
getFamily
());
impl_
->
stats_attrs_
.
set
Query
TransportProtocol
(
impl_
->
stats_attrs_
.
set
Request
TransportProtocol
(
io_message
.
getRemoteEndpoint
().
getProtocol
());
// First, check the header part. If we fail even for the base header,
...
...
@@ -553,8 +553,8 @@ AuthSrv::processMessage(const IOMessage& io_message, Message& message,
**
impl_
->
keyring_
));
tsig_error
=
tsig_context
->
verify
(
tsig_record
,
io_message
.
getData
(),
io_message
.
getDataSize
());
impl_
->
stats_attrs_
.
set
Query
Sig
(
true
,
false
,
tsig_error
!=
TSIGError
::
NOERROR
());
impl_
->
stats_attrs_
.
set
Request
Sig
(
true
,
false
,
tsig_error
!=
TSIGError
::
NOERROR
());
}
if
(
tsig_error
!=
TSIGError
::
NOERROR
())
{
...
...
@@ -570,13 +570,13 @@ AuthSrv::processMessage(const IOMessage& io_message, Message& message,
// note: This can only be reliable after TSIG check succeeds.
ConstEDNSPtr
edns
=
message
.
getEDNS
();
if
(
edns
)
{
impl_
->
stats_attrs_
.
set
Query
EDNS
(
edns
->
getVersion
()
==
0
,
edns
->
getVersion
()
!=
0
);
impl_
->
stats_attrs_
.
set
Query
DO
(
edns
->
getDNSSECAwareness
());
impl_
->
stats_attrs_
.
set
Request
EDNS
(
edns
->
getVersion
()
==
0
,
edns
->
getVersion
()
!=
0
);
impl_
->
stats_attrs_
.
set
Request
DO
(
edns
->
getDNSSECAwareness
());
}
// note: This can only be reliable after TSIG check succeeds.
impl_
->
stats_attrs_
.
set
Query
OpCode
(
opcode
.
getCode
());
impl_
->
stats_attrs_
.
set
Request
OpCode
(
opcode
.
getCode
());
if
(
opcode
==
Opcode
::
NOTIFY
())
{
send_answer
=
impl_
->
processNotify
(
io_message
,
message
,
buffer
,
...
...
src/bin/auth/gen-statistics_items.py.pre.in
View file @
92cf23f1
...
...
@@ -43,7 +43,7 @@ def need_generate(filepath, mtime):
def import_definitions():
global item_list
items_definition_file = srcdir + os.sep + 'statistics_
qr
_items.def'
items_definition_file = srcdir + os.sep + 'statistics_
msg
_items.def'
item_definition = open(items_definition_file, 'r')
re_splitter = re.compile('\t+')
...
...
@@ -187,13 +187,13 @@ def generate_docfile(docfile, def_mtime):
def generate_cxx(itemsfile, ccfile, utfile, def_mtime):
global item_list
qr
_counter_types = 'enum
QR
CounterType {\n'
msg
_counter_types = 'enum
MSG
CounterType {\n'
item_names = []
def convert_list(items,
qr
_counter_types, item_names_current, item_names):
def convert_list(items,
msg
_counter_types, item_names_current, item_names):
for item in items:
if item['child'] is None:
qr
_counter_types += ' ' + item['index'] + ', ' +\
msg
_counter_types += ' ' + item['index'] + ', ' +\
'///< ' + item['description'] + '\n'
item_names_current.append(' { "' + item['name'] +
'", NULL, ' + item['index'] + ' },\n'
...
...
@@ -201,29 +201,29 @@ def generate_cxx(itemsfile, ccfile, utfile, def_mtime):
else:
item_names_current_ = ['const struct CounterTypeTree ' +
item['index'] + '[] = {\n']
qr
_counter_types, item_names_current_, item_names = \
convert_list(item['child'],
qr
_counter_types,
msg
_counter_types, item_names_current_, item_names = \
convert_list(item['child'],
msg
_counter_types,
item_names_current_, item_names)
item_names_current_.append(' { NULL, NULL, -1 }\n' +
'};\n')
item_names.extend(item_names_current_)
item_names_current.append(' { "' + item['name'] + '", ' +
item['index'] + ', -1 },\n')
return
qr
_counter_types, item_names_current, item_names
return
msg
_counter_types, item_names_current, item_names
qr
_counter_types, item_names_current, item_names = \
convert_list(item_list,
qr
_counter_types, [], item_names)
item_names.append('const struct CounterTypeTree
QR
CounterTree[] = {\n')
msg
_counter_types, item_names_current, item_names = \
convert_list(item_list,
msg
_counter_types, [], item_names)
item_names.append('const struct CounterTypeTree
MSG
CounterTree[] = {\n')
item_names.extend(item_names_current)
item_names.append(' { NULL, NULL, -1 }\n' +
'};\n')
qr
_counter_types += \
msg
_counter_types += \
' // End of counter types\n' +\
'
QR
_COUNTER_TYPES ///< The number of defined counters\n' +\
'
MSG
_COUNTER_TYPES ///< The number of defined counters\n' +\
'};\n'
item_defs =
qr
_counter_types
item_defs =
msg
_counter_types
item_decls = ''.join(item_names)
if need_generate(builddir+os.sep+itemsfile, def_mtime):
...
...
src/bin/auth/statistics.cc.pre
View file @
92cf23f1
...
...
@@ -72,121 +72,123 @@ namespace statistics {
// ### STATISTICS ITEMS DEFINITION ###
// Note: opcode in this array must be start with 0 and be sequential
const int opcode_to_
qr
counter[] = {
QR
_OPCODE_QUERY, // Opcode = 0: Query
QR
_OPCODE_IQUERY, // Opcode = 1: Iquery
QR
_OPCODE_STATUS, // Opcode = 2: STATUS
QR
_OPCODE_OTHER, // Opcode = 3: (Unassigned)
QR
_OPCODE_NOTIFY, // Opcode = 4: Notify
QR
_OPCODE_UPDATE, // Opcode = 5: Update
QR
_OPCODE_OTHER, // Opcode = 6: (Unassigned)
QR
_OPCODE_OTHER, // Opcode = 7: (Unassigned)
QR
_OPCODE_OTHER, // Opcode = 8: (Unassigned)
QR
_OPCODE_OTHER, // Opcode = 9: (Unassigned)
QR
_OPCODE_OTHER, // Opcode = 10: (Unassigned)
QR
_OPCODE_OTHER, // Opcode = 11: (Unassigned)
QR
_OPCODE_OTHER, // Opcode = 12: (Unassigned)
QR
_OPCODE_OTHER, // Opcode = 13: (Unassigned)
QR
_OPCODE_OTHER, // Opcode = 14: (Unassigned)
QR
_OPCODE_OTHER // Opcode = 15: (Unassigned)
const int opcode_to_
msg
counter[] = {
MSG
_OPCODE_QUERY, // Opcode = 0: Query
MSG
_OPCODE_IQUERY, // Opcode = 1: Iquery
MSG
_OPCODE_STATUS, // Opcode = 2: STATUS
MSG
_OPCODE_OTHER, // Opcode = 3: (Unassigned)
MSG
_OPCODE_NOTIFY, // Opcode = 4: Notify
MSG
_OPCODE_UPDATE, // Opcode = 5: Update
MSG
_OPCODE_OTHER, // Opcode = 6: (Unassigned)
MSG
_OPCODE_OTHER, // Opcode = 7: (Unassigned)
MSG
_OPCODE_OTHER, // Opcode = 8: (Unassigned)
MSG
_OPCODE_OTHER, // Opcode = 9: (Unassigned)
MSG
_OPCODE_OTHER, // Opcode = 10: (Unassigned)
MSG
_OPCODE_OTHER, // Opcode = 11: (Unassigned)
MSG
_OPCODE_OTHER, // Opcode = 12: (Unassigned)
MSG
_OPCODE_OTHER, // Opcode = 13: (Unassigned)
MSG
_OPCODE_OTHER, // Opcode = 14: (Unassigned)
MSG
_OPCODE_OTHER // Opcode = 15: (Unassigned)
};
const size_t num_opcode_to_
qr
counter =
sizeof(opcode_to_
qr
counter) / sizeof(opcode_to_
qr
counter[0]);
const size_t num_opcode_to_
msg
counter =
sizeof(opcode_to_
msg
counter) / sizeof(opcode_to_
msg
counter[0]);
// Note: rcode in this array must be start with 0 and be sequential
const int rcode_to_
qr
counter[] = {
QR
_RCODE_NOERROR, // Rcode = 0: NoError
QR
_RCODE_FORMERR, // Rcode = 1: FormErr
QR
_RCODE_SERVFAIL, // Rcode = 2: ServFail
QR
_RCODE_NXDOMAIN, // Rcode = 3: NXDomain
QR
_RCODE_NOTIMP, // Rcode = 4: NotImp
QR
_RCODE_REFUSED, // Rcode = 5: Refused
QR
_RCODE_YXDOMAIN, // Rcode = 6: YXDomain
QR
_RCODE_YXRRSET, // Rcode = 7: YXRRSet
QR
_RCODE_NXRRSET, // Rcode = 8: NXRRSet
QR
_RCODE_NOTAUTH, // Rcode = 9: NotAuth
QR
_RCODE_NOTZONE, // Rcode = 10: NotZone
QR
_RCODE_OTHER, // Rcode = 11: (Unassigned)
QR
_RCODE_OTHER, // Rcode = 12: (Unassigned)
QR
_RCODE_OTHER, // Rcode = 13: (Unassigned)
QR
_RCODE_OTHER, // Rcode = 14: (Unassigned)
QR
_RCODE_OTHER, // Rcode = 15: (Unassigned)
QR
_RCODE_BADVERS // Rcode = 16:
(
BADVERS
)
const int rcode_to_
msg
counter[] = {
MSG
_RCODE_NOERROR, // Rcode = 0: NoError
MSG
_RCODE_FORMERR, // Rcode = 1: FormErr
MSG
_RCODE_SERVFAIL, // Rcode = 2: ServFail
MSG
_RCODE_NXDOMAIN, // Rcode = 3: NXDomain
MSG
_RCODE_NOTIMP, // Rcode = 4: NotImp
MSG
_RCODE_REFUSED, // Rcode = 5: Refused
MSG
_RCODE_YXDOMAIN, // Rcode = 6: YXDomain
MSG
_RCODE_YXRRSET, // Rcode = 7: YXRRSet
MSG
_RCODE_NXRRSET, // Rcode = 8: NXRRSet
MSG
_RCODE_NOTAUTH, // Rcode = 9: NotAuth
MSG
_RCODE_NOTZONE, // Rcode = 10: NotZone
MSG
_RCODE_OTHER, // Rcode = 11: (Unassigned)
MSG
_RCODE_OTHER, // Rcode = 12: (Unassigned)
MSG
_RCODE_OTHER, // Rcode = 13: (Unassigned)
MSG
_RCODE_OTHER, // Rcode = 14: (Unassigned)
MSG
_RCODE_OTHER, // Rcode = 15: (Unassigned)
MSG
_RCODE_BADVERS // Rcode = 16: BADVERS
};
const size_t num_rcode_to_
qr
counter =
sizeof(rcode_to_
qr
counter) / sizeof(rcode_to_
qr
counter[0]);
const size_t num_rcode_to_
msg
counter =
sizeof(rcode_to_
msg
counter) / sizeof(rcode_to_
msg
counter[0]);
Counters::Counters() :
// size of server_
qr
_counter_, zone_
qr
_counters_:
QR
_COUNTER_TYPES
server_
qr
_counter_(
QR
_COUNTER_TYPES),
zone_
qr
_counters_(
QR
_COUNTER_TYPES)
// size of server_
msg
_counter_, zone_
msg
_counters_:
MSG
_COUNTER_TYPES
server_
msg
_counter_(
MSG
_COUNTER_TYPES),
zone_
msg
_counters_(
MSG
_COUNTER_TYPES)
{}
void
Counters::incRequest(const
QR
Attributes&
qr
attrs) {
Counters::incRequest(const
Message
Attributes&
msg
attrs) {
// protocols carrying request
if (
qr
attrs.req_ip_version_ == AF_INET) {
server_
qr
_counter_.inc(
QR
_REQUEST_IPV4);
} else if (
qr
attrs.req_ip_version_ == AF_INET6) {
server_
qr
_counter_.inc(
QR
_REQUEST_IPV6);
if (
msg
attrs.req_ip_version_ == AF_INET) {
server_
msg
_counter_.inc(
MSG
_REQUEST_IPV4);
} else if (
msg
attrs.req_ip_version_ == AF_INET6) {
server_
msg
_counter_.inc(
MSG
_REQUEST_IPV6);
}
if (
qr
attrs.req_transport_protocol_ == IPPROTO_UDP) {
server_
qr
_counter_.inc(
QR
_REQUEST_UDP);
} else if (
qr
attrs.req_transport_protocol_ == IPPROTO_TCP) {
server_
qr
_counter_.inc(
QR
_REQUEST_TCP);
if (
msg
attrs.req_transport_protocol_ == IPPROTO_UDP) {
server_
msg
_counter_.inc(
MSG
_REQUEST_UDP);
} else if (
msg
attrs.req_transport_protocol_ == IPPROTO_TCP) {
server_
msg
_counter_.inc(
MSG
_REQUEST_TCP);
}
// que
ry
TSIG
if (
qr
attrs.req_is_tsig_) {
server_
qr
_counter_.inc(
QR
_REQUEST_TSIG);
//
re
que
st
TSIG
if (
msg
attrs.req_is_tsig_) {
server_
msg
_counter_.inc(
MSG
_REQUEST_TSIG);
}
if (
qr
attrs.req_is_sig0_) {
server_
qr
_counter_.inc(
QR
_REQUEST_SIG0);
if (
msg
attrs.req_is_sig0_) {
server_
msg
_counter_.inc(
MSG
_REQUEST_SIG0);
}
if (
qr
attrs.req_is_badsig_) {
server_
qr
_counter_.inc(
QR
_REQUEST_BADSIG);
if (
msg
attrs.req_is_badsig_) {
server_
msg
_counter_.inc(
MSG
_REQUEST_BADSIG);
// If signature validation is failed, no other query attributes are
// reliable. Skip processing of the rest of query counters.
return;
}
// que
ry
EDNS
if (
qr
attrs.req_is_edns_0_) {
server_
qr
_counter_.inc(
QR
_REQUEST_EDNS0);
//
re
que
st
EDNS
if (
msg
attrs.req_is_edns_0_) {
server_
msg
_counter_.inc(
MSG
_REQUEST_EDNS0);
}
if (
qr
attrs.req_is_edns_badver_) {
server_
qr
_counter_.inc(
QR
_REQUEST_BADEDNSVER);
if (
msg
attrs.req_is_edns_badver_) {
server_
msg
_counter_.inc(
MSG
_REQUEST_BADEDNSVER);
}
// que
ry
DNSSEC
if (
qr
attrs.req_is_dnssec_ok_) {
server_
qr
_counter_.inc(
QR
_REQUEST_DNSSEC_OK);
//
re
que
st
DNSSEC
if (
msg
attrs.req_is_dnssec_ok_) {
server_
msg
_counter_.inc(
MSG
_REQUEST_DNSSEC_OK);
}
// OPCODE
server_
qr
_counter_.inc(opcode_to_
qr
counter[
qr
attrs.req_opcode_]);
server_
msg
_counter_.inc(opcode_to_
msg
counter[
msg
attrs.req_opcode_]);
}
void
Counters::incResponse(const QRAttributes& qrattrs, const Message& response) {
Counters::incResponse(const MessageAttributes& msgattrs,
const Message& response)
{
// responded
server_
qr
_counter_.inc(
QR
_RESPONSE);
server_
msg
_counter_.inc(
MSG
_RESPONSE);
// response truncated
if (
qr
attrs.res_is_truncated_) {
server_
qr
_counter_.inc(
QR
_RESPONSE_TRUNCATED);
if (
msg
attrs.res_is_truncated_) {
server_
msg
_counter_.inc(
MSG
_RESPONSE_TRUNCATED);
}
// response EDNS
ConstEDNSPtr response_edns = response.getEDNS();
if (response_edns && response_edns->getVersion() == 0) {
server_
qr
_counter_.inc(
QR
_RESPONSE_EDNS0);
server_
msg
_counter_.inc(
MSG
_RESPONSE_EDNS0);
}
// response TSIG
if (
qr
attrs.req_is_tsig_) {
if (
msg
attrs.req_is_tsig_) {
// assume response is TSIG signed if request is TSIG signed
server_
qr
_counter_.inc(
QR
_RESPONSE_TSIG);
server_
msg
_counter_.inc(
MSG
_RESPONSE_TSIG);
}
// response SIG(0) is currently not implemented
...
...
@@ -194,9 +196,9 @@ Counters::incResponse(const QRAttributes& qrattrs, const Message& response) {
// RCODE
const unsigned int rcode = response.getRcode().getCode();
const unsigned int rcode_type =
rcode < num_rcode_to_
qr
counter ?
rcode_to_
qr
counter[rcode] :
QR
_RCODE_OTHER;
server_
qr
_counter_.inc(rcode_type);
rcode < num_rcode_to_
msg
counter ?
rcode_to_
msg
counter[rcode] :
MSG
_RCODE_OTHER;
server_
msg
_counter_.inc(rcode_type);
// compound attributes
const unsigned int answer_rrs =
...
...
@@ -205,41 +207,41 @@ Counters::incResponse(const QRAttributes& qrattrs, const Message& response) {
if (is_aa_set) {
// QryAuthAns
server_
qr
_counter_.inc(
QR
_QRYAUTHANS);
server_
msg
_counter_.inc(
MSG
_QRYAUTHANS);
} else {
// QryNoAuthAns
server_
qr
_counter_.inc(
QR
_QRYNOAUTHANS);
server_
msg
_counter_.inc(
MSG
_QRYNOAUTHANS);
}
if (rcode == Rcode::NOERROR_CODE) {
if (answer_rrs > 0) {
// QrySuccess
server_
qr
_counter_.inc(
QR
_QRYSUCCESS);
server_
msg
_counter_.inc(
MSG
_QRYSUCCESS);
} else {
if (is_aa_set) {
// QryNxrrset
server_
qr
_counter_.inc(
QR
_QRYNXRRSET);
server_
msg
_counter_.inc(
MSG
_QRYNXRRSET);
} else {
// QryReferral
server_
qr
_counter_.inc(
QR
_QRYREFERRAL);
server_
msg
_counter_.inc(
MSG
_QRYREFERRAL);
}
}
} else if (rcode == Rcode::REFUSED_CODE) {
// AuthRej
server_
qr
_counter_.inc(
QR
_QRYREJECT);
server_
msg
_counter_.inc(
MSG
_QRYREJECT);
}
}
void
Counters::inc(const
QR
Attributes&
qr
attrs, const Message& response,
Counters::inc(const
Message
Attributes&
msg
attrs, const Message& response,
const bool done)
{
// increment request counters
incRequest(
qr
attrs);
incRequest(
msg
attrs);
if (done) {
// increment response counters if answer was sent
incResponse(
qr
attrs, response);
incResponse(
msg
attrs, response);
}
}
...
...
@@ -253,7 +255,7 @@ Counters::get() const {
item_tree->set("zones", zones);
Counters::ItemTreePtr server = Element::createMap();
fillNodes(server_
qr
_counter_,
QR
CounterTree, server);
fillNodes(server_
msg
_counter_,
MSG
CounterTree, server);
zones->set("_SERVER_", server);
return (item_tree);
...
...
src/bin/auth/statistics.h
View file @
92cf23f1
...
...
@@ -33,14 +33,14 @@ namespace isc {
namespace
auth
{
namespace
statistics
{
/// \brief
Query/Respons
e attributes for statistics.
/// \brief
DNS Messag
e attributes for statistics.
///
/// This class holds some attributes related to a
query/respons
e
/// This class holds some attributes related to a
DNS messag
e
/// for statistics data collection.
///
/// This class does not have getter methods since it exposes private members
/// to \c Counters directly.
class
QR
Attributes
{
class
Message
Attributes
{
friend
class
Counters
;
private:
// request attributes
...
...
@@ -61,45 +61,45 @@ public:
/// This constructor is mostly exception free. But it may still throw
/// a standard exception if memory allocation fails inside the method.
///
QR
Attributes
()
{
Message
Attributes
()
{
reset
();
};
/// \brief Set que
ry
opcode.
/// \brief Set
re
que
st
opcode.
/// \throw None
void
set
Query
OpCode
(
const
int
opcode
)
{
void
set
Request
OpCode
(
const
int
opcode
)
{
req_opcode_
=
opcode
;
};
/// \brief Set IP version carrying a que
ry
.
/// \brief Set IP version carrying a
re
que
st
.
/// \throw None
void
set
Query
IPVersion
(
const
int
ip_version
)
{
void
set
Request
IPVersion
(
const
int
ip_version
)
{
req_ip_version_
=
ip_version
;
};
/// \brief Set transport protocol carrying a que
ry
.
/// \brief Set transport protocol carrying a
re
que
st
.
/// \throw None
void
set
Query
TransportProtocol
(
const
int
transport_protocol
)
{
void
set
Request
TransportProtocol
(
const
int
transport_protocol
)
{
req_transport_protocol_
=
transport_protocol
;
};
/// \brief Set que
ry
EDNS attributes.
/// \brief Set
re
que
st
EDNS attributes.
/// \throw None
void
set
Query
EDNS
(
const
bool
is_edns_0
,
const
bool
is_edns_badver
)
{
void
set
Request
EDNS
(
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 que
ry
DO bit.
/// \brief Set
re
que
st
DO bit.
/// \throw None
void
set
Query
DO
(
const
bool
is_dnssec_ok
)
{
void
set
Request
DO
(
const
bool
is_dnssec_ok
)
{
req_is_dnssec_ok_
=
is_dnssec_ok
;
};
/// \brief Set que
ry
TSIG attributes.
/// \brief Set
re
que
st
TSIG attributes.
/// \throw None
void
set
Query
Sig
(
const
bool
is_tsig
,
const
bool
is_sig0
,
const
bool
is_badsig
)
void
set
Request
Sig
(
const
bool
is_tsig
,
const
bool
is_sig0
,
const
bool
is_badsig
)
{
req_is_tsig_
=
is_tsig
;
req_is_sig0_
=
is_sig0
;
...
...
@@ -128,17 +128,17 @@ public:
};
};
/// \brief Set of
query
counters.
/// \brief Set of
DNS message
counters.
///
/// \c Counters is set of
query
counters class. It holds
query counters
/// and provides an interface to increment the counter of specified
type
/// (e.g. UDP
query, TCP query
).
/// \c Counters is set of
DNS message
counters class. It holds
DNS message
///
counters
and provides an interface to increment the counter of specified
///
type
(e.g. UDP
message, TCP message
).
///
/// This class also provides a function to send statistics information to
/// statistics module.
///
/// This class is designed to be a part of \c AuthSrv.
/// Call \c inc() to increment a counter for the
query
.
/// Call \c inc() to increment a counter for the
message
.
/// Call \c getStatistics() to answer statistics information to statistics
/// module with statistics_session, when the command \c getstats is received.
///
...
...
@@ -150,16 +150,16 @@ public:
/// This class is constructed on startup of the server, so
/// construction overhead of this approach should be acceptable.
///
/// \todo Hold counters for each
query
types (Notify, Axfr, Ixfr, Normal)
/// \todo Hold counters for each
message
types (Notify, Axfr, Ixfr, Normal)
/// \todo Consider overhead of \c Counters::inc()
class
Counters
:
boost
::
noncopyable
{
private:
// counter for
query/response
isc
::
statistics
::
Counter
server_
qr
_counter_
;
// counter for
DNS message attributes
isc
::
statistics
::
Counter
server_
msg
_counter_
;
// set of counters for zones
isc
::
statistics
::
CounterDictionary
zone_
qr
_counters_
;
void
incRequest
(
const
QR
Attributes
&
qr
attrs
);
void
incResponse
(
const
QR
Attributes
&
qr
attrs
,
isc
::
statistics
::
CounterDictionary
zone_
msg
_counters_
;
void
incRequest
(
const
Message
Attributes
&
msg
attrs
);
void
incResponse
(
const
Message
Attributes
&
msg
attrs
,
const
isc
::
dns
::
Message
&
response
);
public:
/// \brief A type of statistics item tree in isc::data::MapElement.
...
...
@@ -189,14 +189,14 @@ public:
/// This constructor is mostly exception free. But it may still throw
/// a standard exception if memory allocation fails inside the method.
///
/// \param
qr
attrs
Query/Respons
e attributes.
/// \param
msg
attrs
DNS messag
e attributes.
/// \param response DNS response message.
/// \param done DNS response was sent to the client.
///
/// \throw std::bad_alloc Internal resource allocation fails
///
void
inc
(
const
QR
Attributes
&
qr
attrs
,
const
isc
::
dns
::
Message
&
response
,
const
bool
done
);
void
inc
(
const
Message
Attributes
&
msg
attrs
,
const
isc
::
dns
::
Message
&
response
,
const
bool
done
);
/// \brief Get statistics counters.
///
...
...
src/bin/auth/statistics_items.h.pre
View file @
92cf23f1
...
...
@@ -30,8 +30,8 @@ struct CounterTypeTree {
// ### STATISTICS ITEMS DECLARATION ###
extern const int opcode_to_
qr
counter[];
extern const int rcode_to_
qr
counter[];
extern const int opcode_to_
msg
counter[];
extern const int rcode_to_
msg
counter[];
} // namespace statistics
} // namespace auth
...
...
src/bin/auth/statistics_msg_items.def
0 → 100644
View file @
92cf23f1
request MSGCounterRequest Request statistics =
v4 MSG_REQUEST_IPV4 Number of IPv4 requests received by the b10-auth server.
v6 MSG_REQUEST_IPV6 Number of IPv6 requests received by the b10-auth server.
edns0 MSG_REQUEST_EDNS0 Number of requests with EDNS0 received by the b10-auth server.
badednsver MSG_REQUEST_BADEDNSVER Number of requests with unsupported EDNS version received by the b10-auth server.
tsig MSG_REQUEST_TSIG Number of requests with TSIG received by the b10-auth server.
sig0 MSG_REQUEST_SIG0 Number of requests with SIG(0) received by the b10-auth server; currently not implemented in BIND 10.
badsig MSG_REQUEST_BADSIG Number of requests with invalid TSIG or SIG(0) signature received by the b10-auth server.
udp MSG_REQUEST_UDP Number of UDP requests received by the b10-auth server.
tcp MSG_REQUEST_TCP Number of UDP requests received by the b10-auth server.
dnssec_ok MSG_REQUEST_DNSSEC_OK Number of requests with "DNSSEC OK" (DO) bit was set received by the b10-auth server.
;
opcode MSGCounterOpcode Opcode statistics =
query MSG_OPCODE_QUERY Number of Opcode=QUERY requests received by the b10-auth server.
iquery MSG_OPCODE_IQUERY Number of Opcode=IQUERY requests received by the b10-auth server.
status MSG_OPCODE_STATUS Number of Opcode=STATUS requests received by the b10-auth server.
notify MSG_OPCODE_NOTIFY Number of Opcode=NOTIFY requests received by the b10-auth server.
update MSG_OPCODE_UPDATE Number of Opcode=UPDATE requests received by the b10-auth server.
other MSG_OPCODE_OTHER Number of requests in other OpCode received by the b10-auth server.
;
responses MSG_RESPONSE Number of responses sent by the b10-auth server.
response MSGCounterResponse Response statistics =
truncated MSG_RESPONSE_TRUNCATED Number of truncated responses sent by the b10-auth server.
edns0 MSG_RESPONSE_EDNS0 Number of responses with EDNS0 sent by the b10-auth server.
tsig MSG_RESPONSE_TSIG Number of responses with TSIG sent by the b10-auth server.
sig0 MSG_RESPONSE_SIG0 Number of responses with SIG(0) sent by the b10-auth server; currently not implemented in BIND 10.
;
qrysuccess MSG_QRYSUCCESS Number of queries received by the b10-auth server resulted in rcode = NOERROR and the number of answer RR >= 1.
qryauthans MSG_QRYAUTHANS Number of queries received by the b10-auth server resulted in authoritative answer.
qrynoauthans MSG_QRYNOAUTHANS Number of queries received by the b10-auth server resulted in non-authoritative answer.
qryreferral MSG_QRYREFERRAL Number of queries received by the b10-auth server resulted in referral answer.
qrynxrrset MSG_QRYNXRRSET Number of queries received by the b10-auth server resulted in NOERROR but the number of answer RR == 0.
authqryrej MSG_QRYREJECT Number of authoritative queries rejected by the b10-auth server.
rcode MSGCounterRcode Rcode statistics =
noerror MSG_RCODE_NOERROR Number of requests received by the b10-auth server resulted in RCODE = 0 (NoError).
formerr MSG_RCODE_FORMERR Number of requests received by the b10-auth server resulted in RCODE = 1 (FormErr).
servfail MSG_RCODE_SERVFAIL Number of requests received by the b10-auth server resulted in RCODE = 2 (ServFail).
nxdomain MSG_RCODE_NXDOMAIN Number of requests received by the b10-auth server resulted in RCODE = 3 (NXDomain).
notimp MSG_RCODE_NOTIMP Number of requests received by the b10-auth server resulted in RCODE = 4 (NotImp).
refused MSG_RCODE_REFUSED Number of requests received by the b10-auth server resulted in RCODE = 5 (Refused).
yxdomain MSG_RCODE_YXDOMAIN Number of requests received by the b10-auth server resulted in RCODE = 6 (YXDomain).
yxrrset MSG_RCODE_YXRRSET Number of requests received by the b10-auth server resulted in RCODE = 7 (YXRRSet).
nxrrset MSG_RCODE_NXRRSET Number of requests received by the b10-auth server resulted in RCODE = 8 (NXRRSet).
notauth MSG_RCODE_NOTAUTH Number of requests received by the b10-auth server resulted in RCODE = 9 (NotAuth).
notzone MSG_RCODE_NOTZONE Number of requests received by the b10-auth server resulted in RCODE = 10 (NotZone).
badvers MSG_RCODE_BADVERS Number of requests received by the b10-auth server resulted in RCODE = 16 (BADVERS).
other MSG_RCODE_OTHER Number of requests received by the b10-auth server resulted in other RCODEs.
;
src/bin/auth/statistics_qr_items.def
deleted
100644 → 0
View file @
7a821cf7
request QRCounterRequest Request statistics =
v4 QR_REQUEST_IPV4 Number of IPv4 requests received by the b10-auth server.
v6 QR_REQUEST_IPV6 Number of IPv6 requests received by the b10-auth server.
edns0 QR_REQUEST_EDNS0 Number of requests with EDNS0 received by the b10-auth server.