summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWillem Toorop <willem@NLnetLabs.nl>2013-03-18 15:25:24 +0100
committerWillem Toorop <willem@NLnetLabs.nl>2013-03-18 15:25:24 +0100
commit430329fd80f266bf59d5503a8fd6f79a91b4f468 (patch)
treefe8d4708b4d253c6b7fad9c75353a6d90a01d2a7
parent6c10b09342683f74962666a83f4844aa822b3490 (diff)
downloadldns-430329fd80f266bf59d5503a8fd6f79a91b4f468.tar.gz
- Make lint happy
- Miscellaneous prototype fixes. Thanks Dag-Erling Smørgrav. - README now shows preferred way to configure for examples and drill.
-rw-r--r--Changelog2
-rw-r--r--README36
-rw-r--r--README.svn5
-rw-r--r--dnssec_sign.c2
-rw-r--r--dnssec_verify.c20
-rw-r--r--dnssec_zone.c44
-rw-r--r--examples/ldnsd.c2
-rw-r--r--host2str.c2
-rw-r--r--keys.c4
-rw-r--r--ldns/dnssec_verify.h4
-rw-r--r--ldns/dnssec_zone.h8
-rw-r--r--ldns/keys.h4
-rw-r--r--ldns/packet.h2
-rw-r--r--ldns/rr.h2
-rw-r--r--masterdont/config_file.h2
-rw-r--r--masterdont/zones.h2
-rw-r--r--packet.c4
-rw-r--r--parse.c18
-rw-r--r--pcat/pcat-diff.c6
-rw-r--r--resolver.c2
-rw-r--r--rr.c22
-rw-r--r--tsig.c2
-rw-r--r--util.c37
-rw-r--r--zone.c113
24 files changed, 53 insertions, 292 deletions
diff --git a/Changelog b/Changelog
index 8b7515c5..89e7497e 100644
--- a/Changelog
+++ b/Changelog
@@ -1,4 +1,6 @@
1.6.17
+ * README now shows preferred way to configure for examples and drill.
+ * Miscellaneous prototype fixes. Thanks Dag-Erling Smørgrav.
* Add --disable-dane option to configure and check availability of the
for dane needed X509_check_ca function in openssl.
* Fix ldns_dnssec_zone_new_frm_fp_l to allow the last parsed line of a
diff --git a/README b/README
index 70eb3dc0..0c21e655 100644
--- a/README
+++ b/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/README.svn b/README.svn
index 10f7cb41..cd402d49 100644
--- a/README.svn
+++ b/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/dnssec_sign.c b/dnssec_sign.c
index f2f9d9dd..2e5a7a92 100644
--- a/dnssec_sign.c
+++ b/dnssec_sign.c
@@ -774,7 +774,7 @@ ldns_dnssec_zone_create_nsecs(ldns_dnssec_zone *zone,
/* in dnssec_zone.c */
extern int ldns_dname_compare_v(const void *a, const void *b);
-ldns_status
+static ldns_status
ldns_dnssec_zone_create_nsec3s_mkmap(ldns_dnssec_zone *zone,
ldns_rr_list *new_rrs,
uint8_t algorithm,
diff --git a/dnssec_verify.c b/dnssec_verify.c
index d435eedf..1af6635b 100644
--- a/dnssec_verify.c
+++ b/dnssec_verify.c
@@ -16,7 +16,7 @@
#include <openssl/md5.h>
ldns_dnssec_data_chain *
-ldns_dnssec_data_chain_new()
+ldns_dnssec_data_chain_new(void)
{
ldns_dnssec_data_chain *nc = LDNS_CALLOC(ldns_dnssec_data_chain, 1);
if(!nc) return NULL;
@@ -216,7 +216,7 @@ ldns_dnssec_build_data_chain_other(ldns_resolver *res,
}
}
-ldns_dnssec_data_chain *
+static ldns_dnssec_data_chain *
ldns_dnssec_build_data_chain_nokeyname(ldns_resolver *res,
uint16_t qflags,
ldns_rr *orig_rr,
@@ -439,7 +439,7 @@ ldns_dnssec_build_data_chain(ldns_resolver *res,
}
ldns_dnssec_trust_tree *
-ldns_dnssec_trust_tree_new()
+ldns_dnssec_trust_tree_new(void)
{
ldns_dnssec_trust_tree *new_tree = LDNS_XMALLOC(ldns_dnssec_trust_tree,
1);
@@ -495,7 +495,7 @@ print_tabs(FILE *out, size_t nr, uint8_t *map, size_t treedepth)
}
}
-void
+static void
ldns_dnssec_trust_tree_print_sm_fmt(FILE *out,
const ldns_output_format *fmt,
ldns_dnssec_trust_tree *tree,
@@ -629,18 +629,6 @@ ldns_dnssec_trust_tree_print_sm_fmt(FILE *out,
}
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);
-}
-
-void
ldns_dnssec_trust_tree_print_fmt(FILE *out, const ldns_output_format *fmt,
ldns_dnssec_trust_tree *tree,
size_t tabs,
diff --git a/dnssec_zone.c b/dnssec_zone.c
index ece11e6a..11053b27 100644
--- a/dnssec_zone.c
+++ b/dnssec_zone.c
@@ -7,7 +7,7 @@
#include <ldns/ldns.h>
ldns_dnssec_rrs *
-ldns_dnssec_rrs_new()
+ldns_dnssec_rrs_new(void)
{
ldns_dnssec_rrs *new_rrs;
new_rrs = LDNS_MALLOC(ldns_dnssec_rrs);
@@ -102,7 +102,7 @@ ldns_dnssec_rrs_print(FILE *out, ldns_dnssec_rrs *rrs)
ldns_dnssec_rrsets *
-ldns_dnssec_rrsets_new()
+ldns_dnssec_rrsets_new(void)
{
ldns_dnssec_rrsets *new_rrsets;
new_rrsets = LDNS_MALLOC(ldns_dnssec_rrsets);
@@ -164,7 +164,7 @@ ldns_dnssec_rrsets_set_type(ldns_dnssec_rrsets *rrsets,
return LDNS_STATUS_ERR;
}
-ldns_dnssec_rrsets *
+static ldns_dnssec_rrsets *
ldns_dnssec_rrsets_new_frm_rr(ldns_rr *rr)
{
ldns_dnssec_rrsets *new_rrsets;
@@ -270,7 +270,7 @@ ldns_dnssec_rrsets_add_rr(ldns_dnssec_rrsets *rrsets, ldns_rr *rr)
return result;
}
-void
+static void
ldns_dnssec_rrsets_print_soa_fmt(FILE *out, const ldns_output_format *fmt,
ldns_dnssec_rrsets *rrsets,
bool follow,
@@ -298,16 +298,6 @@ ldns_dnssec_rrsets_print_soa_fmt(FILE *out, const ldns_output_format *fmt,
}
}
-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);
-}
-
void
ldns_dnssec_rrsets_print_fmt(FILE *out, const ldns_output_format *fmt,
@@ -325,7 +315,7 @@ ldns_dnssec_rrsets_print(FILE *out, ldns_dnssec_rrsets *rrsets, bool follow)
}
ldns_dnssec_name *
-ldns_dnssec_name_new()
+ldns_dnssec_name_new(void)
{
ldns_dnssec_name *new_name;
@@ -428,14 +418,6 @@ ldns_dnssec_name_set_name(ldns_dnssec_name *rrset,
}
}
-ldns_rr *
-ldns_dnssec_name_nsec(ldns_dnssec_name *rrset)
-{
- if (rrset) {
- return rrset->nsec;
- }
- return NULL;
-}
void
ldns_dnssec_name_set_nsec(ldns_dnssec_name *rrset, ldns_rr *nsec)
@@ -563,7 +545,7 @@ ldns_dnssec_zone_find_rrset(ldns_dnssec_zone *zone,
}
}
-void
+static void
ldns_dnssec_name_print_soa_fmt(FILE *out, const ldns_output_format *fmt,
ldns_dnssec_name *name,
bool show_soa)
@@ -589,12 +571,6 @@ ldns_dnssec_name_print_soa_fmt(FILE *out, const ldns_output_format *fmt,
}
}
-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);
-}
void
ldns_dnssec_name_print_fmt(FILE *out, const ldns_output_format *fmt,
@@ -611,7 +587,7 @@ ldns_dnssec_name_print(FILE *out, ldns_dnssec_name *name)
ldns_dnssec_zone *
-ldns_dnssec_zone_new()
+ldns_dnssec_zone_new(void)
{
ldns_dnssec_zone *zone = LDNS_MALLOC(ldns_dnssec_zone);
if(!zone) return NULL;
@@ -774,14 +750,14 @@ ldns_dnssec_zone_new_frm_fp(ldns_dnssec_zone** z, FILE* fp, ldns_rdf* origin,
return ldns_dnssec_zone_new_frm_fp_l(z, fp, origin, ttl, c, NULL);
}
-void
+static void
ldns_dnssec_name_node_free(ldns_rbnode_t *node, void *arg) {
(void) arg;
ldns_dnssec_name_free((ldns_dnssec_name *)node->data);
LDNS_FREE(node);
}
-void
+static void
ldns_dnssec_name_node_deep_free(ldns_rbnode_t *node, void *arg) {
(void) arg;
ldns_dnssec_name_deep_free((ldns_dnssec_name *)node->data);
@@ -824,7 +800,7 @@ ldns_dname_compare_v(const void *a, const void *b) {
return ldns_dname_compare((ldns_rdf *)a, (ldns_rdf *)b);
}
-ldns_rbnode_t *
+static ldns_rbnode_t *
ldns_dnssec_zone_find_nsec3_original(ldns_dnssec_zone *zone,
ldns_rr *rr) {
ldns_rbnode_t *current_node = ldns_rbtree_first(zone->names);
diff --git a/examples/ldnsd.c b/examples/ldnsd.c
index efa79199..77c5dd5c 100644
--- a/examples/ldnsd.c
+++ b/examples/ldnsd.c
@@ -89,7 +89,7 @@ get_rrset(const ldns_zone *zone, const ldns_rdf *owner_name, const ldns_rr_type
return rrlist;
}
-void
+int
main(int argc, char **argv)
{
/* arguments */
diff --git a/host2str.c b/host2str.c
index f8a3760b..0c85d331 100644
--- a/host2str.c
+++ b/host2str.c
@@ -1170,7 +1170,7 @@ ldns_rdf2buffer_str(ldns_buffer *buffer, const ldns_rdf *rdf)
return res;
}
-ldns_rdf *
+static ldns_rdf *
ldns_b32_ext2dname(const ldns_rdf *rdf)
{
size_t size;
diff --git a/keys.c b/keys.c
index de7c9461..e16ac915 100644
--- a/keys.c
+++ b/keys.c
@@ -44,7 +44,7 @@ ldns_lookup_table ldns_signing_algorithms[] = {
};
ldns_key_list *
-ldns_key_list_new()
+ldns_key_list_new(void)
{
ldns_key_list *key_list = LDNS_MALLOC(ldns_key_list);
if (!key_list) {
@@ -57,7 +57,7 @@ ldns_key_list_new()
}
ldns_key *
-ldns_key_new()
+ldns_key_new(void)
{
ldns_key *newkey;
diff --git a/ldns/dnssec_verify.h b/ldns/dnssec_verify.h
index b6bdeca5..0c41e8c1 100644
--- a/ldns/dnssec_verify.h
+++ b/ldns/dnssec_verify.h
@@ -32,7 +32,7 @@ struct ldns_dnssec_data_chain_struct
* Creates a new dnssec_chain structure
* \return ldns_dnssec_data_chain *
*/
-ldns_dnssec_data_chain *ldns_dnssec_data_chain_new();
+ldns_dnssec_data_chain *ldns_dnssec_data_chain_new(void);
/**
* Frees a dnssec_data_chain structure
@@ -137,7 +137,7 @@ struct ldns_dnssec_trust_tree_struct
*
* \return ldns_dnssec_trust_tree *
*/
-ldns_dnssec_trust_tree *ldns_dnssec_trust_tree_new();
+ldns_dnssec_trust_tree *ldns_dnssec_trust_tree_new(void);
/**
* Frees the dnssec_trust_tree recursively
diff --git a/ldns/dnssec_zone.h b/ldns/dnssec_zone.h
index 70c81b04..257bfba2 100644
--- a/ldns/dnssec_zone.h
+++ b/ldns/dnssec_zone.h
@@ -100,7 +100,7 @@ typedef struct ldns_struct_dnssec_zone ldns_dnssec_zone;
* Creates a new entry for 1 pointer to an rr and 1 pointer to the next rrs
* \return the allocated data
*/
-ldns_dnssec_rrs *ldns_dnssec_rrs_new();
+ldns_dnssec_rrs *ldns_dnssec_rrs_new(void);
/**
* Frees the list of rrs, but *not* the individual ldns_rr records
@@ -149,7 +149,7 @@ void ldns_dnssec_rrs_print_fmt(FILE *out,
* Creates a new list (entry) of RRsets
* \return the newly allocated structure
*/
-ldns_dnssec_rrsets *ldns_dnssec_rrsets_new();
+ldns_dnssec_rrsets *ldns_dnssec_rrsets_new(void);
/**
* Frees the list of rrsets and their rrs, but *not* the ldns_rr
@@ -224,7 +224,7 @@ void ldns_dnssec_rrsets_print_fmt(FILE *out,
* Create a new data structure for a dnssec name
* \return the allocated structure
*/
-ldns_dnssec_name *ldns_dnssec_name_new();
+ldns_dnssec_name *ldns_dnssec_name_new(void);
/**
* Create a new data structure for a dnssec name for the given RR
@@ -356,7 +356,7 @@ void ldns_dnssec_name_print_fmt(FILE *out,
* Creates a new dnssec_zone structure
* \return the allocated structure
*/
-ldns_dnssec_zone *ldns_dnssec_zone_new();
+ldns_dnssec_zone *ldns_dnssec_zone_new(void);
/**
* Create a new dnssec zone from a file.
diff --git a/ldns/keys.h b/ldns/keys.h
index 3e156233..d3b48738 100644
--- a/ldns/keys.h
+++ b/ldns/keys.h
@@ -166,13 +166,13 @@ typedef struct ldns_struct_key_list ldns_key_list;
* Creates a new empty key list
* \return a new ldns_key_list structure pointer
*/
-ldns_key_list *ldns_key_list_new();
+ldns_key_list *ldns_key_list_new(void);
/**
* Creates a new empty key structure
* \return a new ldns_key * structure
*/
-ldns_key *ldns_key_new();
+ldns_key *ldns_key_new(void);
/**
* Creates a new key based on the algorithm
diff --git a/ldns/packet.h b/ldns/packet.h
index 687a6a25..ed7c3274 100644
--- a/ldns/packet.h
+++ b/ldns/packet.h
@@ -739,7 +739,7 @@ void ldns_pkt_set_edns_data(ldns_pkt *packet, ldns_rdf *data);
* allocates and initializes a ldns_pkt structure.
* \return pointer to the new packet
*/
-ldns_pkt *ldns_pkt_new();
+ldns_pkt *ldns_pkt_new(void);
/**
* frees the packet structure and all data that it contains.
diff --git a/ldns/rr.h b/ldns/rr.h
index e29bba9e..7324c060 100644
--- a/ldns/rr.h
+++ b/ldns/rr.h
@@ -594,7 +594,7 @@ ldns_rr* ldns_rr_list_rr(const ldns_rr_list *rr_list, size_t nr);
* creates a new rr_list structure.
* \return a new rr_list structure
*/
-ldns_rr_list* ldns_rr_list_new();
+ldns_rr_list* ldns_rr_list_new(void);
/**
* frees an rr_list structure.
diff --git a/masterdont/config_file.h b/masterdont/config_file.h
index 6a8190cb..6578b388 100644
--- a/masterdont/config_file.h
+++ b/masterdont/config_file.h
@@ -46,7 +46,7 @@ struct config_read {
};
/** create structure with defaults */
-struct config_file* config_file_create();
+struct config_file* config_file_create(void);
/** delete structure */
void config_file_delete(struct config_file* cfg);
diff --git a/masterdont/zones.h b/masterdont/zones.h
index 89c78d31..f1808468 100644
--- a/masterdont/zones.h
+++ b/masterdont/zones.h
@@ -36,7 +36,7 @@ struct zones_t {
/**
* create new empty zones struct
*/
-struct zones_t* zones_create();
+struct zones_t* zones_create(void);
/**
* Read all the zone entry storage
diff --git a/packet.c b/packet.c
index b44c0add..d57e9e27 100644
--- a/packet.c
+++ b/packet.c
@@ -379,7 +379,7 @@ ldns_pkt_rr(ldns_pkt *pkt, ldns_pkt_section sec, ldns_rr *rr)
return result;
}
-uint16_t
+static uint16_t
ldns_pkt_section_count(const ldns_pkt *packet, ldns_pkt_section s)
{
switch(s) {
@@ -729,7 +729,7 @@ ldns_pkt_edns(const ldns_pkt *pkt) {
/* Create/destroy/convert functions
*/
ldns_pkt *
-ldns_pkt_new()
+ldns_pkt_new(void)
{
ldns_pkt *packet;
packet = LDNS_MALLOC(ldns_pkt);
diff --git a/parse.c b/parse.c
index ea5ffad0..8849effa 100644
--- a/parse.c
+++ b/parse.c
@@ -340,18 +340,6 @@ tokenread:
return (ssize_t)i;
}
-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;
- }
- }
-}
void
ldns_bskipcs(ldns_buffer *buffer, const char *s)
@@ -377,12 +365,6 @@ ldns_bskipcs(ldns_buffer *buffer, const char *s)
}
void
-ldns_fskipc(ATTR_UNUSED(FILE *fp), ATTR_UNUSED(char c))
-{
-}
-
-
-void
ldns_fskipcs(FILE *fp, const char *s)
{
ldns_fskipcs_l(fp, s, NULL);
diff --git a/pcat/pcat-diff.c b/pcat/pcat-diff.c
index 94367e5e..3f1e239b 100644
--- a/pcat/pcat-diff.c
+++ b/pcat/pcat-diff.c
@@ -435,14 +435,14 @@ int file_filter(const struct dirent *f)
#define MAX_DESCR_LEN 100
bool
-compare_query()
+compare_query(void)
{
bool result = true;
return result;
}
bool
-compare_packets()
+compare_packets(void)
{
bool result = true;
return result;
@@ -1277,7 +1277,7 @@ read_match_files(char *directory)
}
void
-free_match_files()
+free_match_files(void)
{
size_t i;
for (i = 0; i < match_file_count; i++) {
diff --git a/resolver.c b/resolver.c
index 27aa54e2..b564e5db 100644
--- a/resolver.c
+++ b/resolver.c
@@ -436,7 +436,7 @@ ldns_resolver_set_fail(ldns_resolver *r, bool f)
r->_fail =f;
}
-void
+static void
ldns_resolver_set_searchlist_count(ldns_resolver *r, size_t c)
{
r->_searchlist_count = c;
diff --git a/rr.c b/rr.c
index a3f3ce87..33d1d53d 100644
--- a/rr.c
+++ b/rr.c
@@ -936,7 +936,7 @@ ldns_rr_list_rr(const ldns_rr_list *rr_list, size_t nr)
}
ldns_rr_list *
-ldns_rr_list_new()
+ldns_rr_list_new(void)
{
ldns_rr_list *rr_list = LDNS_MALLOC(ldns_rr_list);
if(!rr_list) return NULL;
@@ -1395,25 +1395,7 @@ ldns_rr_list_clone(const ldns_rr_list *rrlist)
}
-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);
-}
-
-int
+static int
qsort_schwartz_rr_compare(const void *a, const void *b)
{
int result = 0;
diff --git a/tsig.c b/tsig.c
index 41693463..afc25902 100644
--- a/tsig.c
+++ b/tsig.c
@@ -51,7 +51,7 @@ ldns_tsig_keydata_clone(ldns_tsig_credentials *tc)
/*
* Makes an exact copy of the wire, but with the tsig rr removed
*/
-uint8_t *
+static uint8_t *
ldns_tsig_prepare_pkt_wire(uint8_t *wire, size_t wire_len, size_t *result_len)
{
uint8_t *wire2 = NULL;
diff --git a/util.c b/util.c
index f5462c4b..0439fbe2 100644
--- a/util.c
+++ b/util.c
@@ -25,43 +25,6 @@
#include <openssl/rand.h>
#endif
-/* put this here tmp. for debugging */
-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));
-}
-
-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]);
- }
-}
-
-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");
-}
-
ldns_lookup_table *
ldns_lookup_by_name(ldns_lookup_table *table, const char *name)
{
diff --git a/zone.c b/zone.c
index 0616a141..d97a81ec 100644
--- a/zone.c
+++ b/zone.c
@@ -56,103 +56,6 @@ ldns_zone_push_rr(ldns_zone *z, ldns_rr *rr)
return ldns_rr_list_push_rr( ldns_zone_rrs(z), rr);
}
-/* 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
- */
-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;
-}
/*
* Get the list of glue records in a zone
@@ -399,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)
{