From fd385454b416abcc984542672e281288faf622ff Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Thu, 11 Jun 2015 12:04:59 +0200 Subject: [PATCH] rm a few more leftover ldns references --- src/rr-iter.h | 2 +- src/util-internal.c | 31 +------------------------------ src/util-internal.h | 11 ----------- 3 files changed, 2 insertions(+), 42 deletions(-) diff --git a/src/rr-iter.h b/src/rr-iter.h index 13a64465..cfc9faf1 100644 --- a/src/rr-iter.h +++ b/src/rr-iter.h @@ -70,7 +70,7 @@ uint8_t *priv_getdns_owner_if_or_as_decompressed( static inline gldns_pkt_section priv_getdns_rr_iter_section(priv_getdns_rr_iter *i) { - return i->n < GLDNS_QDCOUNT(i->pkt) ? LDNS_SECTION_QUESTION + return i->n < GLDNS_QDCOUNT(i->pkt) ? GLDNS_SECTION_QUESTION : i->n < GLDNS_QDCOUNT(i->pkt) + GLDNS_ANCOUNT(i->pkt) ? GLDNS_SECTION_ANSWER : i->n < GLDNS_QDCOUNT(i->pkt) diff --git a/src/util-internal.c b/src/util-internal.c index 9319d52f..9a6f35c7 100644 --- a/src/util-internal.c +++ b/src/util-internal.c @@ -178,35 +178,6 @@ sockaddr_to_dict(struct getdns_context *context, struct sockaddr_storage *addres return GETDNS_RETURN_GOOD; } -/* helper to convert an rr_list to getdns_list. - returns a list of objects where each object - is a result from create_dict_from_rr */ -struct getdns_list * -create_list_from_rr_list(struct getdns_context *context, ldns_rr_list * rr_list) -{ - size_t i = 0; - size_t idx = 0; - int r = GETDNS_RETURN_GOOD; - struct getdns_list *result = getdns_list_create_with_context(context); - struct getdns_dict *rrdict; - for (i = 0; i < ldns_rr_list_rr_count(rr_list) && r == GETDNS_RETURN_GOOD; - ++i) { - ldns_rr *rr = ldns_rr_list_rr(rr_list, i); - r = priv_getdns_create_dict_from_rr(context, rr, &rrdict); - if (r != GETDNS_RETURN_GOOD) - break; /* Could not create, do not destroy */ - r = getdns_list_add_item(result, &idx); - if (r == GETDNS_RETURN_GOOD) - r = getdns_list_set_dict(result, idx, rrdict); - getdns_dict_destroy(rrdict); - } - if (r != GETDNS_RETURN_GOOD) { - getdns_list_destroy(result); - result = NULL; - } - return result; -} - getdns_dict * priv_getdns_rr_iter2rr_dict(getdns_context *context, priv_getdns_rr_iter *i) { @@ -768,7 +739,7 @@ create_getdns_response(getdns_dns_req *completed_request) ninsecure++; if (dnssec_return_status && netreq->bogus) nbogus++; - else if (LDNS_RCODE_NOERROR == + else if (GLDNS_RCODE_NOERROR == GLDNS_RCODE_WIRE(netreq->response)) nanswers++; diff --git a/src/util-internal.h b/src/util-internal.h index 4bc16731..c58abd31 100644 --- a/src/util-internal.h +++ b/src/util-internal.h @@ -38,7 +38,6 @@ #ifndef UTIL_INTERNAL_H #define UTIL_INTERNAL_H -#include #include "context.h" #include "rr-iter.h" @@ -143,16 +142,6 @@ getdns_return_t validate_dname(const char* dname); */ getdns_return_t validate_extensions(struct getdns_dict * extensions); -/** - * helper to convert an rr_list to getdns_list - * @param context initialized getdns_context - * @param rr_list ldns rr list to be converted - * @return a list of objects where each object is a result from create_dict_from_rr - */ -struct getdns_list * -create_list_from_rr_list(struct getdns_context *context, ldns_rr_list * rr_list); - - #define DEBUG_ON(...) do { \ struct timeval tv; \ struct tm tm; \