[Dnsmasq-discuss] [PATCH] Improve cache dump

Dominik Derigs dl6er at dl6er.de
Sat Jan 8 10:48:59 UTC 2022


Hey Simon,

These patches improve the cache dump triggered by sending
SIGUSR1.

1. The width of the host and address fields are 30 and 40
characters, respectively. Fix the header and add a head
separation line to highlight how long the fields can be.

2. Add "!" as type for non-terminals, new flag "C" for config-
provided and log source where applicable.

I attached the examples below once more as plain text file to
avoid word wrapping.

Before:

Host                                     Address                
Flags      Expires
imap.strato.de                 2a01:238:20a:202:54f0::1103      
6F         Wed Dec 15 20:51:59 2021
imap.strato.de                 81.169.145.103                   
4F         Wed Dec 15 20:51:59 2021
some-hostrecord                192.168.2.3                      
4FRI   H
ip6-localhost                  ::1                              
6FRI   H
arpa                                                            
F I
<Root>                         20326   8   2                    
SF I
Now:

Host                           Address                          
Flags      Expires                  Source
------------------------------ ----------------------------------
------ ---------- ------------------------ ------------
imap.strato.de                 2a01:238:20a:202:54f0::1103      
6F         Wed Dec 15 20:51:59 2021
imap.strato.de                 81.169.145.103                   
4F         Wed Dec 15 20:51:59 2021
some-hostrecord                192.168.2.3                      
4FRI   HC                           config
ip6-localhost                  ::1                              
6FRI   H                            /etc/hosts
arpa                                                            
!F I    C
<Root>                         20326   8   2                    
SF I    C                           config


Best,
Dominik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-header-of-cache-dump.-The-width-of-the-host-and-.patch
Type: text/x-patch
Size: 1092 bytes
Desc: not available
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20220108/32e3f7b1/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Extend-cache-dump-as-type-for-non-terminals-new-flag.patch
Type: text/x-patch
Size: 2636 bytes
Desc: not available
URL: <http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/attachments/20220108/32e3f7b1/attachment-0001.bin>
-------------- next part --------------
Before:



Host                                     Address                        Flags      Expires
imap.strato.de                 2a01:238:20a:202:54f0::1103              6F         Wed Dec 15 20:51:59 2021
imap.strato.de                 81.169.145.103                           4F         Wed Dec 15 20:51:59 2021
some-hostrecord                192.168.2.3                              4FRI   H
ip6-localhost                  ::1                                      6FRI   H
arpa                                                                     F I
<Root>                         20326   8   2                            SF I




Now:



Host                           Address                                  Flags      Expires                  Source
------------------------------ ---------------------------------------- ---------- ------------------------ ------------
imap.strato.de                 2a01:238:20a:202:54f0::1103              6F         Wed Dec 15 20:51:59 2021
imap.strato.de                 81.169.145.103                           4F         Wed Dec 15 20:51:59 2021
some-hostrecord                192.168.2.3                              4FRI   HC                           config
ip6-localhost                  ::1                                      6FRI   H                            /etc/hosts
arpa                                                                    !F I    C
<Root>                         20326   8   2                            SF I    C                           config


More information about the Dnsmasq-discuss mailing list