]> git.ipfire.org Git - thirdparty/ldns.git/commitdiff
- Make lint happy
authorWillem Toorop <willem@NLnetLabs.nl>
Mon, 18 Mar 2013 14:25:24 +0000 (14:25 +0000)
committerWillem Toorop <willem@NLnetLabs.nl>
Mon, 18 Mar 2013 14:25:24 +0000 (14:25 +0000)
- Miscellaneous prototype fixes. Thanks Dag-Erling Smørgrav.
- README now shows preferred way to configure for examples and drill.

24 files changed:
Changelog
README
README.svn
dnssec_sign.c
dnssec_verify.c
dnssec_zone.c
examples/ldnsd.c
host2str.c
keys.c
ldns/dnssec_verify.h
ldns/dnssec_zone.h
ldns/keys.h
ldns/packet.h
ldns/rr.h
masterdont/config_file.h
masterdont/zones.h
packet.c
parse.c
pcat/pcat-diff.c
resolver.c
rr.c
tsig.c
util.c
zone.c

index 8b7515c58a8d17fce916e308b98042c5f074a893..89e7497ea1e9cf0c013dc383d3be637cbc7e03b2 100644 (file)
--- 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 70eb3dc0f892ac9a38d55dc70169b05b5e38f3b0..0c21e6551cdefb0161ba74b38132851515ef4d9c 100644 (file)
--- 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
index 10f7cb4163d1acf2ddd06adcbf2daa9769594af4..cd402d49c1b0a8e846ae0ecc0e6dedfacdee0307 100644 (file)
 # 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)
index f2f9d9dda87d8bd860b6b9a4eb3e509bab17ae16..2e5a7a92e15c1db11dfa47bb128b91c5bf4f9b8d 100644 (file)
@@ -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,
index d435eedf6afd168ba257b52824504f29efac2be3..1af6635b9d22f051864725d20dd73c02e85acc65 100644 (file)
@@ -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,
@@ -628,18 +628,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,
index ece11e6ac3a7c45050eba341117d492c1e44e0ae..11053b271eed7af87392d9b41d3f37518b3f3c29 100644 (file)
@@ -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);
index efa79199bf46bb0f9a7bf68924bea94872c411be..77c5dd5c628dc16e619b236f7c77dd35b527be13 100644 (file)
@@ -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 */
index f8a3760be410b59b481dd57b5ff0f66a4d1d4f06..0c85d331b560dafe2e61194a049f0dc7f2bfab47 100644 (file)
@@ -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 de7c94610d862253d2c02ed2bbdce6ae843331e8..e16ac9153192335c0f955026dc623352cee9c3c3 100644 (file)
--- 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;
 
index b6bdeca539bced5791f31fed7aa79344d8a34ffd..0c41e8c11b62330a0540a9f438f6ee738aa9c486 100644 (file)
@@ -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
index 70c81b047931be8c545ec01f425c0ea5908df779..257bfba23cd9081ee88f953e3b041436399941b9 100644 (file)
@@ -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.
index 3e156233ba24cdc433bec630db930f60b7aa1014..d3b487386fc1a5aea042b94a06a71f8d7372540e 100644 (file)
@@ -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
index 687a6a259579be0051b84891d23ad745e42e0a1a..ed7c32746363b725e4a26ca73563c368db237c05 100644 (file)
@@ -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.
index e29bba9e6de43f0307f331d555a744f7227e0dc9..7324c060cf88fcc90f6847c07903c5c0d2193a3a 100644 (file)
--- 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.
index 6a8190cbcb49f9a8c50743a5a221fa11d05c9f26..6578b3883ccc7dfd7a54e4236263fbb839b2158a 100644 (file)
@@ -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);
index 89c78d31ddc1ba133be1afd33e8ba1582a9a0cd5..f18084688bc23fe60f5fa52c787a84668482b717 100644 (file)
@@ -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
index b44c0add6450293a2d89c91ad487a2c18a0a69eb..d57e9e275ed22f68e96b7901b7cdb21e2057110f 100644 (file)
--- 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 ea5ffad026fdc73cfe208cb5c98998b87690b86c..8849effad6ffaad712583cb7b15cd866acd94557 100644 (file)
--- 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)
@@ -376,12 +364,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)
 {
index 94367e5e87dbc33679b4ed0104efb05c8f3c86b2..3f1e239b4f1e74aece9c15d795d923f1b5e2af7d 100644 (file)
@@ -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++) {
index 27aa54e26470434d0de596f8b088b482b6a8a3c6..b564e5db694d765b8847b47b3ec52c3f13ebf9aa 100644 (file)
@@ -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 a3f3ce8723494a7690f02c603ee6115296cd1835..33d1d53d8a86315386a7148e0324a84413e99816 100644 (file)
--- 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 41693463df3a1eca1dfe0f4c0a0268333eb5b34a..afc2590231f123e82f76d7579d0a9724a77f99f7 100644 (file)
--- 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 f5462c4b08f644ed4ad9b24296b289dbe21dbbf8..0439fbe25b3ad7389e1e75f68fc6c3ef8d4196a7 100644 (file)
--- a/util.c
+++ b/util.c
 #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 0616a141b555ce053e81db58ed45aea4a146d1e1..d97a81ec3a4d0a42d878b022b6ce34da2e12503b 100644 (file)
--- 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) 
 {