From: Yoshitaka Aharen Date: Wed, 7 Nov 2012 12:09:22 +0000 (+0900) Subject: [2157] apply review comments X-Git-Tag: bind10-1.1.0beta1-release~85^2~5^2~137 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1bd6030873ee6e27cddcbb6437ef15ca84ee9cfa;p=thirdparty%2Fkea.git [2157] apply review comments --- diff --git a/configure.ac b/configure.ac index b0644808ea..22410679a4 100644 --- a/configure.ac +++ b/configure.ac @@ -1279,6 +1279,7 @@ AC_OUTPUT([doc/version.ent src/bin/msgq/run_msgq.sh src/bin/auth/auth.spec.pre src/bin/auth/spec_config.h.pre + src/bin/auth/gen-statistics_items.py.pre src/bin/dhcp4/spec_config.h.pre src/bin/dhcp6/spec_config.h.pre src/bin/tests/process_rename_test.py @@ -1341,6 +1342,7 @@ AC_OUTPUT([doc/version.ent chmod +x src/bin/usermgr/run_b10-cmdctl-usermgr.sh chmod +x src/bin/msgq/run_msgq.sh chmod +x src/bin/msgq/tests/msgq_test + chmod +x src/bin/auth/gen-statistics_items.py.pre chmod +x src/lib/dns/gen-rdatacode.py chmod +x src/lib/log/tests/console_test.sh chmod +x src/lib/log/tests/destination_test.sh diff --git a/src/bin/auth/Makefile.am b/src/bin/auth/Makefile.am index 2060ad65df..13624986bc 100644 --- a/src/bin/auth/Makefile.am +++ b/src/bin/auth/Makefile.am @@ -18,6 +18,9 @@ pkglibexecdir = $(libexecdir)/@PACKAGE@ CLEANFILES = *.gcno *.gcda auth.spec spec_config.h CLEANFILES += auth_messages.h auth_messages.cc +CLEANFILES += gen-statistics_items.py +# auto-generated by gen-statistics_items.py +CLEANFILES += statistics.cc statistics_items.h b10-auth.xml tests/statistics_unittest.cc man_MANS = b10-auth.8 DISTCLEANFILES = $(man_MANS) @@ -36,8 +39,18 @@ $(man_MANS): endif -auth.spec: auth.spec.pre - $(SED) -e "s|@@LOCALSTATEDIR@@|$(localstatedir)|" auth.spec.pre >$@ +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 + +gen-statistics_items.py: gen-statistics_items.py.pre + $(SED) -e "s|@@LOCALSTATEDIR@@|$(localstatedir)|" gen-statistics_items.py.pre >$@ + chmod +x $@ + +auth.spec b10-auth.xml statistics_items.h statistics.cc tests/statistics_unittest.cc: Makefile gen-statistics_items.py + ./gen-statistics_items.py spec_config.h: spec_config.h.pre $(SED) -e "s|@@LOCALSTATEDIR@@|$(localstatedir)|" spec_config.h.pre >$@ @@ -46,6 +59,8 @@ auth_messages.h auth_messages.cc: auth_messages.mes $(top_builddir)/src/lib/log/compiler/message $(top_srcdir)/src/bin/auth/auth_messages.mes BUILT_SOURCES = spec_config.h auth_messages.h auth_messages.cc +# auto-generated by gen-statistics_items.py +BUILT_SOURCES += statistics_items.h statistics.cc pkglibexec_PROGRAMS = b10-auth b10_auth_SOURCES = query.cc query.h @@ -54,12 +69,17 @@ b10_auth_SOURCES += auth_log.cc auth_log.h b10_auth_SOURCES += auth_config.cc auth_config.h b10_auth_SOURCES += command.cc command.h b10_auth_SOURCES += common.h common.cc -b10_auth_SOURCES += statistics.cc statistics.h statistics_items.h +b10_auth_SOURCES += statistics.h b10_auth_SOURCES += datasrc_configurator.h 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 += b10-auth.xml.pre +EXTRA_DIST += statistics_items.h.pre statistics.cc.pre +EXTRA_DIST += tests/statistics_unittest.cc.pre b10_auth_LDADD = $(top_builddir)/src/lib/datasrc/libb10-datasrc.la b10_auth_LDADD += $(top_builddir)/src/lib/dns/libb10-dns++.la diff --git a/src/bin/auth/auth.spec.pre.in b/src/bin/auth/auth.spec.pre.in index 65652df383..a235da3a93 100644 --- a/src/bin/auth/auth.spec.pre.in +++ b/src/bin/auth/auth.spec.pre.in @@ -140,1253 +140,6 @@ } ], "statistics": [ - { - "item_name": "zones", - "item_type": "named_set", - "item_optional": false, - "item_title": "Zone statistics", - "item_description": "Zone statistics items. Items for all zones are stored in '_SERVER_'.", - "item_default": { - "_SERVER_": { - "request": { - "v4": 0, - "v6": 0, - "edns0": 0, - "badednsver": 0, - "tsig": 0, - "sig0": 0, - "badsig": 0, - "udp": 0, - "tcp": 0, - "dnssec_ok": 0 - }, - "opcode": { - "query": 0, - "iquery": 0, - "status": 0, - "notify": 0, - "update": 0, - "other": 0 - }, - "qtype": { - "a": 0, - "ns": 0, - "md": 0, - "mf": 0, - "cname": 0, - "soa": 0, - "mb": 0, - "mg": 0, - "mr": 0, - "null": 0, - "wks": 0, - "ptr": 0, - "hinfo": 0, - "minfo": 0, - "mx": 0, - "txt": 0, - "rp": 0, - "afsdb": 0, - "x25": 0, - "isdn": 0, - "rt": 0, - "nsap": 0, - "nsap-ptr": 0, - "sig": 0, - "key": 0, - "px": 0, - "gpos": 0, - "aaaa": 0, - "loc": 0, - "nxt": 0, - "eid": 0, - "nimloc": 0, - "srv": 0, - "atma": 0, - "naptr": 0, - "kx": 0, - "cert": 0, - "a6": 0, - "dname": 0, - "sink": 0, - "opt": 0, - "apl": 0, - "ds": 0, - "sshfp": 0, - "ipseckey": 0, - "rrsig": 0, - "nsec": 0, - "dnskey": 0, - "dhcid": 0, - "nsec3": 0, - "nsec3param": 0, - "hip": 0, - "ninfo": 0, - "rkey": 0, - "talink": 0, - "spf": 0, - "uinfo": 0, - "uid": 0, - "gid": 0, - "unspec": 0, - "tkey": 0, - "tsig": 0, - "ixfr": 0, - "axfr": 0, - "mailb": 0, - "maila": 0, - "uri": 0, - "caa": 0, - "ta": 0, - "dlv": 0, - "other": 0 - }, - "rcode": { - "noerror": 0, - "formerr": 0, - "servfail": 0, - "nxdomain": 0, - "notimp": 0, - "refused": 0, - "yxdomain": 0, - "yxrrset": 0, - "nxrrset": 0, - "notauth": 0, - "notzone": 0, - "badsigvers": 0, - "badkey": 0, - "badtime": 0, - "badmode": 0, - "badname": 0, - "badalg": 0, - "badtrunc": 0, - "other": 0 - }, - "authqryrej": 0, - "qryauthans": 0, - "qrynoauthans": 0, - "qrynxrrset": 0, - "qryreferral": 0, - "qrysuccess": 0, - "response": { - "edns0": 0, - "sig0": 0, - "truncated": 0, - "tsig": 0 - }, - "responses": 0 - } - }, - "named_set_item_spec": { - "item_name": "zone", - "item_type": "map", - "item_optional": false, - "item_default": { }, - "map_item_spec": [ - { - "item_name": "request", - "item_type": "map", - "item_optional": false, - "item_title": "request", - "item_description": "Request statistics", - "item_default": { - "v4": 0, - "v6": 0, - "edns0": 0, - "badednsver": 0, - "tsig": 0, - "sig0": 0, - "badsig": 0, - "udp": 0, - "tcp": 0, - "dnssec_ok": 0 - }, - "map_item_spec": [ - { - "item_name": "v4", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "v4", - "item_description": "Number of IPv4 requests received" - }, - { - "item_name": "v6", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "v6", - "item_description": "Number of IPv6 requests received" - }, - { - "item_name": "edns0", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "edns0", - "item_description": "Number of requests with EDNS(0) received" - }, - { - "item_name": "badednsver", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "badednsver", - "item_description": "Number of requests with unsupported EDNS version received" - }, - { - "item_name": "tsig", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "tsig", - "item_description": "Number of requests with TSIG received" - }, - { - "item_name": "sig0", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "sig0", - "item_description": "Number of requests with SIG(0) received; currently not implemented in BIND 10" - }, - { - "item_name": "badsig", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "badsig", - "item_description": "Number of requests with invalid TSIG or SIG(0) signature received" - }, - { - "item_name": "udp", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "udp", - "item_description": "Number of UDP requests received" - }, - { - "item_name": "tcp", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "tcp", - "item_description": "Number of TCP requests received" - }, - { - "item_name": "dnssec_ok", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "dnssec_ok", - "item_description": "Number of requests with DO bit" - } - ] - }, - { - "item_name": "opcode", - "item_type": "map", - "item_optional": false, - "item_title": "opcode", - "item_description": "Opcode statistics", - "item_default": { - "query": 0, - "iquery": 0, - "status": 0, - "notify": 0, - "update": 0, - "other": 0 - }, - "map_item_spec": [ - { - "item_name": "query", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "query", - "item_description": "Number of Opcode=QUERY requests received" - }, - { - "item_name": "iquery", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "iquery", - "item_description": "Number of Opcode=IQUERY requests received" - }, - { - "item_name": "status", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "status", - "item_description": "Number of Opcode=STATUS requests received" - }, - { - "item_name": "notify", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "notify", - "item_description": "Number of Opcode=NOTIFY requests received" - }, - { - "item_name": "update", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "update", - "item_description": "Number of Opcode=UPDATE requests received" - }, - { - "item_name": "other", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "other", - "item_description": "Number of requests in other OpCode received" - } - ] - }, - { - "item_name": "qtype", - "item_type": "map", - "item_optional": false, - "item_title": "qtype", - "item_description": "Query RRtype statistics", - "item_default": { - "a": 0, - "ns": 0, - "md": 0, - "mf": 0, - "cname": 0, - "soa": 0, - "mb": 0, - "mg": 0, - "mr": 0, - "null": 0, - "wks": 0, - "ptr": 0, - "hinfo": 0, - "minfo": 0, - "mx": 0, - "txt": 0, - "rp": 0, - "afsdb": 0, - "x25": 0, - "isdn": 0, - "rt": 0, - "nsap": 0, - "nsap-ptr": 0, - "sig": 0, - "key": 0, - "px": 0, - "gpos": 0, - "aaaa": 0, - "loc": 0, - "nxt": 0, - "eid": 0, - "nimloc": 0, - "srv": 0, - "atma": 0, - "naptr": 0, - "kx": 0, - "cert": 0, - "a6": 0, - "dname": 0, - "sink": 0, - "opt": 0, - "apl": 0, - "ds": 0, - "sshfp": 0, - "ipseckey": 0, - "rrsig": 0, - "nsec": 0, - "dnskey": 0, - "dhcid": 0, - "nsec3": 0, - "nsec3param": 0, - "hip": 0, - "ninfo": 0, - "rkey": 0, - "talink": 0, - "spf": 0, - "uinfo": 0, - "uid": 0, - "gid": 0, - "unspec": 0, - "tkey": 0, - "tsig": 0, - "ixfr": 0, - "axfr": 0, - "mailb": 0, - "maila": 0, - "uri": 0, - "caa": 0, - "ta": 0, - "dlv": 0, - "other": 0 - }, - "map_item_spec": [ - { - "item_name": "a", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "a", - "item_description": "Number of QTYPE = A queries received" - }, - { - "item_name": "ns", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "ns", - "item_description": "Number of QTYPE = NS queries received" - }, - { - "item_name": "md", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "md", - "item_description": "Number of QTYPE = MD queries received" - }, - { - "item_name": "mf", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "mf", - "item_description": "Number of QTYPE = MF queries received" - }, - { - "item_name": "cname", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "cname", - "item_description": "Number of QTYPE = CNAME queries received" - }, - { - "item_name": "soa", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "soa", - "item_description": "Number of QTYPE = SOA queries received" - }, - { - "item_name": "mb", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "mb", - "item_description": "Number of QTYPE = MB queries received" - }, - { - "item_name": "mg", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "mg", - "item_description": "Number of QTYPE = MG queries received" - }, - { - "item_name": "mr", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "mr", - "item_description": "Number of QTYPE = MR queries received" - }, - { - "item_name": "null", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "null", - "item_description": "Number of QTYPE = NULL queries received" - }, - { - "item_name": "wks", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "wks", - "item_description": "Number of QTYPE = WKS queries received" - }, - { - "item_name": "ptr", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "ptr", - "item_description": "Number of QTYPE = PTR queries received" - }, - { - "item_name": "hinfo", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "hinfo", - "item_description": "Number of QTYPE = HINFO queries received" - }, - { - "item_name": "minfo", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "minfo", - "item_description": "Number of QTYPE = MINFO queries received" - }, - { - "item_name": "mx", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "mx", - "item_description": "Number of QTYPE = MX queries received" - }, - { - "item_name": "txt", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "txt", - "item_description": "Number of QTYPE = TXT queries received" - }, - { - "item_name": "rp", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "rp", - "item_description": "Number of QTYPE = RP queries received" - }, - { - "item_name": "afsdb", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "afsdb", - "item_description": "Number of QTYPE = AFSDB queries received" - }, - { - "item_name": "x25", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "x25", - "item_description": "Number of QTYPE = X25 queries received" - }, - { - "item_name": "isdn", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "isdn", - "item_description": "Number of QTYPE = ISDN queries received" - }, - { - "item_name": "rt", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "rt", - "item_description": "Number of QTYPE = RT queries received" - }, - { - "item_name": "nsap", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "nsap", - "item_description": "Number of QTYPE = NSAP queries received" - }, - { - "item_name": "nsap-ptr", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "nsap-ptr", - "item_description": "Number of QTYPE = NSAP-PTR queries received" - }, - { - "item_name": "sig", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "sig", - "item_description": "Number of QTYPE = SIG queries received" - }, - { - "item_name": "key", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "key", - "item_description": "Number of QTYPE = KEY queries received" - }, - { - "item_name": "px", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "px", - "item_description": "Number of QTYPE = PX queries received" - }, - { - "item_name": "gpos", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "gpos", - "item_description": "Number of QTYPE = GPOS queries received" - }, - { - "item_name": "aaaa", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "aaaa", - "item_description": "Number of QTYPE = AAAA queries received" - }, - { - "item_name": "loc", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "loc", - "item_description": "Number of QTYPE = LOC queries received" - }, - { - "item_name": "nxt", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "nxt", - "item_description": "Number of QTYPE = NXT queries received" - }, - { - "item_name": "eid", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "eid", - "item_description": "Number of QTYPE = EID queries received" - }, - { - "item_name": "nimloc", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "nimloc", - "item_description": "Number of QTYPE = NIMLOC queries received" - }, - { - "item_name": "srv", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "srv", - "item_description": "Number of QTYPE = SRV queries received" - }, - { - "item_name": "atma", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "atma", - "item_description": "Number of QTYPE = ATMA queries received" - }, - { - "item_name": "naptr", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "naptr", - "item_description": "Number of QTYPE = NAPTR queries received" - }, - { - "item_name": "kx", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "kx", - "item_description": "Number of QTYPE = KX queries received" - }, - { - "item_name": "cert", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "cert", - "item_description": "Number of QTYPE = CERT queries received" - }, - { - "item_name": "a6", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "a6", - "item_description": "Number of QTYPE = A6 queries received" - }, - { - "item_name": "dname", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "dname", - "item_description": "Number of QTYPE = DNAME queries received" - }, - { - "item_name": "sink", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "sink", - "item_description": "Number of QTYPE = SINK queries received" - }, - { - "item_name": "opt", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "opt", - "item_description": "Number of QTYPE = OPT queries received" - }, - { - "item_name": "apl", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "apl", - "item_description": "Number of QTYPE = APL queries received" - }, - { - "item_name": "ds", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "ds", - "item_description": "Number of QTYPE = DS queries received" - }, - { - "item_name": "sshfp", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "sshfp", - "item_description": "Number of QTYPE = SSHFP queries received" - }, - { - "item_name": "ipseckey", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "ipseckey", - "item_description": "Number of QTYPE = IPSECKEY queries received" - }, - { - "item_name": "rrsig", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "rrsig", - "item_description": "Number of QTYPE = RRSIG queries received" - }, - { - "item_name": "nsec", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "nsec", - "item_description": "Number of QTYPE = NSEC queries received" - }, - { - "item_name": "dnskey", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "dnskey", - "item_description": "Number of QTYPE = DNSKEY queries received" - }, - { - "item_name": "dhcid", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "dhcid", - "item_description": "Number of QTYPE = DHCID queries received" - }, - { - "item_name": "nsec3", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "nsec3", - "item_description": "Number of QTYPE = NSEC3 queries received" - }, - { - "item_name": "nsec3param", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "nsec3param", - "item_description": "Number of QTYPE = NSEC3PARAM queries received" - }, - { - "item_name": "hip", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "hip", - "item_description": "Number of QTYPE = HIP queries received" - }, - { - "item_name": "ninfo", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "ninfo", - "item_description": "Number of QTYPE = NINFO queries received" - }, - { - "item_name": "rkey", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "rkey", - "item_description": "Number of QTYPE = RKEY queries received" - }, - { - "item_name": "talink", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "talink", - "item_description": "Number of QTYPE = TALINK queries received" - }, - { - "item_name": "spf", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "spf", - "item_description": "Number of QTYPE = SPF queries received" - }, - { - "item_name": "uinfo", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "uinfo", - "item_description": "Number of QTYPE = UINFO queries received" - }, - { - "item_name": "uid", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "uid", - "item_description": "Number of QTYPE = UID queries received" - }, - { - "item_name": "gid", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "gid", - "item_description": "Number of QTYPE = GID queries received" - }, - { - "item_name": "unspec", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "unspec", - "item_description": "Number of QTYPE = UNSPEC queries received" - }, - { - "item_name": "tkey", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "tkey", - "item_description": "Number of QTYPE = TKEY queries received" - }, - { - "item_name": "tsig", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "tsig", - "item_description": "Number of QTYPE = TSIG queries received" - }, - { - "item_name": "ixfr", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "ixfr", - "item_description": "Number of QTYPE = IXFR queries received" - }, - { - "item_name": "axfr", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "axfr", - "item_description": "Number of QTYPE = AXFR queries received" - }, - { - "item_name": "mailb", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "mailb", - "item_description": "Number of QTYPE = MAILB queries received" - }, - { - "item_name": "maila", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "maila", - "item_description": "Number of QTYPE = MAILA queries received" - }, - { - "item_name": "uri", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "uri", - "item_description": "Number of QTYPE = URI queries received" - }, - { - "item_name": "caa", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "caa", - "item_description": "Number of QTYPE = CAA queries received" - }, - { - "item_name": "ta", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "ta", - "item_description": "Number of QTYPE = TA queries received" - }, - { - "item_name": "dlv", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "dlv", - "item_description": "Number of QTYPE = DLV queries received" - }, - { - "item_name": "other", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "other", - "item_description": "Number of queries in other QTYPE received" - } - ] - }, - { - "item_name": "responses", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "responses", - "item_description": "Number of responses sent" - }, - { - "item_name": "response", - "item_type": "map", - "item_optional": false, - "item_title": "response", - "item_description": "Request statistics", - "item_default": { - "truncated": 0, - "edns0": 0, - "tsig": 0, - "sig0": 0 - }, - "map_item_spec": [ - { - "item_name": "truncated", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "truncated", - "item_description": "Number of truncated responses sent" - }, - { - "item_name": "edns0", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "edns0", - "item_description": "Number of responses with EDNS0" - }, - { - "item_name": "tsig", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "tsig", - "item_description": "Number of responses with TSIG" - }, - { - "item_name": "sig0", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "sig0", - "item_description": "Number of responses with SIG(0); currently not implemented in BIND 10" - } - ] - }, - { - "item_name": "qrysuccess", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "qrysuccess", - "item_description": "Number of queries resulted in rcode = NOERROR and answer RR >= 1" - }, - { - "item_name": "qryauthans", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "qryauthans", - "item_description": "Number of queries resulted in authoritative answer" - }, - { - "item_name": "qrynoauthans", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "qrynoauthans", - "item_description": "Number of queries resulted in non-authoritative answer" - }, - { - "item_name": "qryreferral", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "qryreferral", - "item_description": "Number of queries resulted in referral answer" - }, - { - "item_name": "qrynxrrset", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "qrynxrrset", - "item_description": "Number of queries resulted in NOERROR but answer RR == 0" - }, - { - "item_name": "authqryrej", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "authqryrej", - "item_description": "Number of authoritative queries rejected" - }, - { - "item_name": "rcode", - "item_type": "map", - "item_optional": false, - "item_title": "rcode", - "item_description": "Rcode statistics", - "item_default": { - "noerror": 0, - "formerr": 0, - "servfail": 0, - "nxdomain": 0, - "notimp": 0, - "refused": 0, - "yxdomain": 0, - "yxrrset": 0, - "nxrrset": 0, - "notauth": 0, - "notzone": 0, - "badsigvers": 0, - "badkey": 0, - "badtime": 0, - "badmode": 0, - "badname": 0, - "badalg": 0, - "badtrunc": 0, - "other": 0 - }, - "map_item_spec": [ - { - "item_name": "noerror", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "noerror", - "item_description": "Number of queries resulted in RCODE = 0 (NoError)" - }, - { - "item_name": "formerr", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "formerr", - "item_description": "Number of queries resulted in RCODE = 1 (FormErr)" - }, - { - "item_name": "servfail", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "servfail", - "item_description": "Number of queries resulted in RCODE = 2 (ServFail)" - }, - { - "item_name": "nxdomain", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "nxdomain", - "item_description": "Number of queries resulted in RCODE = 3 (NXDomain)" - }, - { - "item_name": "notimp", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "notimp", - "item_description": "Number of queries resulted in RCODE = 4 (NotImp)" - }, - { - "item_name": "refused", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "refused", - "item_description": "Number of queries resulted in RCODE = 5 (Refused)" - }, - { - "item_name": "yxdomain", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "yxdomain", - "item_description": "Number of queries resulted in RCODE = 6 (YXDomain)" - }, - { - "item_name": "yxrrset", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "yxrrset", - "item_description": "Number of queries resulted in RCODE = 7 (YXRRSet)" - }, - { - "item_name": "nxrrset", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "nxrrset", - "item_description": "Number of queries resulted in RCODE = 8 (NXRRSet)" - }, - { - "item_name": "notauth", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "notauth", - "item_description": "Number of queries resulted in RCODE = 9 (NotAuth)" - }, - { - "item_name": "notzone", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "notzone", - "item_description": "Number of queries resulted in RCODE = 10 (NotZone)" - }, - { - "item_name": "badsigvers", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "badsigvers", - "item_description": "Number of queries resulted in RCODE = 16 (BADVERS, BADSIG)" - }, - { - "item_name": "badkey", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "badkey", - "item_description": "Number of queries resulted in RCODE = 17 (BADKEY)" - }, - { - "item_name": "badtime", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "badtime", - "item_description": "Number of queries resulted in RCODE = 18 (BADTIME)" - }, - { - "item_name": "badmode", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "badmode", - "item_description": "Number of queries resulted in RCODE = 19 (BADMODE)" - }, - { - "item_name": "badname", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "badname", - "item_description": "Number of queries resulted in RCODE = 20 (BADNAME)" - }, - { - "item_name": "badalg", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "badalg", - "item_description": "Number of queries resulted in RCODE = 21 (BADALG)" - }, - { - "item_name": "badtrunc", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "badtrunc", - "item_description": "Number of queries resulted in RCODE = 22 (BADTRUNC)" - }, - { - "item_name": "other", - "item_type": "integer", - "item_optional": false, - "item_default": 0, - "item_title": "other", - "item_description": "Number of queries resulted in other RCODEs" - } - ] - } - ] - } - } ] } } diff --git a/src/bin/auth/b10-auth.xml b/src/bin/auth/b10-auth.xml deleted file mode 100644 index 1cfb92789b..0000000000 --- a/src/bin/auth/b10-auth.xml +++ /dev/null @@ -1,1075 +0,0 @@ -]> - - - - - - October 3, 2012 - - - - b10-auth - 8 - BIND10 - - - - b10-auth - Authoritative DNS server - - - - - 2010-2012 - Internet Systems Consortium, Inc. ("ISC") - - - - - - b10-auth - - - - - - DESCRIPTION - The b10-auth daemon provides the BIND 10 - authoritative DNS server. - Normally it is started by the - bind108 - boss process. - - - - This daemon communicates with other BIND 10 components over a - b10-msgq8 - C-Channel connection. If this connection is not established, - b10-auth will exit. - - It receives its configurations from -b10-cfgmgr8. - - - - - - - - - OPTIONS - - The arguments are as follows: - - - - - - Enable verbose logging mode. This enables logging of - diagnostic messages at the maximum debug level. - - - - - - - - - CONFIGURATION AND COMMANDS - - The configurable settings are: - - - - database_file defines the path to the - SQLite3 zone file when using the sqlite datasource. - The default is - /usr/local/var/bind10-devel/zone.sqlite3. - - - - datasources configures data sources. - The list items include: - type to define the required data source type - (such as memory); - class to optionally select the class - (it defaults to IN); - and - zones to define the - file path name, - origin (default domain), and optional - filetype. - By default, zones is empty. - For the in-memory data source (i.e., the type - is memory), the optional filetype - configuration item for zones can be - specified so the in-memory zone data can be built from another - data source that is based on a database backend (in practice - with current implementation, it would be an SQLite3 database - file for the SQLite3 data source). - See the BIND 10 Guide for configuration - details. - - - Only the IN class is supported at this time. - By default, the memory data source is disabled. - Also, currently the zone file must be canonical such as - generated by named-compilezone -D. - - - - - listen_on is a list of addresses and ports for - b10-auth to listen on. - The list items are the address string - and port number. - By default, b10-auth listens on port 53 - on the IPv6 (::) and IPv4 (0.0.0.0) wildcard addresses. - - - - tcp_recv_timeout is the timeout used on - incoming TCP connections, in milliseconds. If the query - is not sent within this time, the connection is closed. - Setting this to 0 will disable TCP timeouts completely. - - - - - The configuration commands are: - - - - loadzone tells b10-auth - to load or reload a zone file. The arguments include: - class which optionally defines the class - (it defaults to IN); - origin is the domain name of the zone; - and - datasrc optionally defines the type of datasource - (it defaults to memory). - - - In this development version, currently this only supports the - IN class and the memory data source. - - - - - getstats tells b10-auth - to send its statistics data. - - - - shutdown exits b10-auth. - This has an optional pid argument to - select the process ID to stop. - (Note that the BIND 10 boss process may restart this service - if configured.) - - - - - - STATISTICS DATA - - - The statistics data collected by the b10-stats - daemon for Auth include: - - - - - - request.v4 - Number of IPv4 requests received by the - b10-auth server. - - - - - request.v6 - Number of IPv6 requests received by the - b10-auth server. - - - - - request.edns0 - Number of requests with EDNS(0) received by the - b10-auth server. - - - - - request.badednsver - Number of requests with unsupported EDNS version - received by the b10-auth server. - - - - - request.tsig - Number of requests with TSIG received by the - b10-auth server. - - - - - request.sig0 - Number of requests with SIG(0) received by the - b10-auth server; currently not implemented in - BIND 10. - - - - - request.badsig - Number of requests with invalid TSIG or SIG(0) - signature received by the b10-auth server. - - - - - request.udp - Number of UDP requests received by the - b10-auth server. - - - - - request.tcp - Number of TCP requests received by the - b10-auth server. - - - - - request.dnssec_ok - Number of requests with DO bit by the - b10-auth server. - - - - - opcode.query - Number of Opcode=QUERY requests received by the - b10-auth server. - - - - - opcode.iquery - Number of Opcode=IQUERY requests received by the - b10-auth server. - - - - - opcode.status - Number of Opcode=STATUS requests received by the - b10-auth server. - - - - - opcode.notify - Number of Opcode=NOTIFY requests received by the - b10-auth server. - - - - - opcode.update - Number of Opcode=UPDATE requests received by the - b10-auth server. - - - - - opcode.other - Number of requests in other OpCode received by the - b10-auth server. - - - - - qtype.a - Number of QTYPE = A queries received by the - b10-auth server. - - - - - qtype.ns - Number of QTYPE = NS queries received by the - b10-auth server. - - - - - qtype.md - Number of QTYPE = MD queries received by the - b10-auth server. - - - - - qtype.mf - Number of QTYPE = MF queries received by the - b10-auth server. - - - - - qtype.cname - Number of QTYPE = CNAME queries received by the - b10-auth server. - - - - - qtype.soa - Number of QTYPE = SOA queries received by the - b10-auth server. - - - - - qtype.mb - Number of QTYPE = MB queries received by the - b10-auth server. - - - - - qtype.mg - Number of QTYPE = MG queries received by the - b10-auth server. - - - - - qtype.mr - Number of QTYPE = MR queries received by the - b10-auth server. - - - - - qtype.null - Number of QTYPE = NULL queries received by the - b10-auth server. - - - - - qtype.wks - Number of QTYPE = WKS queries received by the - b10-auth server. - - - - - qtype.ptr - Number of QTYPE = PTR queries received by the - b10-auth server. - - - - - qtype.hinfo - Number of QTYPE = HINFO queries received by the - b10-auth server. - - - - - qtype.minfo - Number of QTYPE = MINFO queries received by the - b10-auth server. - - - - - qtype.mx - Number of QTYPE = MX queries received by the - b10-auth server. - - - - - qtype.txt - Number of QTYPE = TXT queries received by the - b10-auth server. - - - - - qtype.rp - Number of QTYPE = RP queries received by the - b10-auth server. - - - - - qtype.afsdb - Number of QTYPE = AFSDB queries received by the - b10-auth server. - - - - - qtype.x25 - Number of QTYPE = X25 queries received by the - b10-auth server. - - - - - qtype.isdn - Number of QTYPE = ISDN queries received by the - b10-auth server. - - - - - qtype.rt - Number of QTYPE = RT queries received by the - b10-auth server. - - - - - qtype.nsap - Number of QTYPE = NSAP queries received by the - b10-auth server. - - - - - qtype.nsap-ptr - Number of QTYPE = NSAP-PTR queries received by the - b10-auth server. - - - - - qtype.sig - Number of QTYPE = SIG queries received by the - b10-auth server. - - - - - qtype.key - Number of QTYPE = KEY queries received by the - b10-auth server. - - - - - qtype.px - Number of QTYPE = PX queries received by the - b10-auth server. - - - - - qtype.gpos - Number of QTYPE = GPOS queries received by the - b10-auth server. - - - - - qtype.aaaa - Number of QTYPE = AAAA queries received by the - b10-auth server. - - - - - qtype.loc - Number of QTYPE = LOC queries received by the - b10-auth server. - - - - - qtype.nxt - Number of QTYPE = NXT queries received by the - b10-auth server. - - - - - qtype.eid - Number of QTYPE = EID queries received by the - b10-auth server. - - - - - qtype.nimloc - Number of QTYPE = NIMLOC queries received by the - b10-auth server. - - - - - qtype.srv - Number of QTYPE = SRV queries received by the - b10-auth server. - - - - - qtype.atma - Number of QTYPE = ATMA queries received by the - b10-auth server. - - - - - qtype.naptr - Number of QTYPE = NAPTR queries received by the - b10-auth server. - - - - - qtype.kx - Number of QTYPE = KX queries received by the - b10-auth server. - - - - - qtype.cert - Number of QTYPE = CERT queries received by the - b10-auth server. - - - - - qtype.a6 - Number of QTYPE = A6 queries received by the - b10-auth server. - - - - - qtype.dname - Number of QTYPE = DNAME queries received by the - b10-auth server. - - - - - qtype.sink - Number of QTYPE = SINK queries received by the - b10-auth server. - - - - - qtype.opt - Number of QTYPE = OPT queries received by the - b10-auth server. - - - - - qtype.apl - Number of QTYPE = APL queries received by the - b10-auth server. - - - - - qtype.ds - Number of QTYPE = DS queries received by the - b10-auth server. - - - - - qtype.sshfp - Number of QTYPE = SSHFP queries received by the - b10-auth server. - - - - - qtype.ipseckey - Number of QTYPE = IPSECKEY queries received by the - b10-auth server. - - - - - qtype.rrsig - Number of QTYPE = RRSIG queries received by the - b10-auth server. - - - - - qtype.nsec - Number of QTYPE = NSEC queries received by the - b10-auth server. - - - - - qtype.dnskey - Number of QTYPE = DNSKEY queries received by the - b10-auth server. - - - - - qtype.dhcid - Number of QTYPE = DHCID queries received by the - b10-auth server. - - - - - qtype.nsec3 - Number of QTYPE = NSEC3 queries received by the - b10-auth server. - - - - - qtype.nsec3param - Number of QTYPE = NSEC3PARAM queries received by the - b10-auth server. - - - - - qtype.hip - Number of QTYPE = HIP queries received by the - b10-auth server. - - - - - qtype.ninfo - Number of QTYPE = NINFO queries received by the - b10-auth server. - - - - - qtype.rkey - Number of QTYPE = RKEY queries received by the - b10-auth server. - - - - - qtype.talink - Number of QTYPE = TALINK queries received by the - b10-auth server. - - - - - qtype.spf - Number of QTYPE = SPF queries received by the - b10-auth server. - - - - - qtype.uinfo - Number of QTYPE = UINFO queries received by the - b10-auth server. - - - - - qtype.uid - Number of QTYPE = UID queries received by the - b10-auth server. - - - - - qtype.gid - Number of QTYPE = GID queries received by the - b10-auth server. - - - - - qtype.unspec - Number of QTYPE = UNSPEC queries received by the - b10-auth server. - - - - - qtype.tkey - Number of QTYPE = TKEY queries received by the - b10-auth server. - - - - - qtype.tsig - Number of QTYPE = TSIG queries received by the - b10-auth server. - - - - - qtype.ixfr - Number of QTYPE = IXFR queries received by the - b10-auth server. - - - - - qtype.axfr - Number of QTYPE = AXFR queries received by the - b10-auth server. - - - - - qtype.mailb - Number of QTYPE = MAILB queries received by the - b10-auth server. - - - - - qtype.maila - Number of QTYPE = MAILA queries received by the - b10-auth server. - - - - - qtype.uri - Number of QTYPE = URI queries received by the - b10-auth server. - - - - - qtype.caa - Number of QTYPE = CAA queries received by the - b10-auth server. - - - - - qtype.ta - Number of QTYPE = TA queries received by the - b10-auth server. - - - - - qtype.dlv - Number of QTYPE = DLV queries received by the - b10-auth server. - - - - - qtype.other - Number of queries in other QTYPE received by the - b10-auth server. - - - - - response - Number of responses sent by the - b10-auth server. - - - - - response.truncated - Number of truncated responses sent by the - b10-auth server. - - - - - response.edns0 - Number of responses with EDNS0 sent by the - b10-auth server. - - - - - response.tsig - Number of responses with TSIG sent by the - b10-auth server. - - - - - response.sig0 - Number of responses with SIG(0) sent by the - b10-auth server; currently not implemented in - BIND 10. - - - - - qrysuccess - Number of queries received by the - b10-auth server resulted in rcode = NOERROR and - the number of answer RR >= 1. - - - - - qryauthans - Number of queries received by the - b10-auth server resulted in authoritative answer. - - - - - qrynoauthans - Number of queries received by the - b10-auth server resulted in non-authoritative - answer. - - - - - qryreferral - Number of queries received by the - b10-auth server resulted in referral answer. - - - - - qrynxrrset - Number of queries received by the - b10-auth server resulted in NOERROR but the - number of answer RR == 0. - - - - - authqryrej - Number of authoritative queries rejected by the - b10-auth server. - - - - - rcode.noerror - Number of queries received by the - b10-auth server resulted in RCODE = 0 (NoError). - - - - - rcode.formerr - Number of queries received by the - b10-auth server resulted in RCODE = 1 (FormErr). - - - - - rcode.servfail - Number of queries received by the - b10-auth server resulted in RCODE = 2 (ServFail). - - - - - rcode.nxdomain - Number of queries received by the - b10-auth server resulted in RCODE = 3 (NXDomain). - - - - - rcode.notimp - Number of queries received by the - b10-auth server resulted in RCODE = 4 (NotImp). - - - - - rcode.refused - Number of queries received by the - b10-auth server resulted in RCODE = 5 (Refused). - - - - - rcode.yxdomain - Number of queries received by the - b10-auth server resulted in RCODE = 6 (YXDomain). - - - - - rcode.yxrrset - Number of queries received by the - b10-auth server resulted in RCODE = 7 (YXRRSet). - - - - - rcode.nxrrset - Number of queries received by the - b10-auth server resulted in RCODE = 8 (NXRRSet). - - - - - rcode.notauth - Number of queries received by the - b10-auth server resulted in RCODE = 9 (NotAuth). - - - - - rcode.notzone - Number of queries received by the - b10-auth server resulted in RCODE = 10 (NotZone). - - - - - rcode.badsigvers - Number of queries received by the - b10-auth server resulted in RCODE = 16 (BADVERS, - BADSIG). - - - - - rcode.badkey - Number of queries received by the - b10-auth server resulted in RCODE = 17 (BADKEY). - - - - - rcode.badtime - Number of queries received by the - b10-auth server resulted in RCODE = 18 (BADTIME). - - - - - rcode.badmode - Number of queries received by the - b10-auth server resulted in RCODE = 19 (BADMODE). - - - - - rcode.badname - Number of queries received by the - b10-auth server resulted in RCODE = 20 (BADNAME). - - - - - rcode.badalg - Number of queries received by the - b10-auth server resulted in RCODE = 21 (BADALG). - - - - - rcode.badtrunc - Number of queries received by the - b10-auth server resulted in RCODE = 22 (BADTRUNC). - - - - - rcode.other - Number of queries received by the - b10-auth server resulted in other RCODEs. - - - - - - - - - - - FILES - - /usr/local/var/bind10-devel/zone.sqlite3 - — Location for the SQLite3 zone database - when database_file configuration is not - defined. - - - - - SEE ALSO - - - b10-cfgmgr8 - , - - b10-loadzone8 - , - - b10-msgq8 - , - - b10-stats8 - , - - b10-zonemgr8 - , - - bind108 - , - BIND 10 Guide. - - - - - HISTORY - - The b10-auth daemon was first coded in October 2009. - - - diff --git a/src/bin/auth/b10-auth.xml.pre b/src/bin/auth/b10-auth.xml.pre new file mode 100644 index 0000000000..46ff2f0d47 --- /dev/null +++ b/src/bin/auth/b10-auth.xml.pre @@ -0,0 +1,248 @@ +]> + + + + + + October 3, 2012 + + + + b10-auth + 8 + BIND10 + + + + b10-auth + Authoritative DNS server + + + + + 2010-2012 + Internet Systems Consortium, Inc. ("ISC") + + + + + + b10-auth + + + + + + DESCRIPTION + The b10-auth daemon provides the BIND 10 + authoritative DNS server. + Normally it is started by the + bind108 + boss process. + + + + This daemon communicates with other BIND 10 components over a + b10-msgq8 + C-Channel connection. If this connection is not established, + b10-auth will exit. + + It receives its configurations from +b10-cfgmgr8. + + + + + + + + + OPTIONS + + The arguments are as follows: + + + + + + Enable verbose logging mode. This enables logging of + diagnostic messages at the maximum debug level. + + + + + + + + + CONFIGURATION AND COMMANDS + + The configurable settings are: + + + + database_file defines the path to the + SQLite3 zone file when using the sqlite datasource. + The default is + @@LOCALSTATEDIR@@/bind10-devel/zone.sqlite3. + + + + datasources configures data sources. + The list items include: + type to define the required data source type + (such as memory); + class to optionally select the class + (it defaults to IN); + and + zones to define the + file path name, + origin (default domain), and optional + filetype. + By default, zones is empty. + For the in-memory data source (i.e., the type + is memory), the optional filetype + configuration item for zones can be + specified so the in-memory zone data can be built from another + data source that is based on a database backend (in practice + with current implementation, it would be an SQLite3 database + file for the SQLite3 data source). + See the BIND 10 Guide for configuration + details. + + + Only the IN class is supported at this time. + By default, the memory data source is disabled. + Also, currently the zone file must be canonical such as + generated by named-compilezone -D. + + + + + listen_on is a list of addresses and ports for + b10-auth to listen on. + The list items are the address string + and port number. + By default, b10-auth listens on port 53 + on the IPv6 (::) and IPv4 (0.0.0.0) wildcard addresses. + + + + tcp_recv_timeout is the timeout used on + incoming TCP connections, in milliseconds. If the query + is not sent within this time, the connection is closed. + Setting this to 0 will disable TCP timeouts completely. + + + + + The configuration commands are: + + + + loadzone tells b10-auth + to load or reload a zone file. The arguments include: + class which optionally defines the class + (it defaults to IN); + origin is the domain name of the zone; + and + datasrc optionally defines the type of datasource + (it defaults to memory). + + + In this development version, currently this only supports the + IN class and the memory data source. + + + + + getstats tells b10-auth + to send its statistics data. + + + + shutdown exits b10-auth. + This has an optional pid argument to + select the process ID to stop. + (Note that the BIND 10 boss process may restart this service + if configured.) + + + + + + STATISTICS DATA + + + The statistics data collected by the b10-stats + daemon for Auth include: + + + + + + + + + + FILES + + @@LOCALSTATEDIR@@/bind10-devel/zone.sqlite3 + — Location for the SQLite3 zone database + when database_file configuration is not + defined. + + + + + SEE ALSO + + + b10-cfgmgr8 + , + + b10-loadzone8 + , + + b10-msgq8 + , + + b10-stats8 + , + + b10-zonemgr8 + , + + bind108 + , + BIND 10 Guide. + + + + + HISTORY + + The b10-auth daemon was first coded in October 2009. + + + diff --git a/src/bin/auth/gen-statistics_items.py.pre.in b/src/bin/auth/gen-statistics_items.py.pre.in new file mode 100755 index 0000000000..77b465942c --- /dev/null +++ b/src/bin/auth/gen-statistics_items.py.pre.in @@ -0,0 +1,276 @@ +#!@PYTHON@ + +# Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC") +# +# Permission to use, copy, modify, and/or distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH +# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, +# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +# PERFORMANCE OF THIS SOFTWARE. + +import os +import re +import sys +import json +from xml.etree import ElementTree + +item_list = [] +localstatedir = '@@LOCALSTATEDIR@@' +builddir = '@builddir@' +srcdir = '@srcdir@' +pre_suffix = '.pre' + +xmldocument_command_name = 'b10-auth' + +def need_generate(filepath, mtime): + '''Check if we need to generate the specified file. + + To avoid unnecessary compilation, we skip (re)generating the file when + the file already exists and newer than the base file. + ''' + if os.path.exists(filepath) and os.path.getmtime(filepath) > mtime: + return False + return True + +def import_definitions(): + global item_list + + items_definition_file = srcdir + os.sep + 'statistics_qr_items.def' + item_definition = open(items_definition_file, 'r') + + re_splitter = re.compile('\t+') + l = item_list + lp = None + for line in item_definition.readlines(): + element = re_splitter.split(line.rstrip()) + if element[0] == '': + element.pop(0) + + if element[-1] == '=': + l.append({'name': element[0], 'child': [], 'index': element[1], + 'description': element[2], 'parent': lp}) + lp = l + l = l[-1]['child'] + elif element[-1] == ';': + l = lp + lp = l[-1]['parent'] + else: + l.append({'name': element[0], 'child': None, 'index': element[1], + 'description': element[2], 'parent': lp}) + + item_definition.close() + return os.path.getmtime(items_definition_file) + +def generate_specfile(specfile, def_mtime): + global item_list + + def convert_list(items, prefix = ''): + spec_list = [] + default_map = {} + for item in items: + full_item_name = prefix + item['name'] + if item['child'] is None: + default_map[item['name']] = 0 + spec_list.append({ + 'item_name': item['name'], + 'item_optional': False, + 'item_type': 'integer', + 'item_default': 0, + 'item_title': full_item_name, + 'item_description': item['description'], + }) + else: + child_spec_list, child_default_map = \ + convert_list(item['child'], full_item_name + '.') + spec_list.append({ + 'item_name': item['name'], + 'item_type': 'map', + 'item_optional': False, + 'item_title': full_item_name, + 'item_description': item['description'], + 'item_default': child_default_map, + 'map_item_spec': child_spec_list, + }) + default_map[item['name']] = child_default_map + return spec_list, default_map + + item_spec_list, item_default_map = convert_list(item_list) + + statistics_spec_list = [{ + 'item_name': 'zones', + 'item_type': 'named_set', + 'item_optional': False, + 'item_title': 'Zone statistics', + 'item_description': + 'Zone statistics items. ' + + "Items for all zones are stored in '_SERVER_'.", + 'item_default': { '_SERVER_': item_default_map }, + 'named_set_item_spec': { + 'item_name': 'zone', + 'item_type': 'map', + 'item_optional': False, + 'item_default': {}, + 'map_item_spec': item_spec_list, + }, + }] + + if need_generate(builddir+os.sep+specfile, def_mtime): + stats_pre = open(builddir+os.sep+specfile+pre_suffix, 'r') + stats_pre_json = json.loads(stats_pre.read().replace('@@LOCAL'+'STATEDIR@@', + localstatedir)) + stats_pre.close() + stats_pre_json['module_spec']['statistics'] = statistics_spec_list + statistics_spec_json = json.dumps(stats_pre_json, sort_keys = True, + indent = 2) + stats_spec = open(builddir+os.sep+specfile, 'w') + stats_spec.write(statistics_spec_json) + stats_spec.close() + else: + print('skip generating ' + specfile) + return + +def generate_docfile(docfile, def_mtime): + global item_list + + def convert_list(items, tree, prefix = ''): + for item in items: + full_item_name = prefix + item['name'] + if item['child'] is None: + child_element = ElementTree.SubElement(tree, 'varlistentry') + term = ElementTree.SubElement(child_element, 'term') + term.text = full_item_name + list_item = ElementTree.SubElement(child_element, 'listitem') + sim_para = ElementTree.SubElement(list_item, 'simpara') + sim_para.text = '' + prev = None + for word in item['description'].split(): + if word == xmldocument_command_name: + command = ElementTree.SubElement(sim_para, 'command') + command.text = word + para_tail = command + command.tail = ' ' + prev = command + else: + if prev is None: + sim_para.text += word + ' ' + else: + prev.tail += word + ' ' + else: + convert_list(item['child'], tree, full_item_name + '.') + return + + if need_generate(builddir+os.sep+docfile, def_mtime): + doc_pre = open(srcdir+os.sep+docfile+pre_suffix, 'r') + doc_pre_xml = doc_pre.read().replace('@@LOCALSTATEDIR@@', localstatedir) + doc_pre.close + + variable_tree = ElementTree.Element('variablelist') + convert_list(item_list, variable_tree) + doc = open(builddir+os.sep+docfile, 'w') + doc.write(doc_pre_xml.replace( + '', + ElementTree.tostring(variable_tree))) + doc.close() + else: + print('skip generating ' + docfile) + return + +def generate_cxx(itemsfile, ccfile, utfile, def_mtime): + global item_list + + qr_counter_types = 'enum QRCounterType {\n' + item_names = [] + + def convert_list(items, qr_counter_types, item_names_current, item_names): + for item in items: + if item['child'] is None: + qr_counter_types += ' ' + item['index'] + ', ' +\ + '///< ' + item['description'] + '\n' + item_names_current.append(' { "' + item['name'] + + '", NULL, ' + item['index'] + ' },\n' + ) + 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, + 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 + + qr_counter_types, item_names_current, item_names = \ + convert_list(item_list, qr_counter_types, [], item_names) + item_names.append('const struct CounterTypeTree QRCounterTree[] = {\n') + item_names.extend(item_names_current) + item_names.append(' { NULL, NULL, -1 }\n' + + '};\n') + + qr_counter_types += \ + ' // End of counter types\n' +\ + ' QR_COUNTER_TYPES ///< The number of defined counters\n' +\ + '};\n' + + item_defs = qr_counter_types + item_decls = ''.join(item_names) + + if need_generate(builddir+os.sep+itemsfile, def_mtime): + statistics_items_h_pre = open(srcdir+os.sep+itemsfile+pre_suffix, 'r') + items_pre = statistics_items_h_pre.read() + statistics_items_h_pre.close + + statistics_items_h = open(builddir+os.sep+itemsfile, 'w') + statistics_items_h.write(items_pre.replace( + '// ### STATISTICS ITEMS DECLARATION ###', item_defs)) + statistics_items_h.close() + else: + print('skip generating ' + itemsfile) + + if need_generate(builddir+os.sep+ccfile, def_mtime): + statistics_cc_pre = open(srcdir+os.sep+ccfile+pre_suffix, 'r') + items_pre = statistics_cc_pre.read() + statistics_cc_pre.close + + statistics_cc = open(builddir+os.sep+ccfile, 'w') + statistics_cc.write(items_pre.replace( + '// ### STATISTICS ITEMS DEFINITION ###', item_decls)) + statistics_cc.close() + else: + print('skip generating ' + ccfile) + + if need_generate(builddir+os.sep+utfile, def_mtime): + statistics_ut_cc_pre = open(srcdir+os.sep+utfile+pre_suffix, 'r') + items_pre = statistics_ut_cc_pre.read() + statistics_ut_cc_pre.close + + statistics_ut_cc = open(builddir+os.sep+utfile, 'w') + statistics_ut_cc.write(items_pre.replace( + '// ### STATISTICS ITEMS DEFINITION ###', item_decls)) + statistics_ut_cc.close() + else: + print('skip generating ' + utfile) + + return + +if __name__ == "__main__": + try: + def_mtime = import_definitions() + generate_specfile('auth.spec', def_mtime) + generate_docfile('b10-auth.xml', def_mtime) + generate_cxx('statistics_items.h', + 'statistics.cc', + 'tests'+os.sep+'statistics_unittest.cc', + def_mtime) + except: + sys.stderr.write('Code generation failed due to exception: %s\n' % + sys.exc_info()[1]) + exit(1) diff --git a/src/bin/auth/statistics.cc b/src/bin/auth/statistics.cc.pre similarity index 84% rename from src/bin/auth/statistics.cc rename to src/bin/auth/statistics.cc.pre index 069be746a3..e63f35d6e7 100644 --- a/src/bin/auth/statistics.cc +++ b/src/bin/auth/statistics.cc.pre @@ -42,7 +42,8 @@ using namespace isc::statistics; namespace { void -fillNodes(const Counter& counter, const struct CounterTypeTree type_tree[], +fillNodes(const Counter& counter, + const struct isc::auth::statistics::CounterTypeTree type_tree[], isc::auth::statistics::Counters::ItemTreeType& trees) { using namespace isc::data; @@ -68,6 +69,52 @@ namespace isc { namespace auth { namespace statistics { +// ### STATISTICS ITEMS DEFINITION ### + +const int QROpCodeToQRCounterType[16] = { + QR_OPCODE_QUERY, + QR_OPCODE_IQUERY, + QR_OPCODE_STATUS, + QR_OPCODE_OTHER, + QR_OPCODE_NOTIFY, + QR_OPCODE_UPDATE, + QR_OPCODE_OTHER, + QR_OPCODE_OTHER, + QR_OPCODE_OTHER, + QR_OPCODE_OTHER, + QR_OPCODE_OTHER, + QR_OPCODE_OTHER, + QR_OPCODE_OTHER, + QR_OPCODE_OTHER, + QR_OPCODE_OTHER, + QR_OPCODE_OTHER +}; +const int QRRCodeToQRCounterType[23] = { + QR_RCODE_NOERROR, + QR_RCODE_FORMERR, + QR_RCODE_SERVFAIL, + QR_RCODE_NXDOMAIN, + QR_RCODE_NOTIMP, + QR_RCODE_REFUSED, + QR_RCODE_YXDOMAIN, + QR_RCODE_YXRRSET, + QR_RCODE_NXRRSET, + QR_RCODE_NOTAUTH, + QR_RCODE_NOTZONE, + QR_RCODE_OTHER, + QR_RCODE_OTHER, + QR_RCODE_OTHER, + QR_RCODE_OTHER, + QR_RCODE_OTHER, + QR_RCODE_BADSIGVERS, + QR_RCODE_BADKEY, + QR_RCODE_BADTIME, + QR_RCODE_BADMODE, + QR_RCODE_BADNAME, + QR_RCODE_BADALG, + QR_RCODE_BADTRUNC +}; + Counters::Counters() : // size of server_qr_counter_, zone_qr_counters_: QR_COUNTER_TYPES server_qr_counter_(QR_COUNTER_TYPES), @@ -78,7 +125,7 @@ Counters::~Counters() {} void -Counters::incRequest(const QRAttributes& qrattrs, const Message& response) { +Counters::incRequest(const QRAttributes& qrattrs) { // protocols carrying request if (qrattrs.req_ip_version_ == AF_INET) { server_qr_counter_.inc(QR_REQUEST_IPV4); @@ -118,31 +165,6 @@ Counters::incRequest(const QRAttributes& qrattrs, const Message& response) { server_qr_counter_.inc(QR_REQUEST_DNSSEC_OK); } - // QTYPE - unsigned int qtype_type = QR_QTYPE_OTHER; - const QuestionIterator qiter = response.beginQuestion(); - if (qiter != response.endQuestion()) { - // get the first and only question section - const QuestionPtr qptr = *qiter; - if (qptr != NULL) { - // get the qtype code - const unsigned int qtype = qptr->getType().getCode(); - if (qtype < 258) { - // qtype 0..257 - qtype_type = QRQTypeToQRCounterType[qtype]; - } else if (qtype < 32768) { - // qtype 258..32767 - qtype_type = QR_QTYPE_OTHER; - } else if (qtype < 32770) { - // qtype 32768..32769 - qtype_type = QR_QTYPE_TA + (qtype - 32768); - } else { - // qtype 32770..65535 - qtype_type = QR_QTYPE_OTHER; - } - } - } - server_qr_counter_.inc(qtype_type); // OPCODE server_qr_counter_.inc(QROpCodeToQRCounterType[qrattrs.req_opcode_]); } @@ -218,7 +240,7 @@ Counters::incResponse(const QRAttributes& qrattrs, const Message& response) { void Counters::inc(const QRAttributes& qrattrs, const Message& response) { // increment request counters - incRequest(qrattrs, response); + incRequest(qrattrs); if (qrattrs.answer_sent_) { // increment response counters if answer was sent diff --git a/src/bin/auth/statistics.h b/src/bin/auth/statistics.h index 59fb9327e4..e30d8a97a3 100644 --- a/src/bin/auth/statistics.h +++ b/src/bin/auth/statistics.h @@ -208,8 +208,7 @@ private: isc::statistics::Counter server_qr_counter_; // set of counters for zones isc::statistics::CounterDictionary zone_qr_counters_; - void incRequest(const QRAttributes& qrattrs, - const isc::dns::Message& response); + void incRequest(const QRAttributes& qrattrs); void incResponse(const QRAttributes& qrattrs, const isc::dns::Message& response); public: diff --git a/src/bin/auth/statistics_items.h b/src/bin/auth/statistics_items.h deleted file mode 100644 index eb5d249548..0000000000 --- a/src/bin/auth/statistics_items.h +++ /dev/null @@ -1,609 +0,0 @@ -// Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC") -// -// Permission to use, copy, modify, and/or distribute this software for any -// purpose with or without fee is hereby granted, provided that the above -// copyright notice and this permission notice appear in all copies. -// -// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH -// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, -// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -// PERFORMANCE OF THIS SOFTWARE. - -#ifndef __STATISTICS_ITEMS_H -#define __STATISTICS_ITEMS_H 1 - -/// This file defines a set of statistics items in Auth module for internal -/// use. This file is intended to be included in statistics.cc. - -namespace { - -struct CounterTypeTree { - const char* const name; - const struct CounterTypeTree* const sub_tree; - const int counter_id; -}; - -// enum for query/response counters -enum QRCounterType { - // Request Attributes - QR_REQUEST_IPV4, ///< Number of IPv4 requests received - QR_REQUEST_IPV6, ///< Number of IPv6 requests received - QR_REQUEST_EDNS0, ///< Number of requests with EDNS(0) received - QR_REQUEST_BADEDNSVER, ///< Number of requests with unsupported EDNS version received - QR_REQUEST_TSIG, ///< Number of requests with TSIG received - QR_REQUEST_SIG0, ///< Number of requests with SIG(0) received; not implemented in BIND 10 - QR_REQUEST_BADSIG, ///< Number of requests with invalid TSIG or SIG(0) signature received - QR_REQUEST_UDP, ///< Number of UDP requests received - QR_REQUEST_TCP, ///< Number of TCP requests received - QR_REQUEST_DNSSEC_OK, ///< Number of requests with DO bit - // Request Opcodes - QR_OPCODE_QUERY, ///< Number of Opcode=QUERY requests received - QR_OPCODE_IQUERY, ///< Number of Opcode=IQUERY requests received - QR_OPCODE_STATUS, ///< Number of Opcode=STATUS requests received - QR_OPCODE_NOTIFY, ///< Number of Opcode=NOTIFY requests received - QR_OPCODE_UPDATE, ///< Number of Opcode=UPDATE requests received - QR_OPCODE_OTHER, ///< Number of requests in other OpCode received - // Query Types - QR_QTYPE_A, ///< Number of QTYPE = A queries received - QR_QTYPE_NS, ///< Number of QTYPE = NS queries received - QR_QTYPE_MD, ///< Number of QTYPE = MD queries received - QR_QTYPE_MF, ///< Number of QTYPE = MF queries received - QR_QTYPE_CNAME, ///< Number of QTYPE = CNAME queries received - QR_QTYPE_SOA, ///< Number of QTYPE = SOA queries received - QR_QTYPE_MB, ///< Number of QTYPE = MB queries received - QR_QTYPE_MG, ///< Number of QTYPE = MG queries received - QR_QTYPE_MR, ///< Number of QTYPE = MR queries received - QR_QTYPE_NULL, ///< Number of QTYPE = NULL queries received - QR_QTYPE_WKS, ///< Number of QTYPE = WKS queries received - QR_QTYPE_PTR, ///< Number of QTYPE = PTR queries received - QR_QTYPE_HINFO, ///< Number of QTYPE = HINFO queries received - QR_QTYPE_MINFO, ///< Number of QTYPE = MINFO queries received - QR_QTYPE_MX, ///< Number of QTYPE = MX queries received - QR_QTYPE_TXT, ///< Number of QTYPE = TXT queries received - QR_QTYPE_RP, ///< Number of QTYPE = RP queries received - QR_QTYPE_AFSDB, ///< Number of QTYPE = AFSDB queries received - QR_QTYPE_X25, ///< Number of QTYPE = X25 queries received - QR_QTYPE_ISDN, ///< Number of QTYPE = ISDN queries received - QR_QTYPE_RT, ///< Number of QTYPE = RT queries received - QR_QTYPE_NSAP, ///< Number of QTYPE = NSAP queries received - QR_QTYPE_NSAP_PTR, ///< Number of QTYPE = NSAP-PTR queries received - QR_QTYPE_SIG, ///< Number of QTYPE = SIG queries received - QR_QTYPE_KEY, ///< Number of QTYPE = KEY queries received - QR_QTYPE_PX, ///< Number of QTYPE = PX queries received - QR_QTYPE_GPOS, ///< Number of QTYPE = GPOS queries received - QR_QTYPE_AAAA, ///< Number of QTYPE = AAAA queries received - QR_QTYPE_LOC, ///< Number of QTYPE = LOC queries received - QR_QTYPE_NXT, ///< Number of QTYPE = NXT queries received - QR_QTYPE_EID, ///< Number of QTYPE = EID queries received - QR_QTYPE_NIMLOC, ///< Number of QTYPE = NIMLOC queries received - QR_QTYPE_SRV, ///< Number of QTYPE = SRV queries received - QR_QTYPE_ATMA, ///< Number of QTYPE = ATMA queries received - QR_QTYPE_NAPTR, ///< Number of QTYPE = NAPTR queries received - QR_QTYPE_KX, ///< Number of QTYPE = KX queries received - QR_QTYPE_CERT, ///< Number of QTYPE = CERT queries received - QR_QTYPE_A6, ///< Number of QTYPE = A6 queries received - QR_QTYPE_DNAME, ///< Number of QTYPE = DNAME queries received - QR_QTYPE_SINK, ///< Number of QTYPE = SINK queries received - QR_QTYPE_OPT, ///< Number of QTYPE = OPT queries received - QR_QTYPE_APL, ///< Number of QTYPE = APL queries received - QR_QTYPE_DS, ///< Number of QTYPE = DS queries received - QR_QTYPE_SSHFP, ///< Number of QTYPE = SSHFP queries received - QR_QTYPE_IPSECKEY, ///< Number of QTYPE = IPSECKEY queries received - QR_QTYPE_RRSIG, ///< Number of QTYPE = RRSIG queries received - QR_QTYPE_NSEC, ///< Number of QTYPE = NSEC queries received - QR_QTYPE_DNSKEY, ///< Number of QTYPE = DNSKEY queries received - QR_QTYPE_DHCID, ///< Number of QTYPE = DHCID queries received - QR_QTYPE_NSEC3, ///< Number of QTYPE = NSEC3 queries received - QR_QTYPE_NSEC3PARAM, ///< Number of QTYPE = NSEC3PARAM queries received - QR_QTYPE_HIP, ///< Number of QTYPE = HIP queries received - QR_QTYPE_NINFO, ///< Number of QTYPE = NINFO queries received - QR_QTYPE_RKEY, ///< Number of QTYPE = RKEY queries received - QR_QTYPE_TALINK, ///< Number of QTYPE = TALINK queries received - QR_QTYPE_SPF, ///< Number of QTYPE = SPF queries received - QR_QTYPE_UINFO, ///< Number of QTYPE = UINFO queries received - QR_QTYPE_UID, ///< Number of QTYPE = UID queries received - QR_QTYPE_GID, ///< Number of QTYPE = GID queries received - QR_QTYPE_UNSPEC, ///< Number of QTYPE = UNSPEC queries received - QR_QTYPE_TKEY, ///< Number of QTYPE = TKEY queries received - QR_QTYPE_TSIG, ///< Number of QTYPE = TSIG queries received - QR_QTYPE_IXFR, ///< Number of QTYPE = IXFR queries received - QR_QTYPE_AXFR, ///< Number of QTYPE = AXFR queries received - QR_QTYPE_MAILB, ///< Number of QTYPE = MAILB queries received - QR_QTYPE_MAILA, ///< Number of QTYPE = MAILA queries received - QR_QTYPE_URI, ///< Number of QTYPE = URI queries received - QR_QTYPE_CAA, ///< Number of QTYPE = CAA queries received - QR_QTYPE_TA, ///< Number of QTYPE = TA queries received - QR_QTYPE_DLV, ///< Number of QTYPE = DLV queries received - QR_QTYPE_OTHER, ///< Number of queries in other QTYPE received - // Respose Attributes - QR_RESPONSE, ///< Number of responses sent - QR_RESPONSE_TRUNCATED, ///< Number of truncated responses sent - QR_RESPONSE_EDNS0, ///< Number of responses with EDNS0; not implemented in BIND 10 - QR_RESPONSE_TSIG, ///< Number of responses with TSIG - QR_RESPONSE_SIG0, ///< Number of responses with SIG(0); not implemented in BIND 10 - QR_QRYSUCCESS, ///< Number of queries resulted in rcode = NOERROR and answer RR >= 1 - QR_QRYAUTHANS, ///< Number of queries resulted in authoritative answer - QR_QRYNOAUTHANS, ///< Number of queries resulted in non-authoritative answer - QR_QRYREFERRAL, ///< Number of queries resulted in referral answer - QR_QRYNXRRSET, ///< Number of queries resulted in NOERROR but answer RR == 0 - QR_QRYREJECT, ///< Number of queries rejected - // Response Rcodes - QR_RCODE_NOERROR, ///< Number of queries resulted in RCODE = 0 (NoError) - QR_RCODE_FORMERR, ///< Number of queries resulted in RCODE = 1 (FormErr) - QR_RCODE_SERVFAIL, ///< Number of queries resulted in RCODE = 2 (ServFail) - QR_RCODE_NXDOMAIN, ///< Number of queries resulted in RCODE = 3 (NXDomain) - QR_RCODE_NOTIMP, ///< Number of queries resulted in RCODE = 4 (NotImp) - QR_RCODE_REFUSED, ///< Number of queries resulted in RCODE = 5 (Refused) - QR_RCODE_YXDOMAIN, ///< Number of queries resulted in RCODE = 6 (YXDomain) - QR_RCODE_YXRRSET, ///< Number of queries resulted in RCODE = 7 (YXRRSet) - QR_RCODE_NXRRSET, ///< Number of queries resulted in RCODE = 8 (NXRRSet) - QR_RCODE_NOTAUTH, ///< Number of queries resulted in RCODE = 9 (NotAuth) - QR_RCODE_NOTZONE, ///< Number of queries resulted in RCODE = 10 (NotZone) - QR_RCODE_BADSIGVERS, ///< Number of queries resulted in RCODE = 16 (BADVERS, BADSIG) - QR_RCODE_BADKEY, ///< Number of queries resulted in RCODE = 17 (BADKEY) - QR_RCODE_BADTIME, ///< Number of queries resulted in RCODE = 18 (BADTIME) - QR_RCODE_BADMODE, ///< Number of queries resulted in RCODE = 19 (BADMODE) - QR_RCODE_BADNAME, ///< Number of queries resulted in RCODE = 20 (BADNAME) - QR_RCODE_BADALG, ///< Number of queries resulted in RCODE = 21 (BADALG) - QR_RCODE_BADTRUNC, ///< Number of queries resulted in RCODE = 22 (BADTRUNC) - QR_RCODE_OTHER, ///< Number of queries resulted in other RCODEs - // End of counter types - QR_COUNTER_TYPES ///< The number of defined counters -}; - -// item names for query/response counters -const struct CounterTypeTree QRCounterRequest[] = { - { "v4", NULL, QR_REQUEST_IPV4 }, - { "v6", NULL, QR_REQUEST_IPV6 }, - { "edns0", NULL, QR_REQUEST_EDNS0 }, - { "badednsver", NULL, QR_REQUEST_BADEDNSVER }, - { "tsig", NULL, QR_REQUEST_TSIG }, - { "sig0", NULL, QR_REQUEST_SIG0 }, - { "badsig", NULL, QR_REQUEST_BADSIG }, - { "udp", NULL, QR_REQUEST_UDP }, - { "tcp", NULL, QR_REQUEST_TCP }, - { "dnssec_ok", NULL, QR_REQUEST_DNSSEC_OK }, - { NULL, NULL, -1 } -}; -const struct CounterTypeTree QRCounterOpcode[] = { - { "query", NULL, QR_OPCODE_QUERY }, - { "iquery", NULL, QR_OPCODE_IQUERY }, - { "status", NULL, QR_OPCODE_STATUS }, - { "notify", NULL, QR_OPCODE_NOTIFY }, - { "update", NULL, QR_OPCODE_UPDATE }, - { "other", NULL, QR_OPCODE_OTHER }, - { NULL, NULL, -1 } -}; -const struct CounterTypeTree QRCounterQtype[] = { - { "a", NULL, QR_QTYPE_A, }, - { "ns", NULL, QR_QTYPE_NS }, - { "md", NULL, QR_QTYPE_MD }, - { "mf", NULL, QR_QTYPE_MF }, - { "cname", NULL, QR_QTYPE_CNAME }, - { "soa", NULL, QR_QTYPE_SOA }, - { "mb", NULL, QR_QTYPE_MB }, - { "mg", NULL, QR_QTYPE_MG }, - { "mr", NULL, QR_QTYPE_MR }, - { "null", NULL, QR_QTYPE_NULL }, - { "wks", NULL, QR_QTYPE_WKS }, - { "ptr", NULL, QR_QTYPE_PTR }, - { "hinfo", NULL, QR_QTYPE_HINFO }, - { "minfo", NULL, QR_QTYPE_MINFO }, - { "mx", NULL, QR_QTYPE_MX }, - { "txt", NULL, QR_QTYPE_TXT }, - { "rp", NULL, QR_QTYPE_RP }, - { "afsdb", NULL, QR_QTYPE_AFSDB }, - { "x25", NULL, QR_QTYPE_X25 }, - { "isdn", NULL, QR_QTYPE_ISDN }, - { "rt", NULL, QR_QTYPE_RT }, - { "nsap", NULL, QR_QTYPE_NSAP }, - { "nsap-ptr", NULL, QR_QTYPE_NSAP_PTR }, - { "sig", NULL, QR_QTYPE_SIG }, - { "key", NULL, QR_QTYPE_KEY }, - { "px", NULL, QR_QTYPE_PX }, - { "gpos", NULL, QR_QTYPE_GPOS }, - { "aaaa", NULL, QR_QTYPE_AAAA }, - { "loc", NULL, QR_QTYPE_LOC }, - { "nxt", NULL, QR_QTYPE_NXT }, - { "eid", NULL, QR_QTYPE_EID }, - { "nimloc", NULL, QR_QTYPE_NIMLOC }, - { "srv", NULL, QR_QTYPE_SRV }, - { "atma", NULL, QR_QTYPE_ATMA }, - { "naptr", NULL, QR_QTYPE_NAPTR }, - { "kx", NULL, QR_QTYPE_KX }, - { "cert", NULL, QR_QTYPE_CERT }, - { "a6", NULL, QR_QTYPE_A6 }, - { "dname", NULL, QR_QTYPE_DNAME }, - { "sink", NULL, QR_QTYPE_SINK }, - { "opt", NULL, QR_QTYPE_OPT }, - { "apl", NULL, QR_QTYPE_APL }, - { "ds", NULL, QR_QTYPE_DS }, - { "sshfp", NULL, QR_QTYPE_SSHFP }, - { "ipseckey", NULL, QR_QTYPE_IPSECKEY }, - { "rrsig", NULL, QR_QTYPE_RRSIG }, - { "nsec", NULL, QR_QTYPE_NSEC }, - { "dnskey", NULL, QR_QTYPE_DNSKEY }, - { "dhcid", NULL, QR_QTYPE_DHCID }, - { "nsec3", NULL, QR_QTYPE_NSEC3 }, - { "nsec3param", NULL, QR_QTYPE_NSEC3PARAM }, - { "hip", NULL, QR_QTYPE_HIP }, - { "ninfo", NULL, QR_QTYPE_NINFO }, - { "rkey", NULL, QR_QTYPE_RKEY }, - { "talink", NULL, QR_QTYPE_TALINK }, - { "spf", NULL, QR_QTYPE_SPF }, - { "uinfo", NULL, QR_QTYPE_UINFO }, - { "uid", NULL, QR_QTYPE_UID }, - { "gid", NULL, QR_QTYPE_GID }, - { "unspec", NULL, QR_QTYPE_UNSPEC }, - { "tkey", NULL, QR_QTYPE_TKEY }, - { "tsig", NULL, QR_QTYPE_TSIG }, - { "ixfr", NULL, QR_QTYPE_IXFR }, - { "axfr", NULL, QR_QTYPE_AXFR }, - { "mailb", NULL, QR_QTYPE_MAILB }, - { "maila", NULL, QR_QTYPE_MAILA }, - { "uri", NULL, QR_QTYPE_URI }, - { "caa", NULL, QR_QTYPE_CAA }, - { "ta", NULL, QR_QTYPE_TA }, - { "dlv", NULL, QR_QTYPE_DLV }, - { "other", NULL, QR_QTYPE_OTHER }, - { NULL, NULL, -1 } -}; -const struct CounterTypeTree QRCounterResponse[] = { - { "truncated", NULL, QR_RESPONSE_TRUNCATED }, - { "edns0", NULL, QR_RESPONSE_EDNS0 }, - { "tsig", NULL, QR_RESPONSE_TSIG }, - { "sig0", NULL, QR_RESPONSE_SIG0 }, - { NULL, NULL, -1 } -}; -const struct CounterTypeTree QRCounterRcode[] = { - { "noerror", NULL, QR_RCODE_NOERROR }, - { "formerr", NULL, QR_RCODE_FORMERR }, - { "servfail", NULL, QR_RCODE_SERVFAIL }, - { "nxdomain", NULL, QR_RCODE_NXDOMAIN }, - { "notimp", NULL, QR_RCODE_NOTIMP }, - { "refused", NULL, QR_RCODE_REFUSED }, - { "yxdomain", NULL, QR_RCODE_YXDOMAIN }, - { "yxrrset", NULL, QR_RCODE_YXRRSET }, - { "nxrrset", NULL, QR_RCODE_NXRRSET }, - { "notauth", NULL, QR_RCODE_NOTAUTH }, - { "notzone", NULL, QR_RCODE_NOTZONE }, - { "badsigvers", NULL, QR_RCODE_BADSIGVERS }, - { "badkey", NULL, QR_RCODE_BADKEY }, - { "badtime", NULL, QR_RCODE_BADTIME }, - { "badmode", NULL, QR_RCODE_BADMODE }, - { "badname", NULL, QR_RCODE_BADNAME }, - { "badalg", NULL, QR_RCODE_BADALG }, - { "badtrunc", NULL, QR_RCODE_BADTRUNC }, - { "other", NULL, QR_RCODE_OTHER }, - { NULL, NULL, -1 } -}; -const struct CounterTypeTree QRCounterTree[] = { - { "request", QRCounterRequest, -1 }, - { "opcode", QRCounterOpcode, -1 }, - { "qtype", QRCounterQtype, -1 }, - { "responses", NULL, QR_RESPONSE }, - { "response", QRCounterResponse, -1 }, - { "qrysuccess", NULL, QR_QRYSUCCESS }, - { "qryauthans", NULL, QR_QRYAUTHANS }, - { "qrynoauthans", NULL, QR_QRYNOAUTHANS }, - { "qryreferral", NULL, QR_QRYREFERRAL }, - { "qrynxrrset", NULL, QR_QRYNXRRSET }, - { "authqryrej", NULL, QR_QRYREJECT }, - { "rcode", QRCounterRcode, -1 }, - { NULL, NULL, -1 } -}; - -const int QROpCodeToQRCounterType[16] = { - QR_OPCODE_QUERY, - QR_OPCODE_IQUERY, - QR_OPCODE_STATUS, - QR_OPCODE_OTHER, - QR_OPCODE_NOTIFY, - QR_OPCODE_UPDATE, - QR_OPCODE_OTHER, - QR_OPCODE_OTHER, - QR_OPCODE_OTHER, - QR_OPCODE_OTHER, - QR_OPCODE_OTHER, - QR_OPCODE_OTHER, - QR_OPCODE_OTHER, - QR_OPCODE_OTHER, - QR_OPCODE_OTHER, - QR_OPCODE_OTHER -}; -const int QRQTypeToQRCounterType[258] = { - QR_QTYPE_OTHER, - QR_QTYPE_A, - QR_QTYPE_NS, - QR_QTYPE_MD, - QR_QTYPE_MF, - QR_QTYPE_CNAME, - QR_QTYPE_SOA, - QR_QTYPE_MB, - QR_QTYPE_MG, - QR_QTYPE_MR, - QR_QTYPE_NULL, - QR_QTYPE_WKS, - QR_QTYPE_PTR, - QR_QTYPE_HINFO, - QR_QTYPE_MINFO, - QR_QTYPE_MX, - QR_QTYPE_TXT, - QR_QTYPE_RP, - QR_QTYPE_AFSDB, - QR_QTYPE_X25, - QR_QTYPE_ISDN, - QR_QTYPE_RT, - QR_QTYPE_NSAP, - QR_QTYPE_NSAP_PTR, - QR_QTYPE_SIG, - QR_QTYPE_KEY, - QR_QTYPE_PX, - QR_QTYPE_GPOS, - QR_QTYPE_AAAA, - QR_QTYPE_LOC, - QR_QTYPE_NXT, - QR_QTYPE_EID, - QR_QTYPE_NIMLOC, - QR_QTYPE_SRV, - QR_QTYPE_ATMA, - QR_QTYPE_NAPTR, - QR_QTYPE_KX, - QR_QTYPE_CERT, - QR_QTYPE_A6, - QR_QTYPE_DNAME, - QR_QTYPE_SINK, - QR_QTYPE_OPT, - QR_QTYPE_APL, - QR_QTYPE_DS, - QR_QTYPE_SSHFP, - QR_QTYPE_IPSECKEY, - QR_QTYPE_RRSIG, - QR_QTYPE_NSEC, - QR_QTYPE_DNSKEY, - QR_QTYPE_DHCID, - QR_QTYPE_NSEC3, - QR_QTYPE_NSEC3PARAM, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_HIP, - QR_QTYPE_NINFO, - QR_QTYPE_RKEY, - QR_QTYPE_TALINK, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_SPF, - QR_QTYPE_UINFO, - QR_QTYPE_UID, - QR_QTYPE_GID, - QR_QTYPE_UNSPEC, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_OTHER, - QR_QTYPE_TKEY, - QR_QTYPE_TSIG, - QR_QTYPE_IXFR, - QR_QTYPE_AXFR, - QR_QTYPE_MAILB, - QR_QTYPE_MAILA, - QR_QTYPE_OTHER, - QR_QTYPE_URI, - QR_QTYPE_CAA -}; -const int QRRCodeToQRCounterType[23] = { - QR_RCODE_NOERROR, - QR_RCODE_FORMERR, - QR_RCODE_SERVFAIL, - QR_RCODE_NXDOMAIN, - QR_RCODE_NOTIMP, - QR_RCODE_REFUSED, - QR_RCODE_YXDOMAIN, - QR_RCODE_YXRRSET, - QR_RCODE_NXRRSET, - QR_RCODE_NOTAUTH, - QR_RCODE_NOTZONE, - QR_RCODE_OTHER, - QR_RCODE_OTHER, - QR_RCODE_OTHER, - QR_RCODE_OTHER, - QR_RCODE_OTHER, - QR_RCODE_BADSIGVERS, - QR_RCODE_BADKEY, - QR_RCODE_BADTIME, - QR_RCODE_BADMODE, - QR_RCODE_BADNAME, - QR_RCODE_BADALG, - QR_RCODE_BADTRUNC -}; - -} // anonymous namespace - -#endif // __STATISTICS_ITEMS_H - -// Local Variables: -// mode: c++ -// End: diff --git a/src/bin/auth/statistics_items.h.pre b/src/bin/auth/statistics_items.h.pre new file mode 100644 index 0000000000..0ef98e6111 --- /dev/null +++ b/src/bin/auth/statistics_items.h.pre @@ -0,0 +1,44 @@ +// Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC") +// +// Permission to use, copy, modify, and/or distribute this software for any +// purpose with or without fee is hereby granted, provided that the above +// copyright notice and this permission notice appear in all copies. +// +// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH +// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, +// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +// PERFORMANCE OF THIS SOFTWARE. + +#ifndef __STATISTICS_ITEMS_H +#define __STATISTICS_ITEMS_H 1 + +/// This file defines a set of statistics items in Auth module for internal +/// use. This file is intended to be included in statistics.cc. + +namespace isc { +namespace auth { +namespace statistics { + +struct CounterTypeTree { + const char* const name; + const struct CounterTypeTree* const sub_tree; + const int counter_id; +}; + +// ### STATISTICS ITEMS DECLARATION ### + +extern const int QROpCodeToQRCounterType[]; +extern const int QRRCodeToQRCounterType[]; + +} // namespace statistics +} // namespace auth +} // namespace isc + +#endif // __STATISTICS_ITEMS_H + +// Local Variables: +// mode: c++ +// End: diff --git a/src/bin/auth/statistics_qr_items.def b/src/bin/auth/statistics_qr_items.def new file mode 100644 index 0000000000..3a9b22732f --- /dev/null +++ b/src/bin/auth/statistics_qr_items.def @@ -0,0 +1,54 @@ +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 EDNS(0) received by the b10-auth server. + badednsver QR_REQUEST_BADEDNSVER Number of requests with unsupported EDNS version received by the b10-auth server. + tsig QR_REQUEST_TSIG Number of requests with TSIG received by the b10-auth server. + sig0 QR_REQUEST_SIG0 Number of requests with SIG(0) received by the b10-auth server; currently not implemented in BIND 10. + badsig QR_REQUEST_BADSIG Number of requests with invalid TSIG or SIG(0) signature received by the b10-auth server. + udp QR_REQUEST_UDP Number of UDP requests received by the b10-auth server. + tcp QR_REQUEST_TCP Number of UDP requests received by the b10-auth server. + dnssec_ok QR_REQUEST_DNSSEC_OK Number of requests with DO bit received by the b10-auth server. + ; +opcode QRCounterOpcode Opcode statistics = + query QR_OPCODE_QUERY Number of Opcode=QUERY requests received by the b10-auth server. + iquery QR_OPCODE_IQUERY Number of Opcode=IQUERY requests received by the b10-auth server. + status QR_OPCODE_STATUS Number of Opcode=STATUS requests received by the b10-auth server. + notify QR_OPCODE_NOTIFY Number of Opcode=NOTIFY requests received by the b10-auth server. + update QR_OPCODE_UPDATE Number of Opcode=UPDATE requests received by the b10-auth server. + other QR_OPCODE_OTHER Number of requests in other OpCode received by the b10-auth server. + ; +responses QR_RESPONSE Number of responses sent by the b10-auth server. +response QRCounterResponse Response statistics = + truncated QR_RESPONSE_TRUNCATED Number of truncated responses sent by the b10-auth server. + edns0 QR_RESPONSE_EDNS0 Number of responses with EDNS0 sent by the b10-auth server. + tsig QR_RESPONSE_TSIG Number of responses with TSIG sent by the b10-auth server. + sig0 QR_RESPONSE_SIG0 Number of responses with SIG(0) sent by the b10-auth server; currently not implemented in BIND 10. + ; +qrysuccess QR_QRYSUCCESS Number of queries received by the b10-auth server resulted in rcode = NOERROR and the number of answer RR >= 1. +qryauthans QR_QRYAUTHANS Number of queries received by the b10-auth server resulted in authoritative answer. +qrynoauthans QR_QRYNOAUTHANS Number of queries received by the b10-auth server resulted in non-authoritative answer. +qryreferral QR_QRYREFERRAL Number of queries received by the b10-auth server resulted in referral answer. +qrynxrrset QR_QRYNXRRSET Number of queries received by the b10-auth server resulted in NOERROR but the number of answer RR == 0. +authqryrej QR_QRYREJECT Number of authoritative queries rejected by the b10-auth server. +rcode QRCounterRcode Rcode statistics = + noerror QR_RCODE_NOERROR Number of queries received by the b10-auth server resulted in RCODE = 0 (NoError). + formerr QR_RCODE_FORMERR Number of queries received by the b10-auth server resulted in RCODE = 1 (FormErr). + servfail QR_RCODE_SERVFAIL Number of queries received by the b10-auth server resulted in RCODE = 2 (ServFail). + nxdomain QR_RCODE_NXDOMAIN Number of queries received by the b10-auth server resulted in RCODE = 3 (NXDomain). + notimp QR_RCODE_NOTIMP Number of queries received by the b10-auth server resulted in RCODE = 4 (NotImp). + refused QR_RCODE_REFUSED Number of queries received by the b10-auth server resulted in RCODE = 5 (Refused). + yxdomain QR_RCODE_YXDOMAIN Number of queries received by the b10-auth server resulted in RCODE = 6 (YXDomain). + yxrrset QR_RCODE_YXRRSET Number of queries received by the b10-auth server resulted in RCODE = 7 (YXRRSet). + nxrrset QR_RCODE_NXRRSET Number of queries received by the b10-auth server resulted in RCODE = 8 (NXRRSet). + notauth QR_RCODE_NOTAUTH Number of queries received by the b10-auth server resulted in RCODE = 9 (NotAuth). + notzone QR_RCODE_NOTZONE Number of queries received by the b10-auth server resulted in RCODE = 10 (NotZone). + badsigvers QR_RCODE_BADSIGVERS Number of queries received by the b10-auth server resulted in RCODE = 16 (BADVERS, BADSIG). + badkey QR_RCODE_BADKEY Number of queries received by the b10-auth server resulted in RCODE = 17 (BADKEY). + badtime QR_RCODE_BADTIME Number of queries received by the b10-auth server resulted in RCODE = 18 (BADTIME). + badmode QR_RCODE_BADMODE Number of queries received by the b10-auth server resulted in RCODE = 19 (BADMODE). + badname QR_RCODE_BADNAME Number of queries received by the b10-auth server resulted in RCODE = 20 (BADNAME). + badalg QR_RCODE_BADALG Number of queries received by the b10-auth server resulted in RCODE = 21 (BADALG). + badtrunc QR_RCODE_BADTRUNC Number of queries received by the b10-auth server resulted in RCODE = 22 (BADTRUNC). + other QR_RCODE_OTHER Number of queries received by the b10-auth server resulted in other RCODEs. + ; diff --git a/src/bin/auth/tests/Makefile.am b/src/bin/auth/tests/Makefile.am index 482a4f7469..9401f1de5d 100644 --- a/src/bin/auth/tests/Makefile.am +++ b/src/bin/auth/tests/Makefile.am @@ -33,6 +33,9 @@ TESTS_ENVIRONMENT = \ TESTS = if HAVE_GTEST +# auto-generated by statistics_items.py +BUILT_SOURCES = statistics_unittest.cc + run_unittests_SOURCES = $(top_srcdir)/src/lib/dns/tests/unittest_util.h run_unittests_SOURCES += $(top_srcdir)/src/lib/dns/tests/unittest_util.cc run_unittests_SOURCES += ../auth_srv.h ../auth_srv.cc @@ -49,11 +52,11 @@ run_unittests_SOURCES += config_syntax_unittest.cc run_unittests_SOURCES += command_unittest.cc run_unittests_SOURCES += common_unittest.cc run_unittests_SOURCES += query_unittest.cc -run_unittests_SOURCES += statistics_unittest.cc run_unittests_SOURCES += datasrc_configurator_unittest.cc run_unittests_SOURCES += run_unittests.cc nodist_run_unittests_SOURCES = ../auth_messages.h ../auth_messages.cc +nodist_run_unittests_SOURCES += statistics_unittest.cc run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES) run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS) diff --git a/src/bin/auth/tests/auth_srv_unittest.cc b/src/bin/auth/tests/auth_srv_unittest.cc index 98e17430ce..4ea4c8b5a0 100644 --- a/src/bin/auth/tests/auth_srv_unittest.cc +++ b/src/bin/auth/tests/auth_srv_unittest.cc @@ -1078,7 +1078,7 @@ TEST_F(AuthSrvTest, queryCounterUDPNormal) { server.processMessage(*io_message, *parse_message, *response_obuffer, &dnsserv); // After processing the UDP query, these counters should be incremented: - // request.tcp, opcode.query, qtype.ns, rcode.refused, response + // request.tcp, opcode.query, rcode.refused, response // and these counters should not be incremented: // request.tcp ConstElementPtr stats_after = server.getStatistics()-> @@ -1106,7 +1106,7 @@ 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 + // request.tcp, opcode.query, rcode.refused, response // and these counters should not be incremented: // request.udp ConstElementPtr stats_after = server.getStatistics()-> @@ -1135,7 +1135,7 @@ 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 + // request.tcp, opcode.query // and these counters should not be incremented: // request.udp, response ConstElementPtr stats_after = server.getStatistics()-> @@ -1163,7 +1163,7 @@ 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 + // request.tcp, opcode.query // and these counters should not be incremented: // request.udp, response ConstElementPtr stats_after = server.getStatistics()-> @@ -1178,7 +1178,8 @@ TEST_F(AuthSrvTest, queryCounterOpcodes) { for (int i = 0; i < 16; ++i) { std::string item_name; int expected; - if (QROpCodeToQRCounterType[i] == QR_OPCODE_OTHER) { + if (isc::auth::statistics::QROpCodeToQRCounterType[i] == + isc::auth::statistics::QR_OPCODE_OTHER) { item_name = "OTHER"; other_expected += i + 1; expected = other_expected; diff --git a/src/bin/auth/tests/statistics_unittest.cc b/src/bin/auth/tests/statistics_unittest.cc.pre similarity index 97% rename from src/bin/auth/tests/statistics_unittest.cc rename to src/bin/auth/tests/statistics_unittest.cc.pre index ab84307d02..76bc703f30 100644 --- a/src/bin/auth/tests/statistics_unittest.cc +++ b/src/bin/auth/tests/statistics_unittest.cc.pre @@ -41,11 +41,12 @@ using namespace std; using namespace isc::cc; using namespace isc::dns; using namespace isc::data; -using isc::auth::statistics::Counters; -using isc::auth::statistics::QRAttributes; +using namespace isc::auth::statistics; namespace { +// ### STATISTICS ITEMS DEFINITION ### + class CountersTest : public ::testing::Test { protected: CountersTest() : counters() {} @@ -122,7 +123,6 @@ TEST_F(CountersTest, incrementNormalQuery) { expect_nonzero.clear(); expect_nonzero.insert("opcode.query"); - expect_nonzero.insert("qtype.aaaa"); expect_nonzero.insert("request.v6"); expect_nonzero.insert("request.udp"); expect_nonzero.insert("request.edns0"); diff --git a/src/lib/dns/gen-rdatacode.py.in b/src/lib/dns/gen-rdatacode.py.in index f3cd5df81a..2717bfe03d 100755 --- a/src/lib/dns/gen-rdatacode.py.in +++ b/src/lib/dns/gen-rdatacode.py.in @@ -34,6 +34,10 @@ class_definitions = '' classdir_mtime = 0 rdatadef_mtime = 0 rdatahdr_mtime = 0 +localstatedir='@@LOCALSTATEDIR@@' +localstatedir2='@localstatedir@' +builddir='@@BUILDDIR@@' +builddir2='@builddir@' heading_txt = '''/////////////// /////////////// /////////////// THIS FILE IS AUTOMATICALLY GENERATED BY gen-rdatacode.py.