/*
* Copyright (C) 2004, 2005, 2007-2009, 2012 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000, 2001 Internet Software Consortium.
*
* 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.
*/
/* $Id$ */
/*! \file */
#include <config.h>
#include <dns/rdatatype.h>
/*%
* Statistics types.
*/
typedef enum {
/*%
* It doesn't make sense to have 2^16 counters for all possible types since
* most of them won't be used. We have counters for the first 256 types and
* those explicitly supported in the rdata implementation.
* XXXJT: this introduces tight coupling with the rdata implementation.
* Ideally, we should have rdata handle this type of details.
*/
enum {
/* For 0-255, we use the rdtype value as counter indices */
/* The following are used for rdataset */
};
struct dns_stats {
/*% Unlocked */
unsigned int magic;
/*% Locked by lock */
unsigned int references;
};
typedef struct rdatadumparg {
void *arg;
typedef struct opcodedumparg {
void *arg;
void
stats->references++;
}
void
stats->references--;
if (stats->references == 0) {
}
}
/*%
* Create methods
*/
static isc_result_t
{
return (ISC_R_NOMEMORY);
if (result != ISC_R_SUCCESS)
goto clean_stats;
if (result != ISC_R_SUCCESS)
goto clean_mutex;
return (ISC_R_SUCCESS);
return (result);
}
}
statsp));
}
}
}
/*%
*/
void
}
void
int counter;
if (type == dns_rdatatype_dlv)
else if (type > dns_rdatatype_any)
else
}
static inline void
{
int counter;
if ((DNS_RDATASTATSTYPE_ATTR(rrsettype) &
DNS_RDATASTATSTYPE_ATTR_NXDOMAIN) != 0) {
} else {
if (rdtype == dns_rdatatype_dlv)
counter = (int)rdtypecounter_dlv;
else if (rdtype > dns_rdatatype_any)
counter = (int)rdtypecounter_others;
else
if ((DNS_RDATASTATSTYPE_ATTR(rrsettype) &
}
if (increment)
else
}
void
{
}
void
{
}
void
}
/*%
* Dump methods
*/
void
{
}
static void
{
if (rdcounter == rdtypecounter_others)
else {
if (rdcounter == rdtypecounter_dlv)
else
}
}
static void
}
void
{
}
static void
if (counter < rdtypecounter_max) {
rdatadumparg->arg);
} else if (counter < rdtypenxcounter_max) {
} else {
}
}
void
{
}
static void
}
void
{
}
/***
*** Obsolete variables and functions follow:
***/
{
"success",
"referral",
"nxrrset",
"nxdomain",
"recursion",
"failure",
"duplicate",
"dropped"
};
int i;
isc_uint64_t *p =
if (p == NULL)
return (ISC_R_NOMEMORY);
for (i = 0; i < DNS_STATS_NCOUNTERS; i++)
p[i] = 0;
*ctrp = p;
return (ISC_R_SUCCESS);
}
void
}