Skip to content

Commit

Permalink
ldns: fix the build in FreeBSD's base system
Browse files Browse the repository at this point in the history
This adds an ldns/internal.h C header, containing a copy of the
function prototypes for internal functions not exposed in the API.

It effectively works around the following compilation error:
error: no previous prototype for function [-Werror,-Wmissing-prototypes]

This header is not installed, and does not affect the API exposed.

Tested on FreeBSD/amd64 (14.0-CURRENT).
  • Loading branch information
khorben committed May 22, 2023
1 parent 912987b commit e3cbf21
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 0 deletions.
1 change: 1 addition & 0 deletions contrib/ldns/dnssec_zone.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <ldns/config.h>

#include <ldns/ldns.h>
#include <ldns/internal.h>

ldns_dnssec_rrs *
ldns_dnssec_rrs_new(void)
Expand Down
1 change: 1 addition & 0 deletions contrib/ldns/edns.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
*/

#include <ldns/ldns.h>
#include <ldns/internal.h>

#define LDNS_OPTIONLIST_INIT 8

Expand Down
65 changes: 65 additions & 0 deletions contrib/ldns/ldns/internal.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#ifndef LDNS_INTERNAL_H
#define LDNS_INTERNAL_H

#include <ldns/dnssec_sign.h>
#include <ldns/util.h>

#ifdef __cplusplus
extern "C" {
#endif

/* dnssec_zone.c */
ldns_status
dnssec_zone_equip_zonemd(ldns_dnssec_zone *zone,
ldns_rr_list *new_rrs, ldns_key_list *key_list, int signflags);

/* edns.c */
void
ldns_edns_set_code(ldns_edns_option *edns, ldns_edns_option_code code);
void
ldns_edns_set_data(ldns_edns_option *edns, void *data);
void
ldns_edns_set_size(ldns_edns_option *edns, size_t size);

/* net.c */
int
ldns_tcp_bgsend2(ldns_buffer *qbin,
const struct sockaddr_storage *to, socklen_t tolen,
struct timeval timeout);
int
ldns_tcp_connect2(const struct sockaddr_storage *to, socklen_t tolen,
struct timeval timeout);
int
ldns_udp_bgsend2(ldns_buffer *qbin,
const struct sockaddr_storage *to , socklen_t tolen,
struct timeval timeout);
int
ldns_udp_connect2(const struct sockaddr_storage *to, struct timeval ATTR_UNUSED(timeout));

/* packet.c */
ldns_edns_option_list*
pkt_edns_data2edns_option_list(const ldns_rdf *edns_data);

/* rr.c */
ldns_status
_ldns_rr_new_frm_fp_l_internal(ldns_rr **newrr, FILE *fp,
uint32_t *default_ttl, ldns_rdf **origin, ldns_rdf **prev,
int *line_nr, bool *explicit_ttl);

/* str2host.c */
ldns_status svcparam_key2buffer_str(ldns_buffer *output, uint16_t key);

/* util.c */
struct tm *
ldns_serial_arithmetics_gmtime_r(int32_t time, time_t now, struct tm *result);
#undef ldns_serial_arithmitics_gmtime_r
struct tm *
ldns_serial_arithmitics_gmtime_r(int32_t time, time_t now, struct tm *result);
#define ldns_serial_arithmitics_gmtime_r ldns_serial_arithmetics_gmtime_r


#ifdef __cplusplus
}
#endif

#endif /* LDNS_INTERNAL_H */
1 change: 1 addition & 0 deletions contrib/ldns/packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <ldns/config.h>

#include <ldns/ldns.h>
#include <ldns/internal.h>

#include <strings.h>
#include <limits.h>
Expand Down
1 change: 1 addition & 0 deletions contrib/ldns/rr.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <ldns/config.h>

#include <ldns/ldns.h>
#include <ldns/internal.h>

#include <strings.h>
#include <limits.h>
Expand Down
1 change: 1 addition & 0 deletions contrib/ldns/str2host.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <ldns/config.h>

#include <ldns/ldns.h>
#include <ldns/internal.h>

#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
Expand Down
1 change: 1 addition & 0 deletions contrib/ldns/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <ldns/rdata.h>
#include <ldns/rr.h>
#include <ldns/util.h>
#include <ldns/internal.h>
#include <strings.h>
#include <stdlib.h>
#include <stdio.h>
Expand Down

0 comments on commit e3cbf21

Please sign in to comment.