1 /* config.h.in. Generated from configure.ac by autoheader. */
3 /* Directory to chroot to */
6 /* Do sha512 definitions in config.h */
9 /* Pathname to the Unbound configuration file */
12 /* Define this if on macOSX10.4-darwin8 and setreuid and setregid do not work
14 #undef DARWIN_BROKEN_SETREUID
16 /* Whether daemon is deprecated */
17 #undef DEPRECATED_DAEMON
19 /* default dnstap socket path */
20 #undef DNSTAP_SOCKET_PATH
22 /* Define if you want to use debug lock checking (slow). */
23 #undef ENABLE_LOCK_CHECKS
25 /* Define this if you enabled-allsymbols from libunbound to link binaries to
26 it for smaller install size, but the libunbound export table is polluted by
28 #undef EXPORT_ALL_SYMBOLS
30 /* Define to 1 if you have the `arc4random' function. */
31 #undef HAVE_ARC4RANDOM
33 /* Define to 1 if you have the `arc4random_uniform' function. */
34 #undef HAVE_ARC4RANDOM_UNIFORM
36 /* Define to 1 if you have the <arpa/inet.h> header file. */
37 #undef HAVE_ARPA_INET_H
39 /* Whether the C compiler accepts the "format" attribute */
40 #undef HAVE_ATTR_FORMAT
42 /* Whether the C compiler accepts the "unused" attribute */
43 #undef HAVE_ATTR_UNUSED
45 /* Define to 1 if you have the `chown' function. */
48 /* Define to 1 if you have the `chroot' function. */
51 /* Define to 1 if you have the `ctime_r' function. */
54 /* Define to 1 if you have the `daemon' function. */
57 /* Define to 1 if you have the declaration of `arc4random', and to 0 if you
59 #undef HAVE_DECL_ARC4RANDOM
61 /* Define to 1 if you have the declaration of `arc4random_uniform', and to 0
63 #undef HAVE_DECL_ARC4RANDOM_UNIFORM
65 /* Define to 1 if you have the declaration of `NID_secp384r1', and to 0 if you
67 #undef HAVE_DECL_NID_SECP384R1
69 /* Define to 1 if you have the declaration of `NID_X9_62_prime256v1', and to 0
71 #undef HAVE_DECL_NID_X9_62_PRIME256V1
73 /* Define to 1 if you have the declaration of `reallocarray', and to 0 if you
75 #undef HAVE_DECL_REALLOCARRAY
77 /* Define to 1 if you have the declaration of `sk_SSL_COMP_pop_free', and to 0
79 #undef HAVE_DECL_SK_SSL_COMP_POP_FREE
81 /* Define to 1 if you have the declaration of
82 `SSL_COMP_get_compression_methods', and to 0 if you don't. */
83 #undef HAVE_DECL_SSL_COMP_GET_COMPRESSION_METHODS
85 /* Define to 1 if you have the declaration of `SSL_CTX_set_ecdh_auto', and to
87 #undef HAVE_DECL_SSL_CTX_SET_ECDH_AUTO
89 /* Define to 1 if you have the declaration of `strlcat', and to 0 if you
91 #undef HAVE_DECL_STRLCAT
93 /* Define to 1 if you have the declaration of `strlcpy', and to 0 if you
95 #undef HAVE_DECL_STRLCPY
97 /* Define to 1 if you have the declaration of `XML_StopParser', and to 0 if
99 #undef HAVE_DECL_XML_STOPPARSER
101 /* Define to 1 if you have the <dlfcn.h> header file. */
104 /* Define to 1 if you have the <endian.h> header file. */
107 /* Define to 1 if you have the `endprotoent' function. */
108 #undef HAVE_ENDPROTOENT
110 /* Define to 1 if you have the `endservent' function. */
111 #undef HAVE_ENDSERVENT
113 /* Define to 1 if you have the `event_base_free' function. */
114 #undef HAVE_EVENT_BASE_FREE
116 /* Define to 1 if you have the `event_base_get_method' function. */
117 #undef HAVE_EVENT_BASE_GET_METHOD
119 /* Define to 1 if you have the `event_base_new' function. */
120 #undef HAVE_EVENT_BASE_NEW
122 /* Define to 1 if you have the `event_base_once' function. */
123 #undef HAVE_EVENT_BASE_ONCE
125 /* Define to 1 if you have the <event.h> header file. */
128 /* Define to 1 if you have the `EVP_sha1' function. */
131 /* Define to 1 if you have the `EVP_sha256' function. */
132 #undef HAVE_EVP_SHA256
134 /* Define to 1 if you have the `EVP_sha512' function. */
135 #undef HAVE_EVP_SHA512
137 /* Define to 1 if you have the `ev_default_loop' function. */
138 #undef HAVE_EV_DEFAULT_LOOP
140 /* Define to 1 if you have the `ev_loop' function. */
143 /* Define to 1 if you have the <expat.h> header file. */
146 /* Define to 1 if you have the `fcntl' function. */
149 /* Define to 1 if you have the `FIPS_mode' function. */
150 #undef HAVE_FIPS_MODE
152 /* Define to 1 if you have the `fork' function. */
155 /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
158 /* Define to 1 if you have the `fsync' function. */
161 /* Whether getaddrinfo is available */
162 #undef HAVE_GETADDRINFO
164 /* Define to 1 if you have the `getauxval' function. */
165 #undef HAVE_GETAUXVAL
167 /* Define to 1 if you have the `getentropy' function. */
168 #undef HAVE_GETENTROPY
170 /* Define to 1 if you have the <getopt.h> header file. */
173 /* Define to 1 if you have the `getpwnam' function. */
176 /* Define to 1 if you have the `getrlimit' function. */
177 #undef HAVE_GETRLIMIT
179 /* Define to 1 if you have the `glob' function. */
182 /* Define to 1 if you have the <glob.h> header file. */
185 /* Define to 1 if you have the `gmtime_r' function. */
188 /* Define to 1 if you have the <grp.h> header file. */
191 /* If you have HMAC_CTX_init */
192 #undef HAVE_HMAC_CTX_INIT
194 /* Define to 1 if you have the `inet_aton' function. */
195 #undef HAVE_INET_ATON
197 /* Define to 1 if you have the `inet_ntop' function. */
198 #undef HAVE_INET_NTOP
200 /* Define to 1 if you have the `inet_pton' function. */
201 #undef HAVE_INET_PTON
203 /* Define to 1 if you have the `initgroups' function. */
204 #undef HAVE_INITGROUPS
206 /* Define to 1 if you have the <inttypes.h> header file. */
207 #undef HAVE_INTTYPES_H
209 /* if the function 'ioctlsocket' is available */
210 #undef HAVE_IOCTLSOCKET
212 /* Define to 1 if you have the <iphlpapi.h> header file. */
213 #undef HAVE_IPHLPAPI_H
215 /* Define to 1 if you have the `isblank' function. */
218 /* Define to 1 if you have the `kill' function. */
221 /* Define if we have LibreSSL */
224 /* Define to 1 if you have the `localtime_r' function. */
225 #undef HAVE_LOCALTIME_R
227 /* Define to 1 if you have the <login_cap.h> header file. */
228 #undef HAVE_LOGIN_CAP_H
230 /* If have GNU libc compatible malloc */
233 /* Define to 1 if you have the `memmove' function. */
236 /* Define to 1 if you have the <memory.h> header file. */
239 /* Define to 1 if you have the <netdb.h> header file. */
242 /* Define to 1 if you have the <netinet/in.h> header file. */
243 #undef HAVE_NETINET_IN_H
245 /* Use libnettle for crypto */
248 /* Use libnss for crypto */
251 /* Define to 1 if you have the `OPENSSL_config' function. */
252 #undef HAVE_OPENSSL_CONFIG
254 /* Define to 1 if you have the <openssl/conf.h> header file. */
255 #undef HAVE_OPENSSL_CONF_H
257 /* Define to 1 if you have the <openssl/engine.h> header file. */
258 #undef HAVE_OPENSSL_ENGINE_H
260 /* Define to 1 if you have the <openssl/err.h> header file. */
261 #undef HAVE_OPENSSL_ERR_H
263 /* Define to 1 if you have the <openssl/rand.h> header file. */
264 #undef HAVE_OPENSSL_RAND_H
266 /* Define to 1 if you have the <openssl/ssl.h> header file. */
267 #undef HAVE_OPENSSL_SSL_H
269 /* Define if you have POSIX threads libraries and header files. */
272 /* Have PTHREAD_PRIO_INHERIT. */
273 #undef HAVE_PTHREAD_PRIO_INHERIT
275 /* Define to 1 if the system has the type `pthread_rwlock_t'. */
276 #undef HAVE_PTHREAD_RWLOCK_T
278 /* Define to 1 if the system has the type `pthread_spinlock_t'. */
279 #undef HAVE_PTHREAD_SPINLOCK_T
281 /* Define to 1 if you have the <pwd.h> header file. */
284 /* Define if you have Python libraries and header files. */
287 /* Define to 1 if you have the `random' function. */
290 /* Define to 1 if you have the `reallocarray' function. */
291 #undef HAVE_REALLOCARRAY
293 /* Define to 1 if you have the `recvmsg' function. */
296 /* Define to 1 if you have the `sbrk' function. */
299 /* Define to 1 if you have the `sendmsg' function. */
302 /* Define to 1 if you have the `setregid' function. */
305 /* Define to 1 if you have the `setresgid' function. */
306 #undef HAVE_SETRESGID
308 /* Define to 1 if you have the `setresuid' function. */
309 #undef HAVE_SETRESUID
311 /* Define to 1 if you have the `setreuid' function. */
314 /* Define to 1 if you have the `setrlimit' function. */
315 #undef HAVE_SETRLIMIT
317 /* Define to 1 if you have the `setsid' function. */
320 /* Define to 1 if you have the `setusercontext' function. */
321 #undef HAVE_SETUSERCONTEXT
323 /* Define to 1 if you have the `SHA512_Update' function. */
324 #undef HAVE_SHA512_UPDATE
326 /* Define to 1 if you have the `sigprocmask' function. */
327 #undef HAVE_SIGPROCMASK
329 /* Define to 1 if you have the `sleep' function. */
332 /* Define to 1 if you have the `snprintf' function. */
335 /* Define to 1 if you have the `socketpair' function. */
336 #undef HAVE_SOCKETPAIR
338 /* Using Solaris threads */
339 #undef HAVE_SOLARIS_THREADS
341 /* Define to 1 if you have the `srandom' function. */
344 /* Define if you have the SSL libraries installed. */
347 /* Define to 1 if you have the <stdarg.h> header file. */
350 /* Define to 1 if you have the <stdbool.h> header file. */
351 #undef HAVE_STDBOOL_H
353 /* Define to 1 if you have the <stdint.h> header file. */
356 /* Define to 1 if you have the <stdlib.h> header file. */
359 /* Define to 1 if you have the `strftime' function. */
362 /* Define to 1 if you have the <strings.h> header file. */
363 #undef HAVE_STRINGS_H
365 /* Define to 1 if you have the <string.h> header file. */
368 /* Define to 1 if you have the `strlcat' function. */
371 /* Define to 1 if you have the `strlcpy' function. */
374 /* Define to 1 if you have the `strptime' function. */
377 /* Define to 1 if `ipi_spec_dst' is a member of `struct in_pktinfo'. */
378 #undef HAVE_STRUCT_IN_PKTINFO_IPI_SPEC_DST
380 /* Define to 1 if `sun_len' is a member of `struct sockaddr_un'. */
381 #undef HAVE_STRUCT_SOCKADDR_UN_SUN_LEN
383 /* Define if you have Swig libraries and header files. */
386 /* Define to 1 if you have the <syslog.h> header file. */
389 /* Define to 1 if you have the <sys/param.h> header file. */
390 #undef HAVE_SYS_PARAM_H
392 /* Define to 1 if you have the <sys/resource.h> header file. */
393 #undef HAVE_SYS_RESOURCE_H
395 /* Define to 1 if you have the <sys/sha2.h> header file. */
396 #undef HAVE_SYS_SHA2_H
398 /* Define to 1 if you have the <sys/socket.h> header file. */
399 #undef HAVE_SYS_SOCKET_H
401 /* Define to 1 if you have the <sys/stat.h> header file. */
402 #undef HAVE_SYS_STAT_H
404 /* Define to 1 if you have the <sys/sysctl.h> header file. */
405 #undef HAVE_SYS_SYSCTL_H
407 /* Define to 1 if you have the <sys/types.h> header file. */
408 #undef HAVE_SYS_TYPES_H
410 /* Define to 1 if you have the <sys/uio.h> header file. */
411 #undef HAVE_SYS_UIO_H
413 /* Define to 1 if you have the <sys/un.h> header file. */
416 /* Define to 1 if you have the <sys/wait.h> header file. */
417 #undef HAVE_SYS_WAIT_H
419 /* Define to 1 if you have the <time.h> header file. */
422 /* Define to 1 if you have the `tzset' function. */
425 /* Define to 1 if you have the <unistd.h> header file. */
428 /* Define to 1 if you have the `usleep' function. */
431 /* Define to 1 if you have the `vfork' function. */
434 /* Define to 1 if you have the <vfork.h> header file. */
437 /* Define to 1 if you have the <windows.h> header file. */
438 #undef HAVE_WINDOWS_H
440 /* Using Windows threads */
441 #undef HAVE_WINDOWS_THREADS
443 /* Define to 1 if you have the <winsock2.h> header file. */
444 #undef HAVE_WINSOCK2_H
446 /* Define to 1 if `fork' works. */
447 #undef HAVE_WORKING_FORK
449 /* Define to 1 if `vfork' works. */
450 #undef HAVE_WORKING_VFORK
452 /* Define to 1 if you have the `writev' function. */
455 /* Define to 1 if you have the <ws2tcpip.h> header file. */
456 #undef HAVE_WS2TCPIP_H
458 /* Define to 1 if you have the `_beginthreadex' function. */
459 #undef HAVE__BEGINTHREADEX
461 /* if lex has yylex_destroy */
462 #undef LEX_HAS_YYLEX_DESTROY
464 /* Define to the sub-directory in which libtool stores uninstalled libraries.
468 /* Define to the maximum message length to pass to syslog. */
469 #undef MAXSYSLOGMSGLEN
471 /* Define if memcmp() does not compare unsigned bytes */
472 #undef MEMCMP_IS_BROKEN
474 /* Define if mkdir has one argument. */
475 #undef MKDIR_HAS_ONE_ARG
477 /* Define if the network stack does not fully support nonblocking io (causes
478 lower performance). */
479 #undef NONBLOCKING_IS_BROKEN
481 /* Put -D_ALL_SOURCE define in config.h */
482 #undef OMITTED__D_ALL_SOURCE
484 /* Put -D_BSD_SOURCE define in config.h */
485 #undef OMITTED__D_BSD_SOURCE
487 /* Put -D_GNU_SOURCE define in config.h */
488 #undef OMITTED__D_GNU_SOURCE
490 /* Put -D_LARGEFILE_SOURCE=1 define in config.h */
491 #undef OMITTED__D_LARGEFILE_SOURCE_1
493 /* Put -D_POSIX_C_SOURCE=200112 define in config.h */
494 #undef OMITTED__D_POSIX_C_SOURCE_200112
496 /* Put -D_XOPEN_SOURCE=600 define in config.h */
497 #undef OMITTED__D_XOPEN_SOURCE_600
499 /* Put -D_XOPEN_SOURCE_EXTENDED=1 define in config.h */
500 #undef OMITTED__D_XOPEN_SOURCE_EXTENDED_1
502 /* Put -D__EXTENSIONS__ define in config.h */
503 #undef OMITTED__D__EXTENSIONS__
505 /* Define to the address where bug reports for this package should be sent. */
506 #undef PACKAGE_BUGREPORT
508 /* Define to the full name of this package. */
511 /* Define to the full name and version of this package. */
512 #undef PACKAGE_STRING
514 /* Define to the one symbol short name of this package. */
515 #undef PACKAGE_TARNAME
517 /* Define to the home page for this package. */
520 /* Define to the version of this package. */
521 #undef PACKAGE_VERSION
523 /* default pidfile location */
526 /* Define to necessary symbol if this constant uses a non-standard name on
528 #undef PTHREAD_CREATE_JOINABLE
530 /* Define as the return type of signal handlers (`int' or `void'). */
533 /* default rootkey location */
534 #undef ROOT_ANCHOR_FILE
536 /* default rootcert location */
537 #undef ROOT_CERT_FILE
539 /* version number for resource files */
540 #undef RSRC_PACKAGE_VERSION
542 /* Directory to chdir to */
548 /* The size of `time_t', as computed by sizeof. */
551 /* define if (v)snprintf does not return length needed, (but length used) */
552 #undef SNPRINTF_RET_BROKEN
554 /* Define to 1 if you have the ANSI C header files. */
557 /* use default strptime. */
558 #undef STRPTIME_WORKS
560 /* Use win32 resources and API */
563 /* default username */
566 /* use to enable lightweight alloc assertions, for debug use */
567 #undef UNBOUND_ALLOC_LITE
569 /* use malloc not regions, for debug use */
570 #undef UNBOUND_ALLOC_NONREGIONAL
572 /* use statistics for allocs and frees, for debug use */
573 #undef UNBOUND_ALLOC_STATS
575 /* define this to enable debug checks. */
578 /* Define to 1 to enable dnstap support */
581 /* Define this to enable ECDSA support. */
584 /* Define this to enable an EVP workaround for older openssl */
585 #undef USE_ECDSA_EVP_WORKAROUND
587 /* Define this to enable GOST support. */
590 /* Define if you want to use internal select based events */
591 #undef USE_MINI_EVENT
593 /* Define this to enable SHA256 and SHA512 support. */
596 /* Enable extensions on AIX 3, Interix. */
600 /* Enable GNU extensions on systems that have them. */
604 /* Enable threading extensions on Solaris. */
605 #ifndef _POSIX_PTHREAD_SEMANTICS
606 # undef _POSIX_PTHREAD_SEMANTICS
608 /* Enable extensions on HP NonStop. */
609 #ifndef _TANDEM_SOURCE
610 # undef _TANDEM_SOURCE
612 /* Enable general extensions on Solaris. */
613 #ifndef __EXTENSIONS__
614 # undef __EXTENSIONS__
618 /* Whether the windows socket API is used */
621 /* the version of the windows API enabled */
624 /* Define if you want Python module. */
625 #undef WITH_PYTHONMODULE
627 /* Define if you want PyUnbound. */
628 #undef WITH_PYUNBOUND
630 /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
632 #undef YYTEXT_POINTER
634 /* Enable large inode numbers on Mac OS X 10.5. */
635 #ifndef _DARWIN_USE_64_BIT_INODE
636 # define _DARWIN_USE_64_BIT_INODE 1
639 /* Number of bits in a file offset, on hosts where this is settable. */
640 #undef _FILE_OFFSET_BITS
642 /* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
643 #undef _LARGEFILE_SOURCE
645 /* Define for large files, on AIX-style hosts. */
648 /* Define to 1 if on MINIX. */
651 /* Enable for compile on Minix */
652 #undef _NETBSD_SOURCE
654 /* Define to 2 if the system does not provide POSIX.1 features except with
656 #undef _POSIX_1_SOURCE
658 /* Define to 1 if you need to in order for `stat' and other things to work. */
661 /* Define to empty if `const' does not conform to ANSI C. */
664 /* Define to `int' if <sys/types.h> doesn't define. */
673 /* Define to `__inline__' or `__inline' if that's what the C compiler
674 calls it, or to nothing if 'inline' is not supported under any name. */
679 /* Define to `short' if <sys/types.h> does not define. */
682 /* Define to `int' if <sys/types.h> does not define. */
685 /* Define to `long long' if <sys/types.h> does not define. */
688 /* Define to `signed char' if <sys/types.h> does not define. */
691 /* Define if replacement function should be used. */
694 /* Define to `long int' if <sys/types.h> does not define. */
697 /* Define to `int' if <sys/types.h> does not define. */
700 /* Define to 'int' if not defined */
703 /* Define to `unsigned int' if <sys/types.h> does not define. */
706 /* Define to 'int' if not defined */
709 /* Define to `int' if <sys/types.h> does not define. */
712 /* Define to 'unsigned char if not defined */
715 /* Define to `int' if <sys/types.h> doesn't define. */
718 /* Define to `unsigned short' if <sys/types.h> does not define. */
721 /* Define to `unsigned int' if <sys/types.h> does not define. */
724 /* Define to `unsigned long long' if <sys/types.h> does not define. */
727 /* Define to `unsigned char' if <sys/types.h> does not define. */
730 /* Define as `fork' if `vfork' does not work. */
733 #if defined(OMITTED__D_GNU_SOURCE) && !defined(_GNU_SOURCE)
734 #define _GNU_SOURCE 1
737 #if defined(OMITTED__D_BSD_SOURCE) && !defined(_BSD_SOURCE)
738 #define _BSD_SOURCE 1
741 #if defined(OMITTED__D__EXTENSIONS__) && !defined(__EXTENSIONS__)
742 #define __EXTENSIONS__ 1
745 #if defined(OMITTED__D_POSIX_C_SOURCE_200112) && !defined(_POSIX_C_SOURCE)
746 #define _POSIX_C_SOURCE 200112
749 #if defined(OMITTED__D_XOPEN_SOURCE_600) && !defined(_XOPEN_SOURCE)
750 #define _XOPEN_SOURCE 600
753 #if defined(OMITTED__D_XOPEN_SOURCE_EXTENDED_1) && !defined(_XOPEN_SOURCE_EXTENDED)
754 #define _XOPEN_SOURCE_EXTENDED 1
757 #if defined(OMITTED__D_ALL_SOURCE) && !defined(_ALL_SOURCE)
758 #define _ALL_SOURCE 1
761 #if defined(OMITTED__D_LARGEFILE_SOURCE_1) && !defined(_LARGEFILE_SOURCE)
762 #define _LARGEFILE_SOURCE 1
768 #ifndef UNBOUND_DEBUG
772 /** Use small-ldns codebase */
775 # define LDNS_BUILD_CONFIG_HAVE_SSL 1
799 #include <sys/param.h>
802 #ifdef HAVE_SYS_SOCKET_H
803 #include <sys/socket.h>
806 #ifdef HAVE_SYS_UIO_H
810 #ifdef HAVE_NETINET_IN_H
811 #include <netinet/in.h>
814 #ifdef HAVE_ARPA_INET_H
815 #include <arpa/inet.h>
818 #ifdef HAVE_WINSOCK2_H
819 #include <winsock2.h>
822 #ifdef HAVE_WS2TCPIP_H
823 #include <ws2tcpip.h>
829 #define ARG_LL "%I64"
833 #define AF_LOCAL AF_UNIX
838 #ifdef HAVE_ATTR_FORMAT
839 # define ATTR_FORMAT(archetype, string_index, first_to_check) \
840 __attribute__ ((format (archetype, string_index, first_to_check)))
841 #else /* !HAVE_ATTR_FORMAT */
842 # define ATTR_FORMAT(archetype, string_index, first_to_check) /* empty */
843 #endif /* !HAVE_ATTR_FORMAT */
847 # define ATTR_UNUSED(x) x
848 #elif defined(__cplusplus)
849 # define ATTR_UNUSED(x)
850 #elif defined(HAVE_ATTR_UNUSED)
851 # define ATTR_UNUSED(x) x __attribute__((unused))
852 #else /* !HAVE_ATTR_UNUSED */
853 # define ATTR_UNUSED(x) x
854 #endif /* !HAVE_ATTR_UNUSED */
860 #endif /* HAVE_FSEEKO */
863 #ifndef MAXHOSTNAMELEN
864 #define MAXHOSTNAMELEN 256
867 #if !defined(HAVE_SNPRINTF) || defined(SNPRINTF_RET_BROKEN)
868 #define snprintf snprintf_unbound
869 #define vsnprintf vsnprintf_unbound
871 int snprintf (char *str, size_t count, const char *fmt, ...);
872 int vsnprintf (char *str, size_t count, const char *fmt, va_list arg);
873 #endif /* HAVE_SNPRINTF or SNPRINTF_RET_BROKEN */
875 #ifndef HAVE_INET_PTON
876 #define inet_pton inet_pton_unbound
877 int inet_pton(int af, const char* src, void* dst);
878 #endif /* HAVE_INET_PTON */
881 #ifndef HAVE_INET_NTOP
882 #define inet_ntop inet_ntop_unbound
883 const char *inet_ntop(int af, const void *src, char *dst, size_t size);
887 #ifndef HAVE_INET_ATON
888 #define inet_aton inet_aton_unbound
889 int inet_aton(const char *cp, struct in_addr *addr);
894 #define memmove memmove_unbound
895 void *memmove(void *dest, const void *src, size_t n);
900 #define strlcat strlcat_unbound
901 size_t strlcat(char *dst, const char *src, size_t siz);
906 #define strlcpy strlcpy_unbound
907 size_t strlcpy(char *dst, const char *src, size_t siz);
911 #ifndef HAVE_GMTIME_R
912 #define gmtime_r gmtime_r_unbound
913 struct tm *gmtime_r(const time_t *timep, struct tm *result);
917 #ifndef HAVE_REALLOCARRAY
918 #define reallocarray reallocarrayunbound
919 void* reallocarray(void *ptr, size_t nmemb, size_t size);
923 #if !defined(HAVE_SLEEP) || defined(HAVE_WINDOWS_H)
924 #define sleep(x) Sleep((x)*1000) /* on win32 */
925 #endif /* HAVE_SLEEP */
929 #define usleep(x) Sleep((x)/1000 + 1) /* on win32 */
930 #endif /* HAVE_USLEEP */
934 #define random rand /* on win32, for tests only (bad random) */
935 #endif /* HAVE_RANDOM */
939 #define srandom(x) srand(x) /* on win32, for tests only (bad random) */
940 #endif /* HAVE_SRANDOM */
943 /* detect if we need to cast to unsigned int for FD_SET to avoid warnings */
944 #ifdef HAVE_WINSOCK2_H
945 #define FD_SET_T (u_int)
952 #define IPV6_MIN_MTU 1280
953 #endif /* IPV6_MIN_MTU */
956 #ifdef MEMCMP_IS_BROKEN
957 #include "compat/memcmp.h"
958 #define memcmp memcmp_unbound
959 int memcmp(const void *x, const void *y, size_t n);
965 #define ctime_r unbound_ctime_r
966 char *ctime_r(const time_t *timep, char *buf);
970 #define isblank unbound_isblank
974 #if !defined(HAVE_STRPTIME) || !defined(STRPTIME_WORKS)
975 #define strptime unbound_strptime
977 char *strptime(const char *s, const char *format, struct tm *tm);
981 # if !HAVE_DECL_STRLCPY
982 size_t strlcpy(char *dst, const char *src, size_t siz);
984 # if !HAVE_DECL_STRLCAT
985 size_t strlcat(char *dst, const char *src, size_t siz);
987 # if !HAVE_DECL_ARC4RANDOM && defined(HAVE_ARC4RANDOM)
988 uint32_t arc4random(void);
990 # if !HAVE_DECL_ARC4RANDOM_UNIFORM && defined(HAVE_ARC4RANDOM_UNIFORM)
991 uint32_t arc4random_uniform(uint32_t upper_bound);
993 # if !HAVE_DECL_REALLOCARRAY
994 void *reallocarray(void *ptr, size_t nmemb, size_t size);
996 #endif /* HAVE_LIBRESSL */
997 #ifndef HAVE_ARC4RANDOM
998 void explicit_bzero(void* buf, size_t len);
999 int getentropy(void* buf, size_t len);
1000 uint32_t arc4random(void);
1001 void arc4random_buf(void* buf, size_t n);
1002 void _ARC4_LOCK(void);
1003 void _ARC4_UNLOCK(void);
1005 #ifndef HAVE_ARC4RANDOM_UNIFORM
1006 uint32_t arc4random_uniform(uint32_t upper_bound);
1008 #ifdef COMPAT_SHA512
1009 #ifndef SHA512_DIGEST_LENGTH
1010 #define SHA512_BLOCK_LENGTH 128
1011 #define SHA512_DIGEST_LENGTH 64
1012 #define SHA512_DIGEST_STRING_LENGTH (SHA512_DIGEST_LENGTH * 2 + 1)
1013 typedef struct _SHA512_CTX {
1015 uint64_t bitcount[2];
1016 uint8_t buffer[SHA512_BLOCK_LENGTH];
1018 #endif /* SHA512_DIGEST_LENGTH */
1019 void SHA512_Init(SHA512_CTX*);
1020 void SHA512_Update(SHA512_CTX*, void*, size_t);
1021 void SHA512_Final(uint8_t[SHA512_DIGEST_LENGTH], SHA512_CTX*);
1022 unsigned char *SHA512(void* data, unsigned int data_len, unsigned char *digest);
1023 #endif /* COMPAT_SHA512 */
1027 #if defined(HAVE_EVENT_H) && !defined(HAVE_EVENT_BASE_ONCE) && !(defined(HAVE_EV_LOOP) || defined(HAVE_EV_DEFAULT_LOOP)) && (defined(HAVE_PTHREAD) || defined(HAVE_SOLARIS_THREADS))
1028 /* using version of libevent that is not threadsafe. */
1029 # define LIBEVENT_SIGNAL_PROBLEM 1
1032 #ifndef CHECKED_INET6
1033 # define CHECKED_INET6
1037 # define AF_INET6 28
1039 #endif /* CHECKED_INET6 */
1041 #ifndef HAVE_GETADDRINFO
1042 struct sockaddr_storage;
1043 #include "compat/fake-rfc2553.h"
1046 #ifdef UNBOUND_ALLOC_STATS
1047 # define malloc(s) unbound_stat_malloc_log(s, __FILE__, __LINE__, __func__)
1048 # define calloc(n,s) unbound_stat_calloc_log(n, s, __FILE__, __LINE__, __func__)
1049 # define free(p) unbound_stat_free_log(p, __FILE__, __LINE__, __func__)
1050 # define realloc(p,s) unbound_stat_realloc_log(p, s, __FILE__, __LINE__, __func__)
1051 void *unbound_stat_malloc(size_t size);
1052 void *unbound_stat_calloc(size_t nmemb, size_t size);
1053 void unbound_stat_free(void *ptr);
1054 void *unbound_stat_realloc(void *ptr, size_t size);
1055 void *unbound_stat_malloc_log(size_t size, const char* file, int line,
1057 void *unbound_stat_calloc_log(size_t nmemb, size_t size, const char* file,
1058 int line, const char* func);
1059 void unbound_stat_free_log(void *ptr, const char* file, int line,
1061 void *unbound_stat_realloc_log(void *ptr, size_t size, const char* file,
1062 int line, const char* func);
1063 #elif defined(UNBOUND_ALLOC_LITE)
1064 # include "util/alloc.h"
1065 #endif /* UNBOUND_ALLOC_LITE and UNBOUND_ALLOC_STATS */
1067 /** default port for DNS traffic. */
1068 #define UNBOUND_DNS_PORT 53
1069 /** default port for unbound control traffic, registered port with IANA,
1070 ub-dns-control 8953/tcp unbound dns nameserver control */
1071 #define UNBOUND_CONTROL_PORT 8953
1072 /** the version of unbound-control that this software implements */
1073 #define UNBOUND_CONTROL_VERSION 1