"Fossies" - the Fresh Open Source Software Archive

Member "bind-9.17.5/lib/dns/include/dns/stats.h" (4 Sep 2020, 26061 Bytes) of package /linux/misc/dns/bind9/9.17.5/bind-9.17.5.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "stats.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
    3  *
    4  * This Source Code Form is subject to the terms of the Mozilla Public
    5  * License, v. 2.0. If a copy of the MPL was not distributed with this
    6  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
    7  *
    8  * See the COPYRIGHT file distributed with this work for additional
    9  * information regarding copyright ownership.
   10  */
   11 
   12 #ifndef DNS_STATS_H
   13 #define DNS_STATS_H 1
   14 
   15 /*! \file dns/stats.h */
   16 
   17 #include <inttypes.h>
   18 
   19 #include <dns/types.h>
   20 
   21 /*%
   22  * Statistics counters.  Used as isc_statscounter_t values.
   23  */
   24 enum {
   25     /*%
   26      * Resolver statistics counters.
   27      */
   28     dns_resstatscounter_queryv4 = 0,
   29     dns_resstatscounter_queryv6 = 1,
   30     dns_resstatscounter_responsev4 = 2,
   31     dns_resstatscounter_responsev6 = 3,
   32     dns_resstatscounter_nxdomain = 4,
   33     dns_resstatscounter_servfail = 5,
   34     dns_resstatscounter_formerr = 6,
   35     dns_resstatscounter_othererror = 7,
   36     dns_resstatscounter_edns0fail = 8,
   37     dns_resstatscounter_mismatch = 9,
   38     dns_resstatscounter_truncated = 10,
   39     dns_resstatscounter_lame = 11,
   40     dns_resstatscounter_retry = 12,
   41     dns_resstatscounter_gluefetchv4 = 13,
   42     dns_resstatscounter_gluefetchv6 = 14,
   43     dns_resstatscounter_gluefetchv4fail = 15,
   44     dns_resstatscounter_gluefetchv6fail = 16,
   45     dns_resstatscounter_val = 17,
   46     dns_resstatscounter_valsuccess = 18,
   47     dns_resstatscounter_valnegsuccess = 19,
   48     dns_resstatscounter_valfail = 20,
   49     dns_resstatscounter_dispabort = 21,
   50     dns_resstatscounter_dispsockfail = 22,
   51     dns_resstatscounter_querytimeout = 23,
   52     dns_resstatscounter_queryrtt0 = 24,
   53     dns_resstatscounter_queryrtt1 = 25,
   54     dns_resstatscounter_queryrtt2 = 26,
   55     dns_resstatscounter_queryrtt3 = 27,
   56     dns_resstatscounter_queryrtt4 = 28,
   57     dns_resstatscounter_queryrtt5 = 29,
   58     dns_resstatscounter_nfetch = 30,
   59     dns_resstatscounter_disprequdp = 31,
   60     dns_resstatscounter_dispreqtcp = 32,
   61     dns_resstatscounter_buckets = 33,
   62     dns_resstatscounter_refused = 34,
   63     dns_resstatscounter_cookienew = 35,
   64     dns_resstatscounter_cookieout = 36,
   65     dns_resstatscounter_cookiein = 37,
   66     dns_resstatscounter_cookieok = 38,
   67     dns_resstatscounter_badvers = 39,
   68     dns_resstatscounter_badcookie = 40,
   69     dns_resstatscounter_zonequota = 41,
   70     dns_resstatscounter_serverquota = 42,
   71     dns_resstatscounter_nextitem = 43,
   72     dns_resstatscounter_priming = 44,
   73     dns_resstatscounter_max = 45,
   74 
   75     /*
   76      * DNSSEC stats.
   77      */
   78     dns_dnssecstats_asis = 0,
   79     dns_dnssecstats_downcase = 1,
   80     dns_dnssecstats_wildcard = 2,
   81     dns_dnssecstats_fail = 3,
   82 
   83     dns_dnssecstats_max = 4,
   84 
   85     /*%
   86      * Zone statistics counters.
   87      */
   88     dns_zonestatscounter_notifyoutv4 = 0,
   89     dns_zonestatscounter_notifyoutv6 = 1,
   90     dns_zonestatscounter_notifyinv4 = 2,
   91     dns_zonestatscounter_notifyinv6 = 3,
   92     dns_zonestatscounter_notifyrej = 4,
   93     dns_zonestatscounter_soaoutv4 = 5,
   94     dns_zonestatscounter_soaoutv6 = 6,
   95     dns_zonestatscounter_axfrreqv4 = 7,
   96     dns_zonestatscounter_axfrreqv6 = 8,
   97     dns_zonestatscounter_ixfrreqv4 = 9,
   98     dns_zonestatscounter_ixfrreqv6 = 10,
   99     dns_zonestatscounter_xfrsuccess = 11,
  100     dns_zonestatscounter_xfrfail = 12,
  101 
  102     dns_zonestatscounter_max = 13,
  103 
  104     /*
  105      * Adb statistics values.
  106      */
  107     dns_adbstats_nentries = 0,
  108     dns_adbstats_entriescnt = 1,
  109     dns_adbstats_nnames = 2,
  110     dns_adbstats_namescnt = 3,
  111 
  112     dns_adbstats_max = 4,
  113 
  114     /*
  115      * Cache statistics values.
  116      */
  117     dns_cachestatscounter_hits = 1,
  118     dns_cachestatscounter_misses = 2,
  119     dns_cachestatscounter_queryhits = 3,
  120     dns_cachestatscounter_querymisses = 4,
  121     dns_cachestatscounter_deletelru = 5,
  122     dns_cachestatscounter_deletettl = 6,
  123 
  124     dns_cachestatscounter_max = 7,
  125 
  126     /*%
  127      * Query statistics counters (obsolete).
  128      */
  129     dns_statscounter_success = 0,   /*%< Successful lookup */
  130     dns_statscounter_referral = 1,  /*%< Referral result */
  131     dns_statscounter_nxrrset = 2,   /*%< NXRRSET result */
  132     dns_statscounter_nxdomain = 3,  /*%< NXDOMAIN result */
  133     dns_statscounter_recursion = 4, /*%< Recursion was used */
  134     dns_statscounter_failure = 5,   /*%< Some other failure */
  135     dns_statscounter_duplicate = 6, /*%< Duplicate query */
  136     dns_statscounter_dropped = 7,   /*%< Duplicate query (dropped) */
  137 
  138     /*%
  139      * DNSTAP statistics counters.
  140      */
  141     dns_dnstapcounter_success = 0,
  142     dns_dnstapcounter_drop = 1,
  143     dns_dnstapcounter_max = 2,
  144 
  145     /*
  146      * Glue cache statistics counters.
  147      */
  148     dns_gluecachestatscounter_hits_present = 0,
  149     dns_gluecachestatscounter_hits_absent = 1,
  150     dns_gluecachestatscounter_inserts_present = 2,
  151     dns_gluecachestatscounter_inserts_absent = 3,
  152 
  153     dns_gluecachestatscounter_max = 4,
  154 };
  155 
  156 /*%
  157  * Traffic size statistics counters. Used as isc_statscounter_t values.
  158  */
  159 enum { dns_sizecounter_in_0 = 0,
  160        dns_sizecounter_in_16 = 1,
  161        dns_sizecounter_in_32 = 2,
  162        dns_sizecounter_in_48 = 3,
  163        dns_sizecounter_in_64 = 4,
  164        dns_sizecounter_in_80 = 5,
  165        dns_sizecounter_in_96 = 6,
  166        dns_sizecounter_in_112 = 7,
  167        dns_sizecounter_in_128 = 8,
  168        dns_sizecounter_in_144 = 9,
  169        dns_sizecounter_in_160 = 10,
  170        dns_sizecounter_in_176 = 11,
  171        dns_sizecounter_in_192 = 12,
  172        dns_sizecounter_in_208 = 13,
  173        dns_sizecounter_in_224 = 14,
  174        dns_sizecounter_in_240 = 15,
  175        dns_sizecounter_in_256 = 16,
  176        dns_sizecounter_in_272 = 17,
  177        dns_sizecounter_in_288 = 18,
  178 
  179        dns_sizecounter_in_max = 19,
  180 };
  181 
  182 enum { dns_sizecounter_out_0 = 0,
  183        dns_sizecounter_out_16 = 1,
  184        dns_sizecounter_out_32 = 2,
  185        dns_sizecounter_out_48 = 3,
  186        dns_sizecounter_out_64 = 4,
  187        dns_sizecounter_out_80 = 5,
  188        dns_sizecounter_out_96 = 6,
  189        dns_sizecounter_out_112 = 7,
  190        dns_sizecounter_out_128 = 8,
  191        dns_sizecounter_out_144 = 9,
  192        dns_sizecounter_out_160 = 10,
  193        dns_sizecounter_out_176 = 11,
  194        dns_sizecounter_out_192 = 12,
  195        dns_sizecounter_out_208 = 13,
  196        dns_sizecounter_out_224 = 14,
  197        dns_sizecounter_out_240 = 15,
  198        dns_sizecounter_out_256 = 16,
  199        dns_sizecounter_out_272 = 17,
  200        dns_sizecounter_out_288 = 18,
  201        dns_sizecounter_out_304 = 19,
  202        dns_sizecounter_out_320 = 20,
  203        dns_sizecounter_out_336 = 21,
  204        dns_sizecounter_out_352 = 22,
  205        dns_sizecounter_out_368 = 23,
  206        dns_sizecounter_out_384 = 24,
  207        dns_sizecounter_out_400 = 25,
  208        dns_sizecounter_out_416 = 26,
  209        dns_sizecounter_out_432 = 27,
  210        dns_sizecounter_out_448 = 28,
  211        dns_sizecounter_out_464 = 29,
  212        dns_sizecounter_out_480 = 30,
  213        dns_sizecounter_out_496 = 31,
  214        dns_sizecounter_out_512 = 32,
  215        dns_sizecounter_out_528 = 33,
  216        dns_sizecounter_out_544 = 34,
  217        dns_sizecounter_out_560 = 35,
  218        dns_sizecounter_out_576 = 36,
  219        dns_sizecounter_out_592 = 37,
  220        dns_sizecounter_out_608 = 38,
  221        dns_sizecounter_out_624 = 39,
  222        dns_sizecounter_out_640 = 40,
  223        dns_sizecounter_out_656 = 41,
  224        dns_sizecounter_out_672 = 42,
  225        dns_sizecounter_out_688 = 43,
  226        dns_sizecounter_out_704 = 44,
  227        dns_sizecounter_out_720 = 45,
  228        dns_sizecounter_out_736 = 46,
  229        dns_sizecounter_out_752 = 47,
  230        dns_sizecounter_out_768 = 48,
  231        dns_sizecounter_out_784 = 49,
  232        dns_sizecounter_out_800 = 50,
  233        dns_sizecounter_out_816 = 51,
  234        dns_sizecounter_out_832 = 52,
  235        dns_sizecounter_out_848 = 53,
  236        dns_sizecounter_out_864 = 54,
  237        dns_sizecounter_out_880 = 55,
  238        dns_sizecounter_out_896 = 56,
  239        dns_sizecounter_out_912 = 57,
  240        dns_sizecounter_out_928 = 58,
  241        dns_sizecounter_out_944 = 59,
  242        dns_sizecounter_out_960 = 60,
  243        dns_sizecounter_out_976 = 61,
  244        dns_sizecounter_out_992 = 62,
  245        dns_sizecounter_out_1008 = 63,
  246        dns_sizecounter_out_1024 = 64,
  247        dns_sizecounter_out_1040 = 65,
  248        dns_sizecounter_out_1056 = 66,
  249        dns_sizecounter_out_1072 = 67,
  250        dns_sizecounter_out_1088 = 68,
  251        dns_sizecounter_out_1104 = 69,
  252        dns_sizecounter_out_1120 = 70,
  253        dns_sizecounter_out_1136 = 71,
  254        dns_sizecounter_out_1152 = 72,
  255        dns_sizecounter_out_1168 = 73,
  256        dns_sizecounter_out_1184 = 74,
  257        dns_sizecounter_out_1200 = 75,
  258        dns_sizecounter_out_1216 = 76,
  259        dns_sizecounter_out_1232 = 77,
  260        dns_sizecounter_out_1248 = 78,
  261        dns_sizecounter_out_1264 = 79,
  262        dns_sizecounter_out_1280 = 80,
  263        dns_sizecounter_out_1296 = 81,
  264        dns_sizecounter_out_1312 = 82,
  265        dns_sizecounter_out_1328 = 83,
  266        dns_sizecounter_out_1344 = 84,
  267        dns_sizecounter_out_1360 = 85,
  268        dns_sizecounter_out_1376 = 86,
  269        dns_sizecounter_out_1392 = 87,
  270        dns_sizecounter_out_1408 = 88,
  271        dns_sizecounter_out_1424 = 89,
  272        dns_sizecounter_out_1440 = 90,
  273        dns_sizecounter_out_1456 = 91,
  274        dns_sizecounter_out_1472 = 92,
  275        dns_sizecounter_out_1488 = 93,
  276        dns_sizecounter_out_1504 = 94,
  277        dns_sizecounter_out_1520 = 95,
  278        dns_sizecounter_out_1536 = 96,
  279        dns_sizecounter_out_1552 = 97,
  280        dns_sizecounter_out_1568 = 98,
  281        dns_sizecounter_out_1584 = 99,
  282        dns_sizecounter_out_1600 = 100,
  283        dns_sizecounter_out_1616 = 101,
  284        dns_sizecounter_out_1632 = 102,
  285        dns_sizecounter_out_1648 = 103,
  286        dns_sizecounter_out_1664 = 104,
  287        dns_sizecounter_out_1680 = 105,
  288        dns_sizecounter_out_1696 = 106,
  289        dns_sizecounter_out_1712 = 107,
  290        dns_sizecounter_out_1728 = 108,
  291        dns_sizecounter_out_1744 = 109,
  292        dns_sizecounter_out_1760 = 110,
  293        dns_sizecounter_out_1776 = 111,
  294        dns_sizecounter_out_1792 = 112,
  295        dns_sizecounter_out_1808 = 113,
  296        dns_sizecounter_out_1824 = 114,
  297        dns_sizecounter_out_1840 = 115,
  298        dns_sizecounter_out_1856 = 116,
  299        dns_sizecounter_out_1872 = 117,
  300        dns_sizecounter_out_1888 = 118,
  301        dns_sizecounter_out_1904 = 119,
  302        dns_sizecounter_out_1920 = 120,
  303        dns_sizecounter_out_1936 = 121,
  304        dns_sizecounter_out_1952 = 122,
  305        dns_sizecounter_out_1968 = 123,
  306        dns_sizecounter_out_1984 = 124,
  307        dns_sizecounter_out_2000 = 125,
  308        dns_sizecounter_out_2016 = 126,
  309        dns_sizecounter_out_2032 = 127,
  310        dns_sizecounter_out_2048 = 128,
  311        dns_sizecounter_out_2064 = 129,
  312        dns_sizecounter_out_2080 = 130,
  313        dns_sizecounter_out_2096 = 131,
  314        dns_sizecounter_out_2112 = 132,
  315        dns_sizecounter_out_2128 = 133,
  316        dns_sizecounter_out_2144 = 134,
  317        dns_sizecounter_out_2160 = 135,
  318        dns_sizecounter_out_2176 = 136,
  319        dns_sizecounter_out_2192 = 137,
  320        dns_sizecounter_out_2208 = 138,
  321        dns_sizecounter_out_2224 = 139,
  322        dns_sizecounter_out_2240 = 140,
  323        dns_sizecounter_out_2256 = 141,
  324        dns_sizecounter_out_2272 = 142,
  325        dns_sizecounter_out_2288 = 143,
  326        dns_sizecounter_out_2304 = 144,
  327        dns_sizecounter_out_2320 = 145,
  328        dns_sizecounter_out_2336 = 146,
  329        dns_sizecounter_out_2352 = 147,
  330        dns_sizecounter_out_2368 = 148,
  331        dns_sizecounter_out_2384 = 149,
  332        dns_sizecounter_out_2400 = 150,
  333        dns_sizecounter_out_2416 = 151,
  334        dns_sizecounter_out_2432 = 152,
  335        dns_sizecounter_out_2448 = 153,
  336        dns_sizecounter_out_2464 = 154,
  337        dns_sizecounter_out_2480 = 155,
  338        dns_sizecounter_out_2496 = 156,
  339        dns_sizecounter_out_2512 = 157,
  340        dns_sizecounter_out_2528 = 158,
  341        dns_sizecounter_out_2544 = 159,
  342        dns_sizecounter_out_2560 = 160,
  343        dns_sizecounter_out_2576 = 161,
  344        dns_sizecounter_out_2592 = 162,
  345        dns_sizecounter_out_2608 = 163,
  346        dns_sizecounter_out_2624 = 164,
  347        dns_sizecounter_out_2640 = 165,
  348        dns_sizecounter_out_2656 = 166,
  349        dns_sizecounter_out_2672 = 167,
  350        dns_sizecounter_out_2688 = 168,
  351        dns_sizecounter_out_2704 = 169,
  352        dns_sizecounter_out_2720 = 170,
  353        dns_sizecounter_out_2736 = 171,
  354        dns_sizecounter_out_2752 = 172,
  355        dns_sizecounter_out_2768 = 173,
  356        dns_sizecounter_out_2784 = 174,
  357        dns_sizecounter_out_2800 = 175,
  358        dns_sizecounter_out_2816 = 176,
  359        dns_sizecounter_out_2832 = 177,
  360        dns_sizecounter_out_2848 = 178,
  361        dns_sizecounter_out_2864 = 179,
  362        dns_sizecounter_out_2880 = 180,
  363        dns_sizecounter_out_2896 = 181,
  364        dns_sizecounter_out_2912 = 182,
  365        dns_sizecounter_out_2928 = 183,
  366        dns_sizecounter_out_2944 = 184,
  367        dns_sizecounter_out_2960 = 185,
  368        dns_sizecounter_out_2976 = 186,
  369        dns_sizecounter_out_2992 = 187,
  370        dns_sizecounter_out_3008 = 188,
  371        dns_sizecounter_out_3024 = 189,
  372        dns_sizecounter_out_3040 = 190,
  373        dns_sizecounter_out_3056 = 191,
  374        dns_sizecounter_out_3072 = 192,
  375        dns_sizecounter_out_3088 = 193,
  376        dns_sizecounter_out_3104 = 194,
  377        dns_sizecounter_out_3120 = 195,
  378        dns_sizecounter_out_3136 = 196,
  379        dns_sizecounter_out_3152 = 197,
  380        dns_sizecounter_out_3168 = 198,
  381        dns_sizecounter_out_3184 = 199,
  382        dns_sizecounter_out_3200 = 200,
  383        dns_sizecounter_out_3216 = 201,
  384        dns_sizecounter_out_3232 = 202,
  385        dns_sizecounter_out_3248 = 203,
  386        dns_sizecounter_out_3264 = 204,
  387        dns_sizecounter_out_3280 = 205,
  388        dns_sizecounter_out_3296 = 206,
  389        dns_sizecounter_out_3312 = 207,
  390        dns_sizecounter_out_3328 = 208,
  391        dns_sizecounter_out_3344 = 209,
  392        dns_sizecounter_out_3360 = 210,
  393        dns_sizecounter_out_3376 = 211,
  394        dns_sizecounter_out_3392 = 212,
  395        dns_sizecounter_out_3408 = 213,
  396        dns_sizecounter_out_3424 = 214,
  397        dns_sizecounter_out_3440 = 215,
  398        dns_sizecounter_out_3456 = 216,
  399        dns_sizecounter_out_3472 = 217,
  400        dns_sizecounter_out_3488 = 218,
  401        dns_sizecounter_out_3504 = 219,
  402        dns_sizecounter_out_3520 = 220,
  403        dns_sizecounter_out_3536 = 221,
  404        dns_sizecounter_out_3552 = 222,
  405        dns_sizecounter_out_3568 = 223,
  406        dns_sizecounter_out_3584 = 224,
  407        dns_sizecounter_out_3600 = 225,
  408        dns_sizecounter_out_3616 = 226,
  409        dns_sizecounter_out_3632 = 227,
  410        dns_sizecounter_out_3648 = 228,
  411        dns_sizecounter_out_3664 = 229,
  412        dns_sizecounter_out_3680 = 230,
  413        dns_sizecounter_out_3696 = 231,
  414        dns_sizecounter_out_3712 = 232,
  415        dns_sizecounter_out_3728 = 233,
  416        dns_sizecounter_out_3744 = 234,
  417        dns_sizecounter_out_3760 = 235,
  418        dns_sizecounter_out_3776 = 236,
  419        dns_sizecounter_out_3792 = 237,
  420        dns_sizecounter_out_3808 = 238,
  421        dns_sizecounter_out_3824 = 239,
  422        dns_sizecounter_out_3840 = 240,
  423        dns_sizecounter_out_3856 = 241,
  424        dns_sizecounter_out_3872 = 242,
  425        dns_sizecounter_out_3888 = 243,
  426        dns_sizecounter_out_3904 = 244,
  427        dns_sizecounter_out_3920 = 245,
  428        dns_sizecounter_out_3936 = 246,
  429        dns_sizecounter_out_3952 = 247,
  430        dns_sizecounter_out_3968 = 248,
  431        dns_sizecounter_out_3984 = 249,
  432        dns_sizecounter_out_4000 = 250,
  433        dns_sizecounter_out_4016 = 251,
  434        dns_sizecounter_out_4032 = 252,
  435        dns_sizecounter_out_4048 = 253,
  436        dns_sizecounter_out_4064 = 254,
  437        dns_sizecounter_out_4080 = 255,
  438        dns_sizecounter_out_4096 = 256,
  439 
  440        dns_sizecounter_out_max = 257 };
  441 
  442 #define DNS_STATS_NCOUNTERS 8
  443 
  444 #if 0
  445 /*%<
  446  * Flag(s) for dns_xxxstats_dump().  DNS_STATSDUMP_VERBOSE is obsolete.
  447  * ISC_STATSDUMP_VERBOSE should be used instead.  These two values are
  448  * intentionally defined to be the same value to ensure binary compatibility.
  449  */
  450 #define DNS_STATSDUMP_VERBOSE 0x00000001 /*%< dump 0-value counters */
  451 #endif                   /* if 0 */
  452 
  453 /*%<
  454  * (Obsoleted)
  455  */
  456 LIBDNS_EXTERNAL_DATA extern const char *dns_statscounter_names[];
  457 
  458 /*%
  459  * Attributes for statistics counters of RRset and Rdatatype types.
  460  *
  461  * _OTHERTYPE
  462  *  The rdata type is not explicitly supported and the corresponding counter
  463  *  is counted for other such types, too.  When this attribute is set,
  464  *  the base type is of no use.
  465  *
  466  * _NXRRSET
  467  *  RRset type counters only.  Indicates the RRset is non existent.
  468  *
  469  * _NXDOMAIN
  470  *  RRset type counters only.  Indicates a non existent name.  When this
  471  *  attribute is set, the base type is of no use.
  472  *
  473  * _STALE
  474  *  RRset type counters only.  This indicates a record that is stale
  475  *  but may still be served.
  476  *
  477  * _ANCIENT
  478  *  RRset type counters only.  This indicates a record that is marked for
  479  *  removal.
  480  */
  481 #define DNS_RDATASTATSTYPE_ATTR_OTHERTYPE 0x0001
  482 #define DNS_RDATASTATSTYPE_ATTR_NXRRSET   0x0002
  483 #define DNS_RDATASTATSTYPE_ATTR_NXDOMAIN  0x0004
  484 #define DNS_RDATASTATSTYPE_ATTR_STALE     0x0008
  485 #define DNS_RDATASTATSTYPE_ATTR_ANCIENT   0x0010
  486 
  487 /*%<
  488  * Conversion macros among dns_rdatatype_t, attributes and isc_statscounter_t.
  489  */
  490 #define DNS_RDATASTATSTYPE_BASE(type)  ((dns_rdatatype_t)((type)&0xFFFF))
  491 #define DNS_RDATASTATSTYPE_ATTR(type)  ((type) >> 16)
  492 #define DNS_RDATASTATSTYPE_VALUE(b, a) (((a) << 16) | (b))
  493 
  494 /*%
  495  * Types of DNSSEC sign statistics operations.
  496  */
  497 typedef enum {
  498     dns_dnssecsignstats_sign = 1,
  499     dns_dnssecsignstats_refresh = 2
  500 } dnssecsignstats_type_t;
  501 
  502 /*%<
  503  * Types of dump callbacks.
  504  */
  505 typedef void (*dns_generalstats_dumper_t)(isc_statscounter_t, uint64_t, void *);
  506 typedef void (*dns_rdatatypestats_dumper_t)(dns_rdatastatstype_t, uint64_t,
  507                         void *);
  508 typedef void (*dns_dnssecsignstats_dumper_t)(dns_keytag_t, uint64_t, void *);
  509 typedef void (*dns_opcodestats_dumper_t)(dns_opcode_t, uint64_t, void *);
  510 typedef void (*dns_rcodestats_dumper_t)(dns_rcode_t, uint64_t, void *);
  511 
  512 ISC_LANG_BEGINDECLS
  513 
  514 isc_result_t
  515 dns_generalstats_create(isc_mem_t *mctx, dns_stats_t **statsp, int ncounters);
  516 /*%<
  517  * Create a statistics counter structure of general type.  It counts a general
  518  * set of counters indexed by an ID between 0 and ncounters -1.
  519  * This function is obsolete.  A more general function, isc_stats_create(),
  520  * should be used.
  521  *
  522  * Requires:
  523  *\li   'mctx' must be a valid memory context.
  524  *
  525  *\li   'statsp' != NULL && '*statsp' == NULL.
  526  *
  527  * Returns:
  528  *\li   ISC_R_SUCCESS   -- all ok
  529  *
  530  *\li   anything else   -- failure
  531  */
  532 
  533 isc_result_t
  534 dns_rdatatypestats_create(isc_mem_t *mctx, dns_stats_t **statsp);
  535 /*%<
  536  * Create a statistics counter structure per rdatatype.
  537  *
  538  * Requires:
  539  *\li   'mctx' must be a valid memory context.
  540  *
  541  *\li   'statsp' != NULL && '*statsp' == NULL.
  542  *
  543  * Returns:
  544  *\li   ISC_R_SUCCESS   -- all ok
  545  *
  546  *\li   anything else   -- failure
  547  */
  548 
  549 isc_result_t
  550 dns_rdatasetstats_create(isc_mem_t *mctx, dns_stats_t **statsp);
  551 /*%<
  552  * Create a statistics counter structure per RRset.
  553  *
  554  * Requires:
  555  *\li   'mctx' must be a valid memory context.
  556  *
  557  *\li   'statsp' != NULL && '*statsp' == NULL.
  558  *
  559  * Returns:
  560  *\li   ISC_R_SUCCESS   -- all ok
  561  *
  562  *\li   anything else   -- failure
  563  */
  564 
  565 isc_result_t
  566 dns_opcodestats_create(isc_mem_t *mctx, dns_stats_t **statsp);
  567 /*%<
  568  * Create a statistics counter structure per opcode.
  569  *
  570  * Requires:
  571  *\li   'mctx' must be a valid memory context.
  572  *
  573  *\li   'statsp' != NULL && '*statsp' == NULL.
  574  *
  575  * Returns:
  576  *\li   ISC_R_SUCCESS   -- all ok
  577  *
  578  *\li   anything else   -- failure
  579  */
  580 
  581 isc_result_t
  582 dns_rcodestats_create(isc_mem_t *mctx, dns_stats_t **statsp);
  583 /*%<
  584  * Create a statistics counter structure per assigned rcode.
  585  *
  586  * Requires:
  587  *\li   'mctx' must be a valid memory context.
  588  *
  589  *\li   'statsp' != NULL && '*statsp' == NULL.
  590  *
  591  * Returns:
  592  *\li   ISC_R_SUCCESS   -- all ok
  593  *
  594  *\li   anything else   -- failure
  595  */
  596 
  597 isc_result_t
  598 dns_dnssecsignstats_create(isc_mem_t *mctx, dns_stats_t **statsp);
  599 /*%<
  600  * Create a statistics counter structure per assigned DNSKEY id.
  601  *
  602  * Requires:
  603  *\li   'mctx' must be a valid memory context.
  604  *
  605  *\li   'statsp' != NULL && '*statsp' == NULL.
  606  *
  607  * Returns:
  608  *\li   ISC_R_SUCCESS   -- all ok
  609  *
  610  *\li   anything else   -- failure
  611  */
  612 
  613 void
  614 dns_stats_attach(dns_stats_t *stats, dns_stats_t **statsp);
  615 /*%<
  616  * Attach to a statistics set.
  617  *
  618  * Requires:
  619  *\li   'stats' is a valid dns_stats_t.
  620  *
  621  *\li   'statsp' != NULL && '*statsp' == NULL
  622  */
  623 
  624 void
  625 dns_stats_detach(dns_stats_t **statsp);
  626 /*%<
  627  * Detaches from the statistics set.
  628  *
  629  * Requires:
  630  *\li   'statsp' != NULL and '*statsp' is a valid dns_stats_t.
  631  */
  632 
  633 void
  634 dns_generalstats_increment(dns_stats_t *stats, isc_statscounter_t counter);
  635 /*%<
  636  * Increment the counter-th counter of stats.  This function is obsolete.
  637  * A more general function, isc_stats_increment(), should be used.
  638  *
  639  * Requires:
  640  *\li   'stats' is a valid dns_stats_t created by dns_generalstats_create().
  641  *
  642  *\li   counter is less than the maximum available ID for the stats specified
  643  *  on creation.
  644  */
  645 
  646 void
  647 dns_rdatatypestats_increment(dns_stats_t *stats, dns_rdatatype_t type);
  648 /*%<
  649  * Increment the statistics counter for 'type'.
  650  *
  651  * Requires:
  652  *\li   'stats' is a valid dns_stats_t created by dns_rdatatypestats_create().
  653  */
  654 
  655 void
  656 dns_rdatasetstats_increment(dns_stats_t *stats, dns_rdatastatstype_t rrsettype);
  657 /*%<
  658  * Increment the statistics counter for 'rrsettype'.
  659  *
  660  * Note: if 'rrsettype' has the _STALE attribute set the corresponding
  661  * non-stale counter will be decremented.
  662  *
  663  * Requires:
  664  *\li   'stats' is a valid dns_stats_t created by dns_rdatasetstats_create().
  665  */
  666 
  667 void
  668 dns_rdatasetstats_decrement(dns_stats_t *stats, dns_rdatastatstype_t rrsettype);
  669 /*%<
  670  * Decrement the statistics counter for 'rrsettype'.
  671  *
  672  * Requires:
  673  *\li   'stats' is a valid dns_stats_t created by dns_rdatasetstats_create().
  674  */
  675 
  676 void
  677 dns_opcodestats_increment(dns_stats_t *stats, dns_opcode_t code);
  678 /*%<
  679  * Increment the statistics counter for 'code'.
  680  *
  681  * Requires:
  682  *\li   'stats' is a valid dns_stats_t created by dns_opcodestats_create().
  683  */
  684 
  685 void
  686 dns_rcodestats_increment(dns_stats_t *stats, dns_opcode_t code);
  687 /*%<
  688  * Increment the statistics counter for 'code'.
  689  *
  690  * Requires:
  691  *\li   'stats' is a valid dns_stats_t created by dns_rcodestats_create().
  692  */
  693 
  694 void
  695 dns_dnssecsignstats_increment(dns_stats_t *stats, dns_keytag_t id, uint8_t alg,
  696                   dnssecsignstats_type_t operation);
  697 /*%<
  698  * Increment the statistics counter for the DNSKEY 'id'. The 'operation'
  699  * determines what counter is incremented.
  700  *
  701  * Requires:
  702  *\li   'stats' is a valid dns_stats_t created by dns_dnssecsignstats_create().
  703  */
  704 
  705 void
  706 dns_generalstats_dump(dns_stats_t *stats, dns_generalstats_dumper_t dump_fn,
  707               void *arg, unsigned int options);
  708 /*%<
  709  * Dump the current statistics counters in a specified way.  For each counter
  710  * in stats, dump_fn is called with its current value and the given argument
  711  * arg.  By default counters that have a value of 0 is skipped; if options has
  712  * the ISC_STATSDUMP_VERBOSE flag, even such counters are dumped.
  713  *
  714  * This function is obsolete.  A more general function, isc_stats_dump(),
  715  * should be used.
  716  *
  717  * Requires:
  718  *\li   'stats' is a valid dns_stats_t created by dns_generalstats_create().
  719  */
  720 
  721 void
  722 dns_rdatatypestats_dump(dns_stats_t *stats, dns_rdatatypestats_dumper_t dump_fn,
  723             void *arg, unsigned int options);
  724 /*%<
  725  * Dump the current statistics counters in a specified way.  For each counter
  726  * in stats, dump_fn is called with the corresponding type in the form of
  727  * dns_rdatastatstype_t, the current counter value and the given argument
  728  * arg.  By default counters that have a value of 0 is skipped; if options has
  729  * the ISC_STATSDUMP_VERBOSE flag, even such counters are dumped.
  730  *
  731  * Requires:
  732  *\li   'stats' is a valid dns_stats_t created by dns_generalstats_create().
  733  */
  734 
  735 void
  736 dns_rdatasetstats_dump(dns_stats_t *stats, dns_rdatatypestats_dumper_t dump_fn,
  737                void *arg, unsigned int options);
  738 /*%<
  739  * Dump the current statistics counters in a specified way.  For each counter
  740  * in stats, dump_fn is called with the corresponding type in the form of
  741  * dns_rdatastatstype_t, the current counter value and the given argument
  742  * arg.  By default counters that have a value of 0 is skipped; if options has
  743  * the ISC_STATSDUMP_VERBOSE flag, even such counters are dumped.
  744  *
  745  * Requires:
  746  *\li   'stats' is a valid dns_stats_t created by dns_generalstats_create().
  747  */
  748 
  749 void
  750 dns_dnssecsignstats_dump(dns_stats_t *stats, dnssecsignstats_type_t operation,
  751              dns_dnssecsignstats_dumper_t dump_fn, void *arg,
  752              unsigned int options);
  753 /*%<
  754  * Dump the current statistics counters in a specified way.  For each counter
  755  * in stats, dump_fn is called with the corresponding type in the form of
  756  * dns_rdatastatstype_t, the current counter value and the given argument
  757  * arg.  By default counters that have a value of 0 is skipped; if options has
  758  * the ISC_STATSDUMP_VERBOSE flag, even such counters are dumped.
  759  *
  760  * Requires:
  761  *\li   'stats' is a valid dns_stats_t created by dns_generalstats_create().
  762  */
  763 
  764 void
  765 dns_opcodestats_dump(dns_stats_t *stats, dns_opcodestats_dumper_t dump_fn,
  766              void *arg, unsigned int options);
  767 /*%<
  768  * Dump the current statistics counters in a specified way.  For each counter
  769  * in stats, dump_fn is called with the corresponding opcode, the current
  770  * counter value and the given argument arg.  By default counters that have a
  771  * value of 0 is skipped; if options has the ISC_STATSDUMP_VERBOSE flag, even
  772  * such counters are dumped.
  773  *
  774  * Requires:
  775  *\li   'stats' is a valid dns_stats_t created by dns_generalstats_create().
  776  */
  777 
  778 void
  779 dns_rcodestats_dump(dns_stats_t *stats, dns_rcodestats_dumper_t dump_fn,
  780             void *arg, unsigned int options);
  781 /*%<
  782  * Dump the current statistics counters in a specified way.  For each counter
  783  * in stats, dump_fn is called with the corresponding rcode, the current
  784  * counter value and the given argument arg.  By default counters that have a
  785  * value of 0 is skipped; if options has the ISC_STATSDUMP_VERBOSE flag, even
  786  * such counters are dumped.
  787  *
  788  * Requires:
  789  *\li   'stats' is a valid dns_stats_t created by dns_generalstats_create().
  790  */
  791 
  792 isc_result_t
  793 dns_stats_alloccounters(isc_mem_t *mctx, uint64_t **ctrp);
  794 /*%<
  795  * Allocate an array of query statistics counters from the memory
  796  * context 'mctx'.
  797  *
  798  * This function is obsoleted.  Use dns_xxxstats_create() instead.
  799  */
  800 
  801 void
  802 dns_stats_freecounters(isc_mem_t *mctx, uint64_t **ctrp);
  803 /*%<
  804  * Free an array of query statistics counters allocated from the memory
  805  * context 'mctx'.
  806  *
  807  * This function is obsoleted.  Use dns_stats_destroy() instead.
  808  */
  809 
  810 ISC_LANG_ENDDECLS
  811 
  812 #endif /* DNS_STATS_H */