On Wed, Jun 07, 2023 at 01:28:17PM +0000, Karavelov, Luben via Dnsmasq-discuss 
wrote:
> Adding two new CHAOS names:
> - stale.bind
> - unanswered.bind
> that expose the dns_stale_answered and dns_unanswered metrics.
> ---
>  src/cache.c   | 8 ++++++++
>  src/dnsmasq.h | 2 ++
>  src/option.c  | 2 ++
>  3 files changed, 12 insertions(+)
> 
> diff --git a/src/cache.c b/src/cache.c
> index 1c0e250..daacbaa 100644
> --- a/src/cache.c
> +++ b/src/cache.c
> @@ -1725,6 +1725,14 @@ int cache_make_stat(struct txt_record *t)
>        break;
>  #endif
>  
> +    case TXT_STAT_STALE:
> +      sprintf(buff+1, "%u", daemon->metrics[METRIC_DNS_STALE_ANSWERED]);
> +      break;
> +
> +    case TXT_STAT_UNANSWERED:
> +      sprintf(buff+1, "%u", daemon->metrics[METRIC_DNS_UNANSWERED_QUERY]);
> +      break;
> +
>      case TXT_STAT_SERVERS:
>        /* sum counts from different records for same server */
>        for (serv = daemon->servers; serv; serv = serv->next)
> diff --git a/src/dnsmasq.h b/src/dnsmasq.h
> index 2f95c12..08e6888 100644
> --- a/src/dnsmasq.h
> +++ b/src/dnsmasq.h
> @@ -380,6 +380,8 @@ struct naptr {
>  #define TXT_STAT_HITS          5
>  #define TXT_STAT_AUTH          6
>  #define TXT_STAT_SERVERS       7
> +#define TXT_STAT_STALE         8
> +#define TXT_STAT_UNANSWERED    9
>  #endif
>  
>  struct txt_record {
> diff --git a/src/option.c b/src/option.c
> index 8322725..2b2705e 100644
> --- a/src/option.c
> +++ b/src/option.c
> @@ -5947,6 +5947,8 @@ void read_opts(int argc, char **argv, char 
> *compile_opts)
>        add_txt("auth.bind", NULL, TXT_STAT_AUTH);
>  #endif
>        add_txt("servers.bind", NULL, TXT_STAT_SERVERS);
> +      add_txt("stale.bind", NULL, TXT_STAT_STALE);
> +      add_txt("unanswered.bind", NULL, TXT_STAT_UNANSWERED);
>      }
>  #endif
>  

It misses

--- a/man/dnsmasq.8
+++ b/man/dnsmasq.8
@@ -2248,6 +2248,7 @@ Do not respond to class CHAOS and type TXT in domain bind 
queries.
 Without this option being set, the cache statistics are also available in the
 DNS as answers to queries of class CHAOS and type TXT in domain bind. The 
domain
 names are cachesize.bind, insertions.bind, evictions.bind, misses.bind,
+stale.bind, unanswered.bind,
 hits.bind, auth.bind and servers.bind unless disabled at compile-time. An
 example command to query this, using the
 .B dig


Regards
Geert Stappers
Mostly saying   "the patch has been seen"
-- 
Silence is hard to parse

_______________________________________________
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
https://lists.thekelleys.org.uk/cgi-bin/mailman/listinfo/dnsmasq-discuss

Reply via email to