summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.in6
-rw-r--r--dnssec.c40
-rw-r--r--dnssec_zone.c4
-rw-r--r--drill/drill_util.c2
-rw-r--r--examples/ldns-chaos.c6
-rw-r--r--examples/ldns-compare-zones.c2
-rw-r--r--examples/ldns-dpa.c164
-rw-r--r--examples/ldns-key2ds.c4
-rw-r--r--examples/ldns-keyfetcher.c4
-rw-r--r--examples/ldns-keygen.c4
-rw-r--r--examples/ldns-mx.c2
-rw-r--r--examples/ldns-nsec3-hash.c2
-rw-r--r--examples/ldns-revoke.c2
-rw-r--r--examples/ldns-rrsig.c2
-rw-r--r--examples/ldns-signzone.c20
-rw-r--r--examples/ldns-update.c9
-rw-r--r--examples/ldns-verify-zone.c24
-rw-r--r--examples/ldns-walk.c2
-rw-r--r--examples/ldns-zcat.c2
-rw-r--r--examples/ldns-zsplit.c6
20 files changed, 121 insertions, 186 deletions
diff --git a/Makefile.in b/Makefile.in
index 672333a9..dd9c1280 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -148,7 +148,7 @@ install-manpages: manpages
uninstall-manpages:
for i in `cat doc/ldns_manpages`; do \
rm -f $(DESTDIR)$(mandir)/man3/$$i.3 ; done
- rmdir -p $(DESTDIR)$(mandir)/man3 || echo "never mind"
+ rmdir -p $(DESTDIR)$(mandir)/man3 || echo "ok, dir already gone"
install-h: lib
$(INSTALL) -m 755 -d $(DESTDIR)$(includedir)/ldns
@@ -160,7 +160,7 @@ install-h: lib
uninstall-h:
for i in $(LIBDNS_HEADERS); do \
rm -f $(DESTDIR)$(includedir)/$$i; done
- [ ! -d $(DESTDIR)$(includedir)/ldns ] || rmdir -p $(DESTDIR)$(includedir)/ldns || echo "never mind"
+ [ ! -d $(DESTDIR)$(includedir)/ldns ] || rmdir -p $(DESTDI)$(includedir)/ldns || echo "ok, dir already gone"
exit 0
install-lib: lib
@@ -170,7 +170,7 @@ install-lib: lib
uninstall-lib:
$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/libldns.la
- rmdir -p $(DESTDIR)$(libdir) || echo "never mind"
+ rmdir -p $(DESTDIR)$(libdir) || echo "ok, dir already gone"
clean:
rm -f *.o *.d *.lo
diff --git a/dnssec.c b/dnssec.c
index 53b13f29..c7f50489 100644
--- a/dnssec.c
+++ b/dnssec.c
@@ -643,6 +643,20 @@ ldns_dnssec_rrsets_contains_type(ldns_dnssec_rrsets *rrsets,
return 0;
}
+/* returns true if the current dnssec_rrset from the given list of rrsets
+ * is glue */
+static int
+is_glue(ldns_dnssec_rrsets *cur_rrsets, ldns_dnssec_rrsets *orig_rrsets)
+{
+ /* only glue if a or aaaa if there are no ns, unless there is soa */
+ return (cur_rrsets->type == LDNS_RR_TYPE_A ||
+ cur_rrsets->type == LDNS_RR_TYPE_AAAA) &&
+ (ldns_dnssec_rrsets_contains_type(orig_rrsets,
+ LDNS_RR_TYPE_NS) &&
+ !ldns_dnssec_rrsets_contains_type(orig_rrsets,
+ LDNS_RR_TYPE_SOA));
+}
+
ldns_rr *
ldns_dnssec_create_nsec(ldns_dnssec_name *from,
ldns_dnssec_name *to,
@@ -665,17 +679,9 @@ ldns_dnssec_create_nsec(ldns_dnssec_name *from,
cur_rrsets = from->rrsets;
while (cur_rrsets) {
- /* only add a and aaaa if there are no ns */
- if (cur_rrsets->type == LDNS_RR_TYPE_A ||
- cur_rrsets->type == LDNS_RR_TYPE_AAAA) {
- if (ldns_dnssec_rrsets_contains_type(from->rrsets,
- LDNS_RR_TYPE_NS) &&
- !ldns_dnssec_rrsets_contains_type(from->rrsets,
- LDNS_RR_TYPE_SOA)
- ) {
- cur_rrsets = cur_rrsets->next;
+ if (is_glue(cur_rrsets, from->rrsets)) {
+ cur_rrsets = cur_rrsets->next;
continue;
- }
}
types[type_count] = cur_rrsets->type;
type_count++;
@@ -732,17 +738,9 @@ ldns_dnssec_create_nsec3(ldns_dnssec_name *from,
cur_rrsets = from->rrsets;
while (cur_rrsets) {
- /* only add a and aaaa if there are no ns,
- * or if the name is the zone apex */
- if ((cur_rrsets->type == LDNS_RR_TYPE_A ||
- cur_rrsets->type == LDNS_RR_TYPE_AAAA) &&
- ldns_dname_compare(zone_name, from->name) != 0
- ) {
- if (ldns_dnssec_rrsets_contains_type(from->rrsets,
- LDNS_RR_TYPE_NS)) {
- cur_rrsets = cur_rrsets->next;
- continue;
- }
+ if (is_glue(cur_rrsets, from->rrsets)) {
+ cur_rrsets = cur_rrsets->next;
+ continue;
}
types[type_count] = cur_rrsets->type;
type_count++;
diff --git a/dnssec_zone.c b/dnssec_zone.c
index 5853b6f6..bb283625 100644
--- a/dnssec_zone.c
+++ b/dnssec_zone.c
@@ -614,7 +614,7 @@ ldns_dname_compare_v(const void *a, const void *b) {
#ifdef HAVE_SSL
ldns_rbnode_t *
ldns_dnssec_zone_find_nsec3_original(ldns_dnssec_zone *zone,
- ldns_rr *rr) {
+ ldns_rr *rr) {
ldns_rbnode_t *current_node = ldns_rbtree_first(zone->names);
ldns_dnssec_name *current_name;
ldns_rdf *hashed_name;
@@ -623,7 +623,6 @@ ldns_dnssec_zone_find_nsec3_original(ldns_dnssec_zone *zone,
while (current_node != LDNS_RBTREE_NULL) {
current_name = (ldns_dnssec_name *) current_node->data;
-#ifdef HAVE_SSL
if (!current_name->hashed_name) {
current_name->hashed_name =
ldns_nsec3_hash_name_frm_nsec3(rr, current_name->name);
@@ -634,7 +633,6 @@ ldns_dnssec_zone_find_nsec3_original(ldns_dnssec_zone *zone,
ldns_rdf_deep_free(hashed_name);
return current_node;
}
-#endif /* HAVE_SSL */
current_node = ldns_rbtree_next(current_node);
}
ldns_rdf_deep_free(hashed_name);
diff --git a/drill/drill_util.c b/drill/drill_util.c
index 7407f0e4..f75b416a 100644
--- a/drill/drill_util.c
+++ b/drill/drill_util.c
@@ -13,7 +13,7 @@
#include <errno.h>
-int
+static int
read_line(FILE *input, char *line)
{
int i;
diff --git a/examples/ldns-chaos.c b/examples/ldns-chaos.c
index 28730d91..4c54a007 100644
--- a/examples/ldns-chaos.c
+++ b/examples/ldns-chaos.c
@@ -11,14 +11,14 @@
#include <ldns/ldns.h>
-int
+static int
usage(FILE *fp, char *prog) {
fprintf(fp, "%s server\n", prog);
fprintf(fp, " print out some information about server\n");
return 0;
}
-void
+static void
remove_nameservers(ldns_resolver *res)
{
ldns_rdf *ns;
@@ -97,7 +97,7 @@ main(int argc, char *argv[])
p = ldns_resolver_query(res, version, LDNS_RR_TYPE_TXT,
LDNS_RR_CLASS_CH, LDNS_RD);
if (p) {
-ldns_pkt_print(stdout, p);
+ ldns_pkt_print(stdout, p);
info = ldns_pkt_rr_list_by_type(p,
LDNS_RR_TYPE_TXT, LDNS_SECTION_ANSWER);
diff --git a/examples/ldns-compare-zones.c b/examples/ldns-compare-zones.c
index 80ab0c37..bb0ffc94 100644
--- a/examples/ldns-compare-zones.c
+++ b/examples/ldns-compare-zones.c
@@ -22,7 +22,7 @@
#define OP_DEL '-'
#define OP_CHG '~'
-void
+static void
usage(int argc, char **argv)
{
printf("Usage: %s [-v] [-i] [-d] [-c] <zonefile1> <zonefile2>\n",
diff --git a/examples/ldns-dpa.c b/examples/ldns-dpa.c
index 25928f32..56f05ed0 100644
--- a/examples/ldns-dpa.c
+++ b/examples/ldns-dpa.c
@@ -150,7 +150,7 @@ const ldns_lookup_table lt_operators[] = {
{ 0, NULL }
};
-const char *get_op_str(type_operator op) {
+static const char *get_op_str(type_operator op) {
const ldns_lookup_table *lt;
lt = ldns_lookup_by_id((ldns_lookup_table *) lt_operators, op);
if (lt) {
@@ -161,7 +161,7 @@ const char *get_op_str(type_operator op) {
}
}
-type_operator
+static type_operator
get_op_id(char *op_str)
{
const ldns_lookup_table *lt;
@@ -295,7 +295,7 @@ get_match_by_name(char *name) {
return NULL;
}
-match_table *
+static match_table *
get_match_by_id(match_id id) {
match_table *mt = (match_table *) matches;
@@ -308,7 +308,7 @@ get_match_by_id(match_id id) {
return NULL;
}
-const char *
+static const char *
get_match_name_str(match_id id) {
match_table *mt = get_match_by_id(id);
if (mt) {
@@ -320,7 +320,8 @@ get_match_name_str(match_id id) {
}
}
-bool is_match_name(char *name) {
+static bool
+is_match_name(char *name) {
match_table *mt = get_match_by_name(name);
if (mt) {
return true;
@@ -329,7 +330,7 @@ bool is_match_name(char *name) {
}
}
-void
+static void
print_match_operation(FILE *output, match_operation *mc)
{
match_table *mt = NULL;
@@ -406,7 +407,7 @@ print_match_operation(FILE *output, match_operation *mc)
}
}
-void
+static void
print_match_expression(FILE *output, match_expression *expr)
{
if (expr) {
@@ -452,7 +453,7 @@ fprintf(output, "_");
}
}
-size_t
+static size_t
calculate_counters_total(match_counters *counters)
{
size_t result = 0;
@@ -471,7 +472,7 @@ calculate_counters_total(match_counters *counters)
return result;
}
-void
+static void
print_counters(FILE *output, match_counters *counters, bool show_percentages, size_t total, int count_minimum)
{
double percentage;
@@ -501,7 +502,7 @@ print_counters(FILE *output, match_counters *counters, bool show_percentages, si
return;
}
-void
+static void
ldns_pkt2file_hex(FILE *fp, const ldns_pkt *pkt)
{
uint8_t *wire;
@@ -539,7 +540,7 @@ ldns_pkt2file_hex(FILE *fp, const ldns_pkt *pkt)
* (if they are 'under' this one in the tree, which should be the case in
* the unique counter tree
*/
-size_t
+static size_t
calculate_total_value(match_counters *counters, match_operation *cur)
{
size_t result = 0;
@@ -562,7 +563,7 @@ calculate_total_value(match_counters *counters, match_operation *cur)
return result;
}
-size_t
+static size_t
calculate_total_count_matches(match_counters *counters, match_operation *cur)
{
size_t result = 0;
@@ -599,7 +600,7 @@ calculate_total_count_matches(match_counters *counters, match_operation *cur)
* Returns true if there is a previous match operation with the given type
* in the counters structure
*/
-bool
+static bool
has_previous_match(match_counters *counters, match_operation *cur)
{
if (!counters) {
@@ -626,7 +627,7 @@ has_previous_match(match_counters *counters, match_operation *cur)
* Returns true if there is a later match operation with the given type
* in the counters structure
*/
-bool
+static bool
has_next_match(match_counters *counters, match_operation *cur)
{
if (!counters) {
@@ -653,7 +654,7 @@ has_next_match(match_counters *counters, match_operation *cur)
* Returns the first match with the same type at *cur in
* the counter list, or NULL if it is not found
*/
-match_expression *
+static match_expression *
get_first_match_expression(match_counters *counters, match_operation *cur)
{
if (!counters) {
@@ -675,7 +676,7 @@ get_first_match_expression(match_counters *counters, match_operation *cur)
* Returns the second match expression with the same type at *cur in
* the counter list, or NULL if it is not found
*/
-match_expression *
+static match_expression *
get_second_match_expression(match_counters *counters, match_operation *cur)
{
if (!counters) {
@@ -702,7 +703,7 @@ get_second_match_expression(match_counters *counters, match_operation *cur)
* Returns the last match expression with the same type at *cur in
* the counter list, or NULL if it is not found
*/
-match_expression *
+static match_expression *
get_last_match_expression(match_counters *counters, match_operation *cur)
{
if (!counters) {
@@ -724,7 +725,7 @@ get_last_match_expression(match_counters *counters, match_operation *cur)
* Returns the last but one match expression with the same type at *cur in
* the counter list, or NULL if it is not found
*/
-match_expression *
+static match_expression *
get_last_but_one_match_expression(match_counters *counters, match_operation *cur)
{
if (!counters) {
@@ -747,7 +748,7 @@ get_last_but_one_match_expression(match_counters *counters, match_operation *cur
}
}
-size_t
+static size_t
get_first_count(match_counters *counters, match_operation *cur)
{
match_expression *o = get_first_match_expression(counters, cur);
@@ -758,7 +759,7 @@ get_first_count(match_counters *counters, match_operation *cur)
}
}
-size_t
+static size_t
get_last_count(match_counters *counters, match_operation *cur)
{
match_expression *o = get_last_match_expression(counters, cur);
@@ -770,7 +771,7 @@ get_last_count(match_counters *counters, match_operation *cur)
}
-size_t
+static size_t
calculate_total_count(match_counters *counters, match_operation *cur)
{
size_t result = 0;
@@ -793,7 +794,7 @@ calculate_total_count(match_counters *counters, match_operation *cur)
return result;
}
-void
+static void
print_counter_averages(FILE *output, match_counters *counters, match_operation *cur)
{
size_t total_value;
@@ -832,7 +833,7 @@ print_counter_averages(FILE *output, match_counters *counters, match_operation *
return;
}
-void
+static void
print_counter_average_count(FILE *output, match_counters *counters, match_operation *cur, bool remove_first_last)
{
size_t total_matches;
@@ -891,7 +892,7 @@ print_counter_average_count(FILE *output, match_counters *counters, match_operat
return;
}
-bool
+static bool
match_int(type_operator operator,
char *value,
char *mvalue)
@@ -930,10 +931,11 @@ match_int(type_operator operator,
}
}
-bool
+static bool
match_opcode(type_operator operator,
char *value,
- char *mvalue) {
+ char *mvalue)
+{
ldns_pkt_opcode a, b;
int i;
ldns_lookup_table *lt;
@@ -995,7 +997,7 @@ match_opcode(type_operator operator,
}
}
-bool
+static bool
match_str(type_operator operator,
char *value,
char *mvalue)
@@ -1027,7 +1029,7 @@ match_str(type_operator operator,
}
}
-bool
+static bool
match_rr_type(type_operator operator,
char *value,
char *mvalue)
@@ -1062,10 +1064,11 @@ match_rr_type(type_operator operator,
}
}
-bool
+static bool
match_rcode(type_operator operator,
char *value,
- char *mvalue) {
+ char *mvalue)
+{
int a, b;
int i;
ldns_lookup_table *lt;
@@ -1128,7 +1131,7 @@ match_rcode(type_operator operator,
}
}
-bool
+static bool
value_matches(match_id id,
type_operator operator,
char *value,
@@ -1191,7 +1194,7 @@ value_matches(match_id id,
return result;
}
-char *
+static char *
get_string_value(match_id id, ldns_pkt *pkt, ldns_rdf *src_addr, ldns_rdf *dst_addr)
{
char *val;
@@ -1331,30 +1334,7 @@ get_string_value(match_id id, ldns_pkt *pkt, ldns_rdf *src_addr, ldns_rdf *dst_a
return val;
}
-/*
-bool
-match_pkt(ldns_pkt *pkt, match_counter *counter)
-{
- bool result;
- char *val;
-
- if (!pkt || !counter) {
- return false;
- } else {
- val = get_string_value(counter->id, pkt);
- if (!val) {
- return false;
- }
- result = value_matches(counter->id, counter->operator, val, counter->value);
- if (result) {
- counter->count++;
- }
- free(val);
- return result;
- }
-}
-*/
-bool
+static bool
match_packet_to_operation(ldns_pkt *pkt, ldns_rdf *src_addr, ldns_rdf *dst_addr, match_operation *operation)
{
bool result;
@@ -1373,22 +1353,7 @@ match_packet_to_operation(ldns_pkt *pkt, ldns_rdf *src_addr, ldns_rdf *dst_addr,
}
}
-
-
-/*
-int
-add_counter(match_counters *counters,
- match_expression *expr)
-{
- counters->counter = realloc(counters->counter, (counters->size + 1) * sizeof(match_expression *));
- counters->counter[counters->size] = expr;
- counters->size = counters->size + 1;
-
- return 0;
-}
-*/
-
-int
+static int
match_expression_compare_count(const void *a, const void *b)
{
match_expression *mea, *meb;
@@ -1411,7 +1376,7 @@ match_expression_compare_count(const void *a, const void *b)
}
}
-int
+static int
match_expression_compare_count_p(const void *a, const void *b)
{
match_expression **pmea, **pmeb;
@@ -1427,7 +1392,7 @@ match_expression_compare_count_p(const void *a, const void *b)
}
}
-int
+static int
match_operation_compare(const void *a, const void *b)
{
match_operation *moa, *mob;
@@ -1479,7 +1444,7 @@ match_operation_compare(const void *a, const void *b)
}
}
-int
+static int
match_expression_compare(const void *a, const void *b)
{
match_expression *mea, *meb;
@@ -1518,7 +1483,8 @@ match_expression_compare(const void *a, const void *b)
}
}
}
-int
+
+static int
match_expression_compare_p(const void *a, const void *b)
{
@@ -1538,7 +1504,7 @@ match_expression_compare_p(const void *a, const void *b)
/**
* If count is true, and the counter is found, its count is increased by 1
*/
-int
+static int
add_match_counter(match_counters *counters,
match_expression *expr,
bool count)
@@ -1593,7 +1559,7 @@ add_match_counter(match_counters *counters,
return 0;
}
-bool
+static bool
match_dns_packet_to_expr(ldns_pkt *pkt, ldns_rdf *src_addr, ldns_rdf *dst_addr, match_expression *expr)
{
bool result;
@@ -1634,7 +1600,7 @@ match_dns_packet_to_expr(ldns_pkt *pkt, ldns_rdf *src_addr, ldns_rdf *dst_addr,
return result;
}
-bool
+static bool
match_expression_equals(match_expression *expr1, match_expression *expr2)
{
if (!expr1 || !expr2) {
@@ -1665,8 +1631,7 @@ match_expression_equals(match_expression *expr1, match_expression *expr2)
}
-
-void
+static void
free_match_operation(match_operation *operation)
{
if (operation) {
@@ -1677,7 +1642,7 @@ free_match_operation(match_operation *operation)
}
}
-void
+static void
free_match_expression(match_expression *expr)
{
if (expr) {
@@ -1695,7 +1660,7 @@ free_match_expression(match_expression *expr)
}
}
-void
+static void
free_counters(match_counters *counters)
{
if (counters) {
@@ -1712,7 +1677,7 @@ free_counters(match_counters *counters)
}
}
-void
+static void
match_pkt_counters(ldns_pkt *pkt, ldns_rdf *src_addr, ldns_rdf *dst_addr, match_counters *counts)
{
if (counts->left) {
@@ -1730,7 +1695,7 @@ match_pkt_counters(ldns_pkt *pkt, ldns_rdf *src_addr, ldns_rdf *dst_addr, match_
}
}
-void
+static void
match_pkt_uniques(ldns_pkt *pkt, ldns_rdf *src_addr, ldns_rdf *dst_addr, match_counters *uniques, match_id unique_ids[], size_t unique_id_count)
{
match_expression *me;
@@ -1793,26 +1758,7 @@ match_pkt_uniques(ldns_pkt *pkt, ldns_rdf *src_addr, ldns_rdf *dst_addr, match_c
#endif
}
-
-/*
-void
-print_match_counter(FILE *output, match_counter *mc)
-{
- match_table *mt = NULL;
- if (mc) {
- mt = get_match_by_id(mc->id);
- if (mt) {
- fprintf(output, "%s %s '%s'", mt->name, get_op_str(mc->operator), mc->value);
- } else {
- fprintf(output, "%u %s '%s'", mc->id, get_op_str(mc->operator), mc->value);
- }
- } else {
- fprintf(output, "(nil)");
- }
-}
-
-*/
-match_expression *
+static match_expression *
parse_match_expression(char *string)
{
match_expression *expr;
@@ -1830,21 +1776,13 @@ parse_match_expression(char *string)
j = 0;
for (i = 0; i < strlen(string); i++) {
-/*
if(!isspace(string[i])) {
-*/
str[j] = string[i];
j++;
-/*
}
-*/
}
str[j] = '\0';
- /*
- printf("Parsing: %s\n", string);
- printf("Parsing short : %s\n", str);
- */
expr = malloc(sizeof(match_expression));
expr->left = NULL;
expr->right = NULL;
diff --git a/examples/ldns-key2ds.c b/examples/ldns-key2ds.c
index 33582b10..4213c9fe 100644
--- a/examples/ldns-key2ds.c
+++ b/examples/ldns-key2ds.c
@@ -12,7 +12,7 @@
#include <errno.h>
-void
+static void
usage(FILE *fp, char *prog) {
fprintf(fp, "%s [-fn] [-1|-2] keyfile\n", prog);
fprintf(fp, " Generate a DS RR from the DNSKEYS in keyfile\n");
@@ -26,7 +26,7 @@ usage(FILE *fp, char *prog) {
fprintf(fp, " -2: use SHA256 for the DS hash\n");
}
-int
+static int
is_suitable_dnskey(ldns_rr *rr, int sep_only)
{
if (!rr || ldns_rr_get_type(rr) != LDNS_RR_TYPE_DNSKEY) {
diff --git a/examples/ldns-keyfetcher.c b/examples/ldns-keyfetcher.c
index 0e1438d3..80a9aa54 100644
--- a/examples/ldns-keyfetcher.c
+++ b/examples/ldns-keyfetcher.c
@@ -16,7 +16,7 @@ int verbosity = 0;
uint8_t address_family = 0;
bool store_in_file = false;
-void
+static void
usage(FILE *fp, char *prog) {
fprintf(fp, "%s domain\n", prog);
fprintf(fp, " retrieve the dnskeys for a domain\n");
@@ -30,7 +30,7 @@ usage(FILE *fp, char *prog) {
fprintf(fp, "-v <int>\tVerbosity level (0-5, not verbose-very verbose)\n");
}
-ldns_rr_list *
+static ldns_rr_list *
retrieve_dnskeys(ldns_resolver *local_res, ldns_rdf *name, ldns_rr_type t,
ldns_rr_class c, ldns_rr_list *dns_root)
{
diff --git a/examples/ldns-keygen.c b/examples/ldns-keygen.c
index 6e66332c..b0ae903e 100644
--- a/examples/ldns-keygen.c
+++ b/examples/ldns-keygen.c
@@ -13,7 +13,7 @@
#include <errno.h>
#ifdef HAVE_SSL
-void
+static void
usage(FILE *fp, char *prog) {
fprintf(fp, "%s -a <algorithm> [-b bits] [-r /dev/random] [-v] domain\n",
prog);
@@ -32,7 +32,7 @@ usage(FILE *fp, char *prog) {
fprintf(fp, " The base name (K<name>+<alg>+<id> will be printed to stdout\n");
}
-void
+static void
show_algorithms(FILE *out)
{
ldns_lookup_table *lt = ldns_signing_algorithms;
diff --git a/examples/ldns-mx.c b/examples/ldns-mx.c
index d92c8f6a..873cf55f 100644
--- a/examples/ldns-mx.c
+++ b/examples/ldns-mx.c
@@ -9,7 +9,7 @@
#include <ldns/ldns.h>
-int
+static int
usage(FILE *fp, char *prog) {
fprintf(fp, "%s domain\n", prog);
fprintf(fp, " print out the mx for domain\n");
diff --git a/examples/ldns-nsec3-hash.c b/examples/ldns-nsec3-hash.c
index 9c170650..5a68b296 100644
--- a/examples/ldns-nsec3-hash.c
+++ b/examples/ldns-nsec3-hash.c
@@ -23,7 +23,7 @@
#define MAX_FILENAME_LEN 250
int verbosity = 1;
-void
+static void
usage(FILE *fp, const char *prog) {
fprintf(fp, "%s [OPTIONS] <domain name>\n", prog);
fprintf(fp, " prints the NSEC3 hash of the given domain name\n");
diff --git a/examples/ldns-revoke.c b/examples/ldns-revoke.c
index 6fb9279f..fa4d6d14 100644
--- a/examples/ldns-revoke.c
+++ b/examples/ldns-revoke.c
@@ -12,7 +12,7 @@
#include <errno.h>
-void
+static void
usage(FILE *fp, char *prog) {
fprintf(fp, "%s [-n] keyfile\n", prog);
fprintf(fp, " Revokes a key\n");
diff --git a/examples/ldns-rrsig.c b/examples/ldns-rrsig.c
index 2b361226..5c565b1d 100644
--- a/examples/ldns-rrsig.c
+++ b/examples/ldns-rrsig.c
@@ -11,7 +11,7 @@
#include <ldns/ldns.h>
-int
+static int
usage(FILE *fp, char *prog) {
fprintf(fp, "%s domain [type]\n", prog);
fprintf(fp, " print out the inception and expiration dates\n");
diff --git a/examples/ldns-signzone.c b/examples/ldns-signzone.c
index a9e8e247..bfb07d8c 100644
--- a/examples/ldns-signzone.c
+++ b/examples/ldns-signzone.c
@@ -26,7 +26,7 @@ int verbosity = 1;
#ifdef HAVE_SSL
#include <openssl/err.h>
-void
+static void
usage(FILE *fp, const char *prog) {
fprintf(fp, "%s [OPTIONS] zonefile key [key [key]]\n", prog);
fprintf(fp, " signs the zone with the given key(s)\n");
@@ -57,13 +57,13 @@ usage(FILE *fp, const char *prog) {
fprintf(fp, " A date can be a timestamp (seconds since the epoch), or of\n the form <YYYYMMdd[hhmmss]>\n");
}
-void
+static void
usage_openssl(FILE *fp, const char *prog) {
fprintf(fp, "Special commands for openssl engines:\n");
fprintf(fp, "-c <file>\tOpenSSL config file\n");
}
-void check_tm(struct tm tm)
+static void check_tm(struct tm tm)
{
if (tm.tm_year < 70) {
fprintf(stderr, "You cannot specify dates before 1970\n");
@@ -102,7 +102,7 @@ void check_tm(struct tm tm)
*
* prints a warning if a non-default TTL is changed
*/
-void
+static void
equalize_ttls(ldns_rr *rr1, ldns_rr *rr2, uint32_t default_ttl)
{
uint32_t ttl1, ttl2;
@@ -124,7 +124,7 @@ equalize_ttls(ldns_rr *rr1, ldns_rr *rr2, uint32_t default_ttl)
}
}
-void
+static void
equalize_ttls_rr_list(ldns_rr_list *rr_list, ldns_rr *rr, uint32_t default_ttl)
{
size_t i;
@@ -138,7 +138,7 @@ equalize_ttls_rr_list(ldns_rr_list *rr_list, ldns_rr *rr, uint32_t default_ttl)
}
}
-ldns_rr *
+static ldns_rr *
find_key_in_zone(ldns_rr *pubkey_gen, ldns_zone *zone) {
size_t key_i;
ldns_rr *pubkey;
@@ -165,7 +165,7 @@ find_key_in_zone(ldns_rr *pubkey_gen, ldns_zone *zone) {
return NULL;
}
-ldns_rr *
+static ldns_rr *
find_key_in_file(ldns_key *key)
{
char *keyfile_name;
@@ -215,7 +215,7 @@ find_key_in_file(ldns_key *key)
* Even if keys are not added, the function is still needed, to check
* whether keys of which we only have key data are KSKs or ZSKS
*/
-ldns_status
+static ldns_status
find_or_create_pubkeys(ldns_key_list *keys, ldns_zone *orig_zone, bool add_keys, uint32_t default_ttl) {
ldns_key *key;
size_t i;
@@ -294,7 +294,7 @@ find_or_create_pubkeys(ldns_key_list *keys, ldns_zone *orig_zone, bool add_keys,
return LDNS_STATUS_OK;
}
-void
+static void
strip_dnssec_records(ldns_zone *zone)
{
ldns_rr_list *new_list;
@@ -681,7 +681,7 @@ main(int argc, char *argv[])
line_nr = 0;
if (!keyfile) {
fprintf(stderr,
- "Error: unable to <read %s: %s\n",
+ "Error: unable to read %s: %s\n",
keyfile_name,
strerror(errno));
} else {
diff --git a/examples/ldns-update.c b/examples/ldns-update.c
index b15f851c..00c802d2 100644
--- a/examples/ldns-update.c
+++ b/examples/ldns-update.c
@@ -12,7 +12,7 @@
#include <ldns/ldns.h>
/* dynamic update stuff */
-ldns_resolver *
+static ldns_resolver *
ldns_update_resolver_new(const char *fqdn, const char *zone,
ldns_rr_class class, uint16_t port, ldns_tsig_credentials *tsig_cred, ldns_rdf **zone_rdf)
{
@@ -131,7 +131,7 @@ ldns_update_resolver_new(const char *fqdn, const char *zone,
}
-ldns_status
+static ldns_status
ldns_update_send_simple_addr(const char *fqdn, const char *zone,
const char *ipaddr, uint16_t p, uint32_t ttl, ldns_tsig_credentials *tsig_cred)
{
@@ -233,8 +233,9 @@ ldns_update_send_simple_addr(const char *fqdn, const char *zone,
}
-void
-usage(FILE *fp, char *prog) {
+static void
+usage(FILE *fp, char *prog)
+{
fprintf(fp, "%s domain [zone] ip tsig_name tsig_alg tsig_hmac\n", prog);
fprintf(fp, " send a dynamic update packet to <ip>\n\n");
fprintf(fp, " Use 'none' instead of ip to remove any previous address\n");
diff --git a/examples/ldns-verify-zone.c b/examples/ldns-verify-zone.c
index 8c198fe2..75ba6d88 100644
--- a/examples/ldns-verify-zone.c
+++ b/examples/ldns-verify-zone.c
@@ -23,7 +23,7 @@ int verbosity = 3;
/* returns 1 if the list is empty, or if there are only ns rrs in the
* list, 0 otherwise */
-int
+static int
only_ns_in_rrsets(ldns_dnssec_rrsets *rrsets) {
ldns_dnssec_rrsets *cur_rrset = rrsets;
@@ -36,7 +36,7 @@ only_ns_in_rrsets(ldns_dnssec_rrsets *rrsets) {
return 1;
}
-int
+static int
zone_is_nsec3_optout(ldns_rbtree_t *zone_nodes)
{
/* simply find the first NSEC3 RR and check its flags */
@@ -60,7 +60,7 @@ zone_is_nsec3_optout(ldns_rbtree_t *zone_nodes)
return 0;
}
-bool
+static bool
ldns_rr_list_contains_name(const ldns_rr_list *rr_list,
const ldns_rdf *name)
{
@@ -77,7 +77,7 @@ ldns_rr_list_contains_name(const ldns_rr_list *rr_list,
return false;
}
-void
+static void
print_type(ldns_rr_type type)
{
const ldns_rr_descriptor *descriptor;
@@ -92,7 +92,7 @@ print_type(ldns_rr_type type)
}
-ldns_dnssec_zone *
+static ldns_dnssec_zone *
create_dnssec_zone(ldns_zone *orig_zone)
{
size_t i;
@@ -143,7 +143,7 @@ create_dnssec_zone(ldns_zone *orig_zone)
return dnssec_zone;
}
-ldns_status
+static ldns_status
verify_dnssec_rrset(ldns_rdf *zone_name,
ldns_rdf *name,
ldns_dnssec_rrsets *rrset,
@@ -219,7 +219,7 @@ verify_dnssec_rrset(ldns_rdf *zone_name,
return result;
}
-ldns_status
+static ldns_status
verify_single_rr(ldns_rr *rr,
ldns_dnssec_rrs *signature_rrs,
ldns_rr_list *keys)
@@ -274,7 +274,7 @@ verify_single_rr(ldns_rr *rr,
return result;
}
-ldns_status
+static ldns_status
verify_next_hashed_name(ldns_rbtree_t *zone_nodes,
ldns_dnssec_name *name)
{
@@ -360,7 +360,7 @@ verify_next_hashed_name(ldns_rbtree_t *zone_nodes,
}
}
-ldns_rbnode_t *
+static ldns_rbnode_t *
next_nonglue_node(ldns_rbnode_t *node, ldns_rr_list *glue_rrs)
{
ldns_rbnode_t *cur_node = ldns_rbtree_next(node);
@@ -377,7 +377,7 @@ next_nonglue_node(ldns_rbnode_t *node, ldns_rr_list *glue_rrs)
return LDNS_RBTREE_NULL;
}
-ldns_status
+static ldns_status
verify_nsec(ldns_rbtree_t *zone_nodes,
ldns_rbnode_t *cur_node,
ldns_rr_list *keys,
@@ -480,7 +480,7 @@ ldns_dnssec_name_has_only_a(ldns_dnssec_name *cur_name)
return 1;
}
-ldns_status
+static ldns_status
verify_dnssec_name(ldns_rdf *zone_name,
ldns_dnssec_zone *zone,
ldns_rbtree_t *zone_nodes,
@@ -549,7 +549,7 @@ verify_dnssec_name(ldns_rdf *zone_name,
return result;
}
-ldns_status
+static ldns_status
verify_dnssec_zone(ldns_dnssec_zone *dnssec_zone,
ldns_rdf *zone_name,
ldns_rr_list *glue_rrs)
diff --git a/examples/ldns-walk.c b/examples/ldns-walk.c
index 844bc627..da0f74db 100644
--- a/examples/ldns-walk.c
+++ b/examples/ldns-walk.c
@@ -12,7 +12,7 @@
int verbosity = 0;
-int
+static int
usage(FILE *fp, char *prog) {
fprintf(fp, "%s [options] domain\n", prog);
fprintf(fp, " print out the owner names for domain and the record types for those names\n");
diff --git a/examples/ldns-zcat.c b/examples/ldns-zcat.c
index 53a94a45..df4ecbaf 100644
--- a/examples/ldns-zcat.c
+++ b/examples/ldns-zcat.c
@@ -22,7 +22,7 @@
#define MIDDLE_ZONE 1
#define LAST_ZONE 2
-void
+static void
usage(FILE *f, char *progname)
{
fprintf(f, "Usage: %s [OPTIONS] <zonefiles>\n", progname);
diff --git a/examples/ldns-zsplit.c b/examples/ldns-zsplit.c
index 414c2bdb..84f2ddb9 100644
--- a/examples/ldns-zsplit.c
+++ b/examples/ldns-zsplit.c
@@ -25,7 +25,7 @@
#define INTENT_TO_SPLIT 1
#define SPLIT_NOW 2
-void
+static void
usage(FILE *f, char *progname)
{
fprintf(f, "Usage: %s [OPTIONS] <zonefile> [keys]\n", progname);
@@ -46,7 +46,7 @@ usage(FILE *f, char *progname)
/* key the keys from the cmd line */
-ldns_rr_list *
+static ldns_rr_list *
open_keyfiles(char **files, uint16_t filec)
{
uint16_t i;
@@ -72,7 +72,7 @@ open_keyfiles(char **files, uint16_t filec)
}
/* open a new zone file with the correct suffix */
-FILE *
+static FILE *
open_newfile(char *basename, ldns_zone *z, size_t counter, ldns_rr_list *keys)
{
char filename[FILE_SIZE];