/* * Helper functions */ static void set_typestats(dns_stats_t *stats, dns_rdatatype_t type, isc_boolean_t stale) { dns_rdatastatstype_t which; unsigned int attributes; attributes = 0; if (stale) attributes |= DNS_RDATASTATSTYPE_ATTR_STALE; which = DNS_RDATASTATSTYPE_VALUE(type, attributes); dns_rdatasetstats_increment(stats, which); attributes = DNS_RDATASTATSTYPE_ATTR_NXRRSET; if (stale) attributes |= DNS_RDATASTATSTYPE_ATTR_STALE; which = DNS_RDATASTATSTYPE_VALUE(type, attributes); dns_rdatasetstats_increment(stats, which); }
static void set_nxdomainstats(dns_stats_t *stats, isc_boolean_t stale) { dns_rdatastatstype_t which; unsigned int attributes; attributes = DNS_RDATASTATSTYPE_ATTR_NXDOMAIN; if (stale) attributes |= DNS_RDATASTATSTYPE_ATTR_STALE; which = DNS_RDATASTATSTYPE_VALUE(0, attributes); dns_rdatasetstats_increment(stats, which); }
static void dump_rdentry(int rdcounter, isc_uint64_t value, dns_rdatastatstype_t attributes, dns_rdatatypestats_dumper_t dump_fn, void * arg) { dns_rdatatype_t rdtype = dns_rdatatype_none; /* sentinel */ dns_rdatastatstype_t type; if (rdcounter == rdtypecounter_others) attributes |= DNS_RDATASTATSTYPE_ATTR_OTHERTYPE; else { if (rdcounter == rdtypecounter_dlv) rdtype = dns_rdatatype_dlv; else rdtype = (dns_rdatatype_t)rdcounter; } type = DNS_RDATASTATSTYPE_VALUE((dns_rdatastatstype_t)rdtype, attributes); dump_fn(type, value, arg); }