statzone

DNS zone file analyzer targeted at TLD zones
Log | Files | Refs | README | LICENSE

commit 3a4200d462801ec8b802f43938774c056bb1d642
parent a2799723d7294d6d17b4a9bb273397cc20746524
Author: Frederic Cambus <fred@statdns.com>
Date:   Thu,  3 Jan 2019 22:14:22 +0100

Stop tokenizing a line when we encounter NSEC, NSEC3, or RRSIG records.

Diffstat:
Msrc/statzone.c | 18++++++++++++++++++
1 file changed, 18 insertions(+), 0 deletions(-)

diff --git a/src/statzone.c b/src/statzone.c @@ -23,6 +23,7 @@ #include "compat.h" #include "config.h" +#include "strtolower.h" struct timespec begin, end, elapsed; @@ -48,6 +49,7 @@ displayUsage() { int main(int argc, char *argv[]) { char *token = NULL; + char *token_lc = NULL; while ((getoptFlag = getopt(argc, argv, "hv")) != -1) { switch(getoptFlag) { @@ -98,6 +100,22 @@ main(int argc, char *argv[]) { token = strtok(lineBuffer, " \t"); while (token) { + token_lc = strtolower(token); + if (!strcmp(token_lc, "nsec")) { + token = NULL; + continue; + } + + if (!strcmp(token_lc, "nsec3")) { + token = NULL; + continue; + } + + if (!strcmp(token_lc, "rrsig")) { + token = NULL; + continue; + } + token = strtok(NULL, " \t"); } }