void dns_rdatasetstats_decrement(dns_stats_t *stats, dns_rdatastatstype_t rrsettype) { REQUIRE(DNS_STATS_VALID(stats) && stats->type == dns_statstype_rdataset); update_rdatasetstats(stats, rrsettype, ISC_FALSE); }
/*% * Dump methods */ void dns_generalstats_dump(dns_stats_t *stats, dns_generalstats_dumper_t dump_fn, void *arg, unsigned int options) { REQUIRE(DNS_STATS_VALID(stats) && stats->type == dns_statstype_general); isc_stats_dump(stats->counters, (isc_stats_dumper_t)dump_fn, arg, options); }
void dns_opcodestats_dump (dns_stats_t * stats, dns_opcodestats_dumper_t dump_fn, void *arg0, unsigned int options) { opcodedumparg_t arg; REQUIRE (DNS_STATS_VALID (stats) && stats->type == dns_statstype_opcode); arg.fn = dump_fn; arg.arg = arg0; isc_stats_dump (stats->counters, opcode_dumpcb, &arg, options); }
void dns_stats_attach (dns_stats_t * stats, dns_stats_t ** statsp) { REQUIRE (DNS_STATS_VALID (stats)); REQUIRE (statsp != NULL && *statsp == NULL); LOCK (&stats->lock); stats->references++; UNLOCK (&stats->lock); *statsp = stats; }
void dns_rdatatypestats_increment (dns_stats_t * stats, dns_rdatatype_t type) { int counter; REQUIRE (DNS_STATS_VALID (stats) && stats->type == dns_statstype_rdtype); if (type == dns_rdatatype_dlv) counter = rdtypecounter_dlv; else if (type > dns_rdatatype_any) counter = rdtypecounter_others; else counter = (int) type; isc_stats_increment (stats->counters, (isc_statscounter_t) counter); }
void dns_stats_detach(dns_stats_t **statsp) { dns_stats_t *stats; REQUIRE(statsp != NULL && DNS_STATS_VALID(*statsp)); stats = *statsp; *statsp = NULL; LOCK(&stats->lock); stats->references--; UNLOCK(&stats->lock); if (stats->references == 0) { isc_stats_detach(&stats->counters); DESTROYLOCK(&stats->lock); isc_mem_putanddetach(&stats->mctx, stats, sizeof(*stats)); } }
void dns_opcodestats_increment (dns_stats_t * stats, dns_opcode_t code) { REQUIRE (DNS_STATS_VALID (stats) && stats->type == dns_statstype_opcode); isc_stats_increment (stats->counters, (isc_statscounter_t) code); }
/*% * Increment/Decrement methods */ void dns_generalstats_increment (dns_stats_t * stats, isc_statscounter_t counter) { REQUIRE (DNS_STATS_VALID (stats) && stats->type == dns_statstype_general); isc_stats_increment (stats->counters, counter); }