Commit Diff
Diff:
958b71b8f51f0c75edb955bde0a6ece1d60aecfa
7c869a2bc1815f06c621fc41993588bf978a528c
Commit:
7c869a2bc1815f06c621fc41993588bf978a528c
Tree:
2e3e7f1e11fc5760aecf4cdac48fc2f3dcbdcbd3
Author:
pjp <pjp@delphinusdns.org>
Committer:
pjp <pjp@delphinusdns.org>
Date:
Fri Feb 15 20:30:11 2019 UTC
Message:
make myrrtab static to util.c fix db_count() in dddctl.c
blob - 779513ccd30712fb9c19a2ee67965696d969b4e9
blob + bc13e05d6badd8bee783e6a881e4faae193b15bb
--- dddctl.c
+++ dddctl.c
@@ -27,7 +27,7 @@
*/
/*
- * $Id: dddctl.c,v 1.50 2019/02/15 19:48:29 pjp Exp $
+ * $Id: dddctl.c,v 1.51 2019/02/15 20:30:11 pjp Exp $
*/
#include "ddd-include.h"
@@ -174,7 +174,6 @@ struct _mycmdtab {
{ NULL, NULL }
};
-
#define KEYTYPE_NONE 0
#define KEYTYPE_KSK 1
#define KEYTYPE_ZSK 2
@@ -6878,7 +6877,7 @@ dig(int argc, char *argv[])
if (format & ZONE_FORMAT)
answers--;
- fprintf(f, ";; XFR size %d records (segments %d, bytes %d)\n",
+ fprintf(f, ";; XFR size %d records (messages %d, bytes %d)\n",
answers, segment, bytes_received);
} else {
fprintf(f, ";; MSG SIZE rcvd: %d\n", bytes_received);
@@ -8424,84 +8423,9 @@ count_db(ddDB *db)
memcpy((char *)rbt, (char *)n->data, n->datalen);
- if ((rrset = find_rr(rbt, DNS_TYPE_DNSKEY)) != NULL) {
+ TAILQ_FOREACH(rrset, &rbt->rrset_head, entries) {
TAILQ_FOREACH(rrp, &rrset->rr_head, entries) {
- count++;
- }
- }
- if ((rrset = find_rr(rbt, DNS_TYPE_A)) != NULL) {
- TAILQ_FOREACH(rrp, &rrset->rr_head, entries) {
- count++;
- }
- }
- if ((rrset = find_rr(rbt, DNS_TYPE_MX)) != NULL) {
- TAILQ_FOREACH(rrp, &rrset->rr_head, entries) {
- count++;
- }
- }
- if ((rrset = find_rr(rbt, DNS_TYPE_NS)) != NULL) {
- TAILQ_FOREACH(rrp, &rrset->rr_head, entries) {
- count++;
- }
- }
- if ((rrset = find_rr(rbt, DNS_TYPE_SOA)) != NULL) {
- TAILQ_FOREACH(rrp, &rrset->rr_head, entries) {
- count++;
- }
- }
- if ((rrset = find_rr(rbt, DNS_TYPE_TXT)) != NULL) {
- TAILQ_FOREACH(rrp, &rrset->rr_head, entries) {
- count++;
- }
- }
- if ((rrset = find_rr(rbt, DNS_TYPE_AAAA)) != NULL) {
- TAILQ_FOREACH(rrp, &rrset->rr_head, entries) {
- count++;
- }
- }
- if ((rrset = find_rr(rbt, DNS_TYPE_NSEC3)) != NULL) {
- TAILQ_FOREACH(rrp, &rrset->rr_head, entries) {
- count++;
- }
- }
- if ((rrset = find_rr(rbt, DNS_TYPE_NSEC3PARAM)) != NULL) {
- TAILQ_FOREACH(rrp, &rrset->rr_head, entries) {
- count++;
- }
- }
- if ((rrset = find_rr(rbt, DNS_TYPE_CNAME)) != NULL) {
- TAILQ_FOREACH(rrp, &rrset->rr_head, entries) {
- count++;
- }
- }
- if ((rrset = find_rr(rbt, DNS_TYPE_PTR)) != NULL) {
- TAILQ_FOREACH(rrp, &rrset->rr_head, entries) {
- count++;
- }
- }
- if ((rrset = find_rr(rbt, DNS_TYPE_NAPTR)) != NULL) {
- TAILQ_FOREACH(rrp, &rrset->rr_head, entries) {
- count++;
- }
- }
- if ((rrset = find_rr(rbt, DNS_TYPE_SRV)) != NULL) {
- TAILQ_FOREACH(rrp, &rrset->rr_head, entries) {
- count++;
- }
- }
- if ((rrset = find_rr(rbt, DNS_TYPE_SSHFP)) != NULL) {
- TAILQ_FOREACH(rrp, &rrset->rr_head, entries) {
- count++;
- }
- }
- if ((rrset = find_rr(rbt, DNS_TYPE_TLSA)) != NULL) {
- TAILQ_FOREACH(rrp, &rrset->rr_head, entries) {
- count++;
- }
- }
- if ((rrset = find_rr(rbt, DNS_TYPE_DS)) != NULL) {
- TAILQ_FOREACH(rrp, &rrset->rr_head, entries) {
- count++;
+ count++;
}
}
free(rbt);
blob - 41ea3517145bae8d4941f1e5b00510c41f106bda
blob + 6f68fbf9e38c0863aada8ab69dc69a3296536798
--- util.c
+++ util.c
@@ -27,7 +27,7 @@
*/
/*
- * $Id: util.c,v 1.18 2019/02/15 19:46:58 pjp Exp $
+ * $Id: util.c,v 1.19 2019/02/15 20:30:11 pjp Exp $
*/
#include "ddd-include.h"
@@ -65,6 +65,7 @@ extern struct rrset * find_rr(struct rbtree *rbt, u_in
extern int add_rr(struct rbtree *rbt, char *name, int len, u_int16_t rrtype, void *rdata);
extern int display_rr(struct rrset *rrset);
+
/* internals */
struct typetable {
char *type;
@@ -92,7 +93,7 @@ struct typetable {
{ NULL, 0}
};
-struct rrtab myrrtab[] = {
+static struct rrtab myrrtab[] = {
{ "a", DNS_TYPE_A, DNS_TYPE_A } ,
{ "aaaa", DNS_TYPE_AAAA, DNS_TYPE_AAAA },
{ "cname", DNS_TYPE_CNAME, DNS_TYPE_CNAME },
@@ -114,8 +115,6 @@ struct rrtab myrrtab[] = {
{ "tlsa", DNS_TYPE_TLSA, DNS_TYPE_TLSA },
{ "txt", DNS_TYPE_TXT, DNS_TYPE_TXT },
};
-
-
/*
* LABEL_COUNT - count the labels and return that number
repomaster@centroid.eu