diff options
author | des <des@FreeBSD.org> | 2013-04-09 13:14:39 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2013-04-09 13:14:39 +0000 |
commit | 582e4690756c08417aaef6ac08656325e85c7e33 (patch) | |
tree | e2fef39df96c6eb7ccdcbf6fb3c6314d797e793f /contrib/ldns | |
parent | 320677190635e38d0c6d35740b6e7584bbd75df5 (diff) | |
download | FreeBSD-src-582e4690756c08417aaef6ac08656325e85c7e33.zip FreeBSD-src-582e4690756c08417aaef6ac08656325e85c7e33.tar.gz |
Revert local changes and pull in r3828 from upstream.
Diffstat (limited to 'contrib/ldns')
-rw-r--r-- | contrib/ldns/README | 36 | ||||
-rw-r--r-- | contrib/ldns/README.svn | 5 | ||||
-rw-r--r-- | contrib/ldns/dnssec_verify.c | 14 | ||||
-rw-r--r-- | contrib/ldns/dnssec_zone.c | 31 | ||||
-rw-r--r-- | contrib/ldns/parse.c | 21 | ||||
-rw-r--r-- | contrib/ldns/rr.c | 19 | ||||
-rw-r--r-- | contrib/ldns/util.c | 40 | ||||
-rw-r--r-- | contrib/ldns/zone.c | 115 |
8 files changed, 12 insertions, 269 deletions
diff --git a/contrib/ldns/README b/contrib/ldns/README index 70eb3dc..0c21e65 100644 --- a/contrib/ldns/README +++ b/contrib/ldns/README @@ -22,6 +22,8 @@ compile on other systems like Solaris and Mac OS X. REQUIREMENTS - OpenSSL (Optional, but needed for features like DNSSEC) + - OpenSSL >= 0.9.7f for DANE support + - OpenSSL >= 1.0.0 for ECDSA and GOST support - libpcap (Optional, but needed for examples/ldns-dpa) - (GNU) libtool (in OSX, that's glibtool, not libtool) - GNU make @@ -29,32 +31,10 @@ REQUIREMENTS INSTALLATION 1. Unpack the tarball 2. cd ldns-<VERSION> -3. ./configure -4. gmake (it needs gnu make to compile, on systems where GNU make is the - default you can just use 'make') -5. sudo gmake install -6. Optional. (cd examples; ./configure; gmake), make example programs included. -7. Optional. (cd drill; ./configure; gmake; gmake install), to build drill. - -You can configure and compile it in a separate build directory. - -* Examples -There are some examples and dns related tools in the examples/ directory. -These can be built with: -1. cd examples/ -2. ./configure [--with-ldns=<path to ldns installation or build>] -3. gmake - -* Drill -Drill can be built with: -1. cd drill/ -2. ./configure [--with-ldns=<path to ldns installation or build>] -3. gmake - -Note that you need to set LD_LIBRARY_PATH if you want to run the binaries -and you have not installed the library to a system directory. You can use -the make target all-static for the examples to run them if you don't want to -install the library. +3. ./configure --with-examples --with-drill + (optionally compile python bindings too with: --with-pyldns) +4. make +5. make install * Building from subversion repository @@ -84,6 +64,10 @@ We have received patches from the following people, thanks! o Paul Wouters o Simon Vallet o Ondřej Surý + o Karel Slany + o Havard Eidnes + o Leo Baltus + o Dag-Erling Smørgrav INFORMATION FOR SPECIFIC OPERATING SYSTEMS diff --git a/contrib/ldns/README.svn b/contrib/ldns/README.svn index 10f7cb4..cd402d4 100644 --- a/contrib/ldns/README.svn +++ b/contrib/ldns/README.svn @@ -10,17 +10,14 @@ # the correct versions may need to be set. On those # systems, the 'autoreconf' line should be changed to: # AUTOMAKE=automake-1.10 ACLOCAL=aclocal-1.10 autoreconf -# (and these systems probably need gmake instead of make) # older versions of libtoolize do not support --install # so you might need to remove that (with newer versions # it is needed) libtoolize -c --install autoreconf --install -./configure +./configure --with-examples --with-drill # --with-pyldns make make doc # needs doxygen for the html pages -(cd examples && autoreconf && ./configure && make) -(cd drill && autoreconf && ./configure && make) (cd pcat && autoreconf && ./configure && make) (cd examples/nsd-test && autoreconf && ./configure && make) diff --git a/contrib/ldns/dnssec_verify.c b/contrib/ldns/dnssec_verify.c index 02d136a..1af6635 100644 --- a/contrib/ldns/dnssec_verify.c +++ b/contrib/ldns/dnssec_verify.c @@ -628,20 +628,6 @@ ldns_dnssec_trust_tree_print_sm_fmt(FILE *out, } } -#if 0 -static void -ldns_dnssec_trust_tree_print_sm(FILE *out, - ldns_dnssec_trust_tree *tree, - size_t tabs, - bool extended, - uint8_t *sibmap, - size_t treedepth) -{ - ldns_dnssec_trust_tree_print_sm_fmt(out, ldns_output_format_default, - tree, tabs, extended, sibmap, treedepth); -} -#endif - void ldns_dnssec_trust_tree_print_fmt(FILE *out, const ldns_output_format *fmt, ldns_dnssec_trust_tree *tree, diff --git a/contrib/ldns/dnssec_zone.c b/contrib/ldns/dnssec_zone.c index c710382..57b62c6 100644 --- a/contrib/ldns/dnssec_zone.c +++ b/contrib/ldns/dnssec_zone.c @@ -298,17 +298,6 @@ ldns_dnssec_rrsets_print_soa_fmt(FILE *out, const ldns_output_format *fmt, } } -#if 0 -static void -ldns_dnssec_rrsets_print_soa(FILE *out, - ldns_dnssec_rrsets *rrsets, - bool follow, - bool show_soa) -{ - ldns_dnssec_rrsets_print_soa_fmt(out, ldns_output_format_default, - rrsets, follow, show_soa); -} -#endif void ldns_dnssec_rrsets_print_fmt(FILE *out, const ldns_output_format *fmt, @@ -429,16 +418,6 @@ ldns_dnssec_name_set_name(ldns_dnssec_name *rrset, } } -#if 0 -static ldns_rr * -ldns_dnssec_name_nsec(ldns_dnssec_name *rrset) -{ - if (rrset) { - return rrset->nsec; - } - return NULL; -} -#endif void ldns_dnssec_name_set_nsec(ldns_dnssec_name *rrset, ldns_rr *nsec) @@ -592,14 +571,6 @@ ldns_dnssec_name_print_soa_fmt(FILE *out, const ldns_output_format *fmt, } } -#if 0 -static void -ldns_dnssec_name_print_soa(FILE *out, ldns_dnssec_name *name, bool show_soa) -{ - ldns_dnssec_name_print_soa_fmt(out, ldns_output_format_default, - name, show_soa); -} -#endif void ldns_dnssec_name_print_fmt(FILE *out, const ldns_output_format *fmt, @@ -827,7 +798,7 @@ ldns_dnssec_zone_deep_free(ldns_dnssec_zone *zone) } /* use for dname comparison in tree */ -static int +int ldns_dname_compare_v(const void *a, const void *b) { return ldns_dname_compare((ldns_rdf *)a, (ldns_rdf *)b); } diff --git a/contrib/ldns/parse.c b/contrib/ldns/parse.c index 4a3a4a7..8849eff 100644 --- a/contrib/ldns/parse.c +++ b/contrib/ldns/parse.c @@ -340,20 +340,6 @@ tokenread: return (ssize_t)i; } -#if 0 -static void -ldns_bskipc(ldns_buffer *buffer, char c) -{ - while (c == (char) ldns_buffer_read_u8_at(buffer, ldns_buffer_position(buffer))) { - if (ldns_buffer_available_at(buffer, - buffer->_position + sizeof(char), sizeof(char))) { - buffer->_position += sizeof(char); - } else { - return; - } - } -} -#endif void ldns_bskipcs(ldns_buffer *buffer, const char *s) @@ -378,13 +364,6 @@ ldns_bskipcs(ldns_buffer *buffer, const char *s) } } -#if 0 -static void -ldns_fskipc(ATTR_UNUSED(FILE *fp), ATTR_UNUSED(char c)) -{ -} -#endif - void ldns_fskipcs(FILE *fp, const char *s) { diff --git a/contrib/ldns/rr.c b/contrib/ldns/rr.c index 484fa30..c8b2ef9 100644 --- a/contrib/ldns/rr.c +++ b/contrib/ldns/rr.c @@ -1394,25 +1394,6 @@ ldns_rr_list_clone(const ldns_rr_list *rrlist) return new_list; } -#if 0 -static int -qsort_rr_compare(const void *a, const void *b) -{ - const ldns_rr *rr1 = * (const ldns_rr **) a; - const ldns_rr *rr2 = * (const ldns_rr **) b; - - if (rr1 == NULL && rr2 == NULL) { - return 0; - } - if (rr1 == NULL) { - return -1; - } - if (rr2 == NULL) { - return 1; - } - return ldns_rr_compare(rr1, rr2); -} -#endif static int qsort_schwartz_rr_compare(const void *a, const void *b) diff --git a/contrib/ldns/util.c b/contrib/ldns/util.c index fc8df86..0439fbe 100644 --- a/contrib/ldns/util.c +++ b/contrib/ldns/util.c @@ -25,46 +25,6 @@ #include <openssl/rand.h> #endif -#if 0 -/* put this here tmp. for debugging */ -static void -xprintf_rdf(ldns_rdf *rd) -{ - /* assume printable string */ - fprintf(stderr, "size\t:%u\n", (unsigned int)ldns_rdf_size(rd)); - fprintf(stderr, "type\t:%u\n", (unsigned int)ldns_rdf_get_type(rd)); - fprintf(stderr, "data\t:[%.*s]\n", (int)ldns_rdf_size(rd), - (char*)ldns_rdf_data(rd)); -} - -static void -xprintf_rr(ldns_rr *rr) -{ - /* assume printable string */ - uint16_t count, i; - - count = ldns_rr_rd_count(rr); - - for(i = 0; i < count; i++) { - fprintf(stderr, "print rd %u\n", (unsigned int) i); - xprintf_rdf(rr->_rdata_fields[i]); - } -} - -static void -xprintf_hex(uint8_t *data, size_t len) -{ - size_t i; - for (i = 0; i < len; i++) { - if (i > 0 && i % 20 == 0) { - printf("\t; %u - %u\n", (unsigned int) i - 19, (unsigned int) i); - } - printf("%02x ", (unsigned int) data[i]); - } - printf("\n"); -} -#endif - ldns_lookup_table * ldns_lookup_by_name(ldns_lookup_table *table, const char *name) { diff --git a/contrib/ldns/zone.c b/contrib/ldns/zone.c index 6dd4df6..d97a81e 100644 --- a/contrib/ldns/zone.c +++ b/contrib/ldns/zone.c @@ -56,105 +56,6 @@ ldns_zone_push_rr(ldns_zone *z, ldns_rr *rr) return ldns_rr_list_push_rr( ldns_zone_rrs(z), rr); } -#if 0 -/* return a clone of the given rr list, without the glue records - * rr list should be the complete zone - * if present, stripped records are added to the list *glue_records - */ -static ldns_rr_list * -ldns_zone_strip_glue_rrs(const ldns_rdf *zone_name, const ldns_rr_list *rrs, ldns_rr_list *glue_rrs) -{ - ldns_rr_list *new_list; - - /* when do we find glue? It means we find an IP address - * (AAAA/A) for a nameserver listed in the zone - * - * Alg used here: - * first find all the zonecuts (NS records) - * find all the AAAA or A records (can be done it the - * above loop). - * - * Check if the aaaa/a list are subdomains under the - * NS domains. - * If yes -> glue, if no -> not glue - */ - - ldns_rr_list *zone_cuts; - ldns_rr_list *addr; - ldns_rr *r, *ns, *a; - ldns_rdf *dname_a, *ns_owner; - uint16_t i,j; - - new_list = NULL; - zone_cuts = NULL; - addr = NULL; - - new_list = ldns_rr_list_new(); - if (!new_list) goto memory_error; - zone_cuts = ldns_rr_list_new(); - if (!zone_cuts) goto memory_error; - addr = ldns_rr_list_new(); - if (!addr) goto memory_error; - - for(i = 0; i < ldns_rr_list_rr_count(rrs); i++) { - r = ldns_rr_list_rr(rrs, i); - if (ldns_rr_get_type(r) == LDNS_RR_TYPE_A || - ldns_rr_get_type(r) == LDNS_RR_TYPE_AAAA) { - /* possibly glue */ - if (!ldns_rr_list_push_rr(addr, r)) goto memory_error; - continue; - } - if (ldns_rr_get_type(r) == LDNS_RR_TYPE_NS) { - /* multiple zones will end up here - - * for now; not a problem - */ - /* don't add NS records for the current zone itself */ - if (ldns_rdf_compare(ldns_rr_owner(r), - zone_name) != 0) { - if (!ldns_rr_list_push_rr(zone_cuts, r)) goto memory_error; - } - continue; - } - } - - /* will sorting make it quicker ?? */ - for(i = 0; i < ldns_rr_list_rr_count(zone_cuts); i++) { - ns = ldns_rr_list_rr(zone_cuts, i); - ns_owner = ldns_rr_owner(ns); - for(j = 0; j < ldns_rr_list_rr_count(addr); j++) { - a = ldns_rr_list_rr(addr, j); - dname_a = ldns_rr_owner(a); - - if (ldns_dname_is_subdomain(dname_a, ns_owner)) { - /* GLUE! */ - if (glue_rrs) { - if (!ldns_rr_list_push_rr(glue_rrs, a)) goto memory_error; - } - break; - } else { - if (!ldns_rr_list_push_rr(new_list, a)) goto memory_error; - } - } - } - - ldns_rr_list_free(addr); - ldns_rr_list_free(zone_cuts); - - return new_list; - -memory_error: - if (new_list) { - ldns_rr_list_free(new_list); - } - if (zone_cuts) { - ldns_rr_list_free(zone_cuts); - } - if (addr) { - ldns_rr_list_free(addr); - } - return NULL; -} -#endif /* * Get the list of glue records in a zone @@ -401,22 +302,6 @@ ldns_zone_sort(ldns_zone *zone) ldns_rr_list_sort(zrr); } -#if 0 -/** - * ixfr function. Work on a ldns_zone and remove and add - * the rrs from the rrlist - * \param[in] z the zone to work on - * \param[in] del rr_list to remove from the zone - * \param[in] add rr_list to add to the zone - * \return Tja, wat zouden we eens returnen TODO - */ -void -ldns_zone_ixfr_del_add(ldns_zone *z, ldns_rr_list *del, ldns_rr_list *add) -{ - -} -#endif - void ldns_zone_free(ldns_zone *zone) { |