statzone

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

commit e77bdbbbf049321bbe57f6abf1917c0d0784109d
parent 8421d614d9f21ba9dd42ade41af444332dcb2d0d
Author: Frederic Cambus <fred@statdns.com>
Date:   Sat,  5 Jan 2019 21:28:08 +0100

If we encounter a DS record, save the domain name in a hash table.

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

diff --git a/src/statzone.c b/src/statzone.c @@ -4,7 +4,7 @@ * https://www.statdns.com * * Created: 2012-02-13 - * Last Updated: 2019-01-04 + * Last Updated: 2019-01-05 * * StatZone is released under the BSD 2-Clause license * See LICENSE file for details. @@ -42,6 +42,14 @@ char *intputFile; char *domain; +struct my_struct { + char *domain; + UT_hash_handle hh; +}; + +struct my_struct *signedDomains = NULL; +struct my_struct *ds; + void displayUsage() { printf("USAGE: statzone [options] inputfile\n\n" \ @@ -133,6 +141,14 @@ main(int argc, char *argv[]) { if (!strcmp(token_lc, "ds")) { results.ds++; + + HASH_FIND_STR(signedDomains, domain, ds); + + if (!ds) { + ds = malloc(sizeof(struct my_struct)); + ds->domain = domain; + HASH_ADD_STR(signedDomains, domain, ds); + } } if (!strcmp(token_lc, "ns")) {