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 `sk_SSL_COMP_pop_free', and to 0
75 #undef HAVE_DECL_SK_SSL_COMP_POP_FREE
77 /* Define to 1 if you have the declaration of
78 `SSL_COMP_get_compression_methods', and to 0 if you don't. */
79 #undef HAVE_DECL_SSL_COMP_GET_COMPRESSION_METHODS
81 /* Define to 1 if you have the declaration of `strlcat', and to 0 if you
83 #undef HAVE_DECL_STRLCAT
85 /* Define to 1 if you have the declaration of `strlcpy', and to 0 if you
87 #undef HAVE_DECL_STRLCPY
89 /* Define to 1 if you have the <dlfcn.h> header file. */
92 /* Define to 1 if you have the <endian.h> header file. */
95 /* Define to 1 if you have the `endprotoent' function. */
96 #undef HAVE_ENDPROTOENT
98 /* Define to 1 if you have the `endservent' function. */
99 #undef HAVE_ENDSERVENT
101 /* Define to 1 if you have the `event_base_free' function. */
102 #undef HAVE_EVENT_BASE_FREE
104 /* Define to 1 if you have the `event_base_get_method' function. */
105 #undef HAVE_EVENT_BASE_GET_METHOD
107 /* Define to 1 if you have the `event_base_new' function. */
108 #undef HAVE_EVENT_BASE_NEW
110 /* Define to 1 if you have the `event_base_once' function. */
111 #undef HAVE_EVENT_BASE_ONCE
113 /* Define to 1 if you have the <event.h> header file. */
116 /* Define to 1 if you have the `EVP_sha1' function. */
119 /* Define to 1 if you have the `EVP_sha256' function. */
120 #undef HAVE_EVP_SHA256
122 /* Define to 1 if you have the `EVP_sha512' function. */
123 #undef HAVE_EVP_SHA512
125 /* Define to 1 if you have the `ev_default_loop' function. */
126 #undef HAVE_EV_DEFAULT_LOOP
128 /* Define to 1 if you have the `ev_loop' function. */
131 /* Define to 1 if you have the <expat.h> header file. */
134 /* Define to 1 if you have the `fcntl' function. */
137 /* Define to 1 if you have the `FIPS_mode' function. */
138 #undef HAVE_FIPS_MODE
140 /* Define to 1 if you have the `fork' function. */
143 /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
146 /* Whether getaddrinfo is available */
147 #undef HAVE_GETADDRINFO
149 /* Define to 1 if you have the `getauxval' function. */
150 #undef HAVE_GETAUXVAL
152 /* Define to 1 if you have the `getentropy' function. */
153 #undef HAVE_GETENTROPY
155 /* Define to 1 if you have the <getopt.h> header file. */
158 /* Define to 1 if you have the `getpwnam' function. */
161 /* Define to 1 if you have the `getrlimit' function. */
162 #undef HAVE_GETRLIMIT
164 /* Define to 1 if you have the `glob' function. */
167 /* Define to 1 if you have the <glob.h> header file. */
170 /* Define to 1 if you have the `gmtime_r' function. */
173 /* Define to 1 if you have the <grp.h> header file. */
176 /* If you have HMAC_CTX_init */
177 #undef HAVE_HMAC_CTX_INIT
179 /* Define to 1 if you have the `inet_aton' function. */
180 #undef HAVE_INET_ATON
182 /* Define to 1 if you have the `inet_ntop' function. */
183 #undef HAVE_INET_NTOP
185 /* Define to 1 if you have the `inet_pton' function. */
186 #undef HAVE_INET_PTON
188 /* Define to 1 if you have the `initgroups' function. */
189 #undef HAVE_INITGROUPS
191 /* Define to 1 if you have the <inttypes.h> header file. */
192 #undef HAVE_INTTYPES_H
194 /* if the function 'ioctlsocket' is available */
195 #undef HAVE_IOCTLSOCKET
197 /* Define to 1 if you have the <iphlpapi.h> header file. */
198 #undef HAVE_IPHLPAPI_H
200 /* Define to 1 if you have the `kill' function. */
203 /* Define if we have LibreSSL */
206 /* Define to 1 if you have the `localtime_r' function. */
207 #undef HAVE_LOCALTIME_R
209 /* Define to 1 if you have the <login_cap.h> header file. */
210 #undef HAVE_LOGIN_CAP_H
212 /* If have GNU libc compatible malloc */
215 /* Define to 1 if you have the `memmove' function. */
218 /* Define to 1 if you have the <memory.h> header file. */
221 /* Define to 1 if you have the <netdb.h> header file. */
224 /* Define to 1 if you have the <netinet/in.h> header file. */
225 #undef HAVE_NETINET_IN_H
227 /* Use libnss for crypto */
230 /* Define to 1 if you have the `OPENSSL_config' function. */
231 #undef HAVE_OPENSSL_CONFIG
233 /* Define to 1 if you have the <openssl/conf.h> header file. */
234 #undef HAVE_OPENSSL_CONF_H
236 /* Define to 1 if you have the <openssl/engine.h> header file. */
237 #undef HAVE_OPENSSL_ENGINE_H
239 /* Define to 1 if you have the <openssl/err.h> header file. */
240 #undef HAVE_OPENSSL_ERR_H
242 /* Define to 1 if you have the <openssl/rand.h> header file. */
243 #undef HAVE_OPENSSL_RAND_H
245 /* Define to 1 if you have the <openssl/ssl.h> header file. */
246 #undef HAVE_OPENSSL_SSL_H
248 /* Define if you have POSIX threads libraries and header files. */
251 /* Have PTHREAD_PRIO_INHERIT. */
252 #undef HAVE_PTHREAD_PRIO_INHERIT
254 /* Define to 1 if the system has the type `pthread_rwlock_t'. */
255 #undef HAVE_PTHREAD_RWLOCK_T
257 /* Define to 1 if the system has the type `pthread_spinlock_t'. */
258 #undef HAVE_PTHREAD_SPINLOCK_T
260 /* Define to 1 if you have the <pwd.h> header file. */
263 /* Define if you have Python libraries and header files. */
266 /* Define to 1 if you have the `random' function. */
269 /* Define to 1 if you have the `recvmsg' function. */
272 /* Define to 1 if you have the `sbrk' function. */
275 /* Define to 1 if you have the `sendmsg' function. */
278 /* Define to 1 if you have the `setregid' function. */
281 /* Define to 1 if you have the `setresgid' function. */
282 #undef HAVE_SETRESGID
284 /* Define to 1 if you have the `setresuid' function. */
285 #undef HAVE_SETRESUID
287 /* Define to 1 if you have the `setreuid' function. */
290 /* Define to 1 if you have the `setrlimit' function. */
291 #undef HAVE_SETRLIMIT
293 /* Define to 1 if you have the `setsid' function. */
296 /* Define to 1 if you have the `setusercontext' function. */
297 #undef HAVE_SETUSERCONTEXT
299 /* Define to 1 if you have the `SHA512_Update' function. */
300 #undef HAVE_SHA512_UPDATE
302 /* Define to 1 if you have the `sigprocmask' function. */
303 #undef HAVE_SIGPROCMASK
305 /* Define to 1 if you have the `sleep' function. */
308 /* Define to 1 if you have the `snprintf' function. */
311 /* Define to 1 if you have the `socketpair' function. */
312 #undef HAVE_SOCKETPAIR
314 /* Using Solaris threads */
315 #undef HAVE_SOLARIS_THREADS
317 /* Define to 1 if you have the `srandom' function. */
320 /* Define if you have the SSL libraries installed. */
323 /* Define to 1 if you have the <stdarg.h> header file. */
326 /* Define to 1 if you have the <stdbool.h> header file. */
327 #undef HAVE_STDBOOL_H
329 /* Define to 1 if you have the <stdint.h> header file. */
332 /* Define to 1 if you have the <stdlib.h> header file. */
335 /* Define to 1 if you have the `strftime' function. */
338 /* Define to 1 if you have the <strings.h> header file. */
339 #undef HAVE_STRINGS_H
341 /* Define to 1 if you have the <string.h> header file. */
344 /* Define to 1 if you have the `strlcat' function. */
347 /* Define to 1 if you have the `strlcpy' function. */
350 /* Define to 1 if you have the `strptime' function. */
353 /* Define to 1 if `ipi_spec_dst' is a member of `struct in_pktinfo'. */
354 #undef HAVE_STRUCT_IN_PKTINFO_IPI_SPEC_DST
356 /* Define to 1 if `sun_len' is a member of `struct sockaddr_un'. */
357 #undef HAVE_STRUCT_SOCKADDR_UN_SUN_LEN
359 /* Define if you have Swig libraries and header files. */
362 /* Define to 1 if you have the <syslog.h> header file. */
365 /* Define to 1 if you have the <sys/param.h> header file. */
366 #undef HAVE_SYS_PARAM_H
368 /* Define to 1 if you have the <sys/resource.h> header file. */
369 #undef HAVE_SYS_RESOURCE_H
371 /* Define to 1 if you have the <sys/sha2.h> header file. */
372 #undef HAVE_SYS_SHA2_H
374 /* Define to 1 if you have the <sys/socket.h> header file. */
375 #undef HAVE_SYS_SOCKET_H
377 /* Define to 1 if you have the <sys/stat.h> header file. */
378 #undef HAVE_SYS_STAT_H
380 /* Define to 1 if you have the <sys/sysctl.h> header file. */
381 #undef HAVE_SYS_SYSCTL_H
383 /* Define to 1 if you have the <sys/types.h> header file. */
384 #undef HAVE_SYS_TYPES_H
386 /* Define to 1 if you have the <sys/uio.h> header file. */
387 #undef HAVE_SYS_UIO_H
389 /* Define to 1 if you have the <sys/un.h> header file. */
392 /* Define to 1 if you have the <sys/wait.h> header file. */
393 #undef HAVE_SYS_WAIT_H
395 /* Define to 1 if you have the <time.h> header file. */
398 /* Define to 1 if you have the `tzset' function. */
401 /* Define to 1 if you have the <unistd.h> header file. */
404 /* Define to 1 if you have the `usleep' function. */
407 /* Define to 1 if you have the `vfork' function. */
410 /* Define to 1 if you have the <vfork.h> header file. */
413 /* Define to 1 if you have the <windows.h> header file. */
414 #undef HAVE_WINDOWS_H
416 /* Using Windows threads */
417 #undef HAVE_WINDOWS_THREADS
419 /* Define to 1 if you have the <winsock2.h> header file. */
420 #undef HAVE_WINSOCK2_H
422 /* Define to 1 if `fork' works. */
423 #undef HAVE_WORKING_FORK
425 /* Define to 1 if `vfork' works. */
426 #undef HAVE_WORKING_VFORK
428 /* Define to 1 if you have the `writev' function. */
431 /* Define to 1 if you have the <ws2tcpip.h> header file. */
432 #undef HAVE_WS2TCPIP_H
434 /* Define to 1 if you have the `_beginthreadex' function. */
435 #undef HAVE__BEGINTHREADEX
437 /* if lex has yylex_destroy */
438 #undef LEX_HAS_YYLEX_DESTROY
440 /* Define to the sub-directory in which libtool stores uninstalled libraries.
444 /* Define to the maximum message length to pass to syslog. */
445 #undef MAXSYSLOGMSGLEN
447 /* Define if memcmp() does not compare unsigned bytes */
448 #undef MEMCMP_IS_BROKEN
450 /* Define if mkdir has one argument. */
451 #undef MKDIR_HAS_ONE_ARG
453 /* Define if the network stack does not fully support nonblocking io (causes
454 lower performance). */
455 #undef NONBLOCKING_IS_BROKEN
457 /* Put -D_ALL_SOURCE define in config.h */
458 #undef OMITTED__D_ALL_SOURCE
460 /* Put -D_BSD_SOURCE define in config.h */
461 #undef OMITTED__D_BSD_SOURCE
463 /* Put -D_GNU_SOURCE define in config.h */
464 #undef OMITTED__D_GNU_SOURCE
466 /* Put -D_LARGEFILE_SOURCE=1 define in config.h */
467 #undef OMITTED__D_LARGEFILE_SOURCE_1
469 /* Put -D_POSIX_C_SOURCE=200112 define in config.h */
470 #undef OMITTED__D_POSIX_C_SOURCE_200112
472 /* Put -D_XOPEN_SOURCE=600 define in config.h */
473 #undef OMITTED__D_XOPEN_SOURCE_600
475 /* Put -D_XOPEN_SOURCE_EXTENDED=1 define in config.h */
476 #undef OMITTED__D_XOPEN_SOURCE_EXTENDED_1
478 /* Put -D__EXTENSIONS__ define in config.h */
479 #undef OMITTED__D__EXTENSIONS__
481 /* Define to the address where bug reports for this package should be sent. */
482 #undef PACKAGE_BUGREPORT
484 /* Define to the full name of this package. */
487 /* Define to the full name and version of this package. */
488 #undef PACKAGE_STRING
490 /* Define to the one symbol short name of this package. */
491 #undef PACKAGE_TARNAME
493 /* Define to the home page for this package. */
496 /* Define to the version of this package. */
497 #undef PACKAGE_VERSION
499 /* default pidfile location */
502 /* Define to necessary symbol if this constant uses a non-standard name on
504 #undef PTHREAD_CREATE_JOINABLE
506 /* Define as the return type of signal handlers (`int' or `void'). */
509 /* default rootkey location */
510 #undef ROOT_ANCHOR_FILE
512 /* default rootcert location */
513 #undef ROOT_CERT_FILE
515 /* version number for resource files */
516 #undef RSRC_PACKAGE_VERSION
518 /* Directory to chdir to */
524 /* The size of `time_t', as computed by sizeof. */
527 /* Define to 1 if you have the ANSI C header files. */
530 /* use default strptime. */
531 #undef STRPTIME_WORKS
533 /* Use win32 resources and API */
536 /* default username */
539 /* use to enable lightweight alloc assertions, for debug use */
540 #undef UNBOUND_ALLOC_LITE
542 /* use malloc not regions, for debug use */
543 #undef UNBOUND_ALLOC_NONREGIONAL
545 /* use statistics for allocs and frees, for debug use */
546 #undef UNBOUND_ALLOC_STATS
548 /* define this to enable debug checks. */
551 /* Define to 1 to enable dnstap support */
554 /* Define this to enable ECDSA support. */
557 /* Define this to enable an EVP workaround for older openssl */
558 #undef USE_ECDSA_EVP_WORKAROUND
560 /* Define this to enable GOST support. */
563 /* Define if you want to use internal select based events */
564 #undef USE_MINI_EVENT
566 /* Define this to enable SHA256 and SHA512 support. */
569 /* Enable extensions on AIX 3, Interix. */
573 /* Enable GNU extensions on systems that have them. */
577 /* Enable threading extensions on Solaris. */
578 #ifndef _POSIX_PTHREAD_SEMANTICS
579 # undef _POSIX_PTHREAD_SEMANTICS
581 /* Enable extensions on HP NonStop. */
582 #ifndef _TANDEM_SOURCE
583 # undef _TANDEM_SOURCE
585 /* Enable general extensions on Solaris. */
586 #ifndef __EXTENSIONS__
587 # undef __EXTENSIONS__
591 /* Whether the windows socket API is used */
594 /* the version of the windows API enabled */
597 /* Define if you want Python module. */
598 #undef WITH_PYTHONMODULE
600 /* Define if you want PyUnbound. */
601 #undef WITH_PYUNBOUND
603 /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
605 #undef YYTEXT_POINTER
607 /* Enable large inode numbers on Mac OS X 10.5. */
608 #ifndef _DARWIN_USE_64_BIT_INODE
609 # define _DARWIN_USE_64_BIT_INODE 1
612 /* Number of bits in a file offset, on hosts where this is settable. */
613 #undef _FILE_OFFSET_BITS
615 /* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
616 #undef _LARGEFILE_SOURCE
618 /* Define for large files, on AIX-style hosts. */
621 /* Define to 1 if on MINIX. */
624 /* Enable for compile on Minix */
625 #undef _NETBSD_SOURCE
627 /* Define to 2 if the system does not provide POSIX.1 features except with
629 #undef _POSIX_1_SOURCE
631 /* Define to 1 if you need to in order for `stat' and other things to work. */
634 /* Define to empty if `const' does not conform to ANSI C. */
637 /* Define to `int' if <sys/types.h> doesn't define. */
646 /* Define to `__inline__' or `__inline' if that's what the C compiler
647 calls it, or to nothing if 'inline' is not supported under any name. */
652 /* Define to `short' if <sys/types.h> does not define. */
655 /* Define to `int' if <sys/types.h> does not define. */
658 /* Define to `long long' if <sys/types.h> does not define. */
661 /* Define to `signed char' if <sys/types.h> does not define. */
664 /* Define if replacement function should be used. */
667 /* Define to `long int' if <sys/types.h> does not define. */
670 /* Define to `int' if <sys/types.h> does not define. */
673 /* Define to 'int' if not defined */
676 /* Define to `unsigned int' if <sys/types.h> does not define. */
679 /* Define to 'int' if not defined */
682 /* Define to `int' if <sys/types.h> does not define. */
685 /* Define to 'unsigned char if not defined */
688 /* Define to `int' if <sys/types.h> doesn't define. */
691 /* Define to `unsigned short' if <sys/types.h> does not define. */
694 /* Define to `unsigned int' if <sys/types.h> does not define. */
697 /* Define to `unsigned long long' if <sys/types.h> does not define. */
700 /* Define to `unsigned char' if <sys/types.h> does not define. */
703 /* Define as `fork' if `vfork' does not work. */
706 #if defined(OMITTED__D_GNU_SOURCE) && !defined(_GNU_SOURCE)
707 #define _GNU_SOURCE 1
710 #if defined(OMITTED__D_BSD_SOURCE) && !defined(_BSD_SOURCE)
711 #define _BSD_SOURCE 1
714 #if defined(OMITTED__D__EXTENSIONS__) && !defined(__EXTENSIONS__)
715 #define __EXTENSIONS__ 1
718 #if defined(OMITTED__D_POSIX_C_SOURCE_200112) && !defined(_POSIX_C_SOURCE)
719 #define _POSIX_C_SOURCE 200112
722 #if defined(OMITTED__D_XOPEN_SOURCE_600) && !defined(_XOPEN_SOURCE)
723 #define _XOPEN_SOURCE 600
726 #if defined(OMITTED__D_XOPEN_SOURCE_EXTENDED_1) && !defined(_XOPEN_SOURCE_EXTENDED)
727 #define _XOPEN_SOURCE_EXTENDED 1
730 #if defined(OMITTED__D_ALL_SOURCE) && !defined(_ALL_SOURCE)
731 #define _ALL_SOURCE 1
734 #if defined(OMITTED__D_LARGEFILE_SOURCE_1) && !defined(_LARGEFILE_SOURCE)
735 #define _LARGEFILE_SOURCE 1
741 #ifndef UNBOUND_DEBUG
745 /** Use small-ldns codebase */
748 # define LDNS_BUILD_CONFIG_HAVE_SSL 1
772 #include <sys/param.h>
775 #ifdef HAVE_SYS_SOCKET_H
776 #include <sys/socket.h>
779 #ifdef HAVE_SYS_UIO_H
783 #ifdef HAVE_NETINET_IN_H
784 #include <netinet/in.h>
787 #ifdef HAVE_ARPA_INET_H
788 #include <arpa/inet.h>
791 #ifdef HAVE_WINSOCK2_H
792 #include <winsock2.h>
795 #ifdef HAVE_WS2TCPIP_H
796 #include <ws2tcpip.h>
802 #define ARG_LL "%I64"
806 #define AF_LOCAL AF_UNIX
811 #ifdef HAVE_ATTR_FORMAT
812 # define ATTR_FORMAT(archetype, string_index, first_to_check) \
813 __attribute__ ((format (archetype, string_index, first_to_check)))
814 #else /* !HAVE_ATTR_FORMAT */
815 # define ATTR_FORMAT(archetype, string_index, first_to_check) /* empty */
816 #endif /* !HAVE_ATTR_FORMAT */
820 # define ATTR_UNUSED(x) x
821 #elif defined(__cplusplus)
822 # define ATTR_UNUSED(x)
823 #elif defined(HAVE_ATTR_UNUSED)
824 # define ATTR_UNUSED(x) x __attribute__((unused))
825 #else /* !HAVE_ATTR_UNUSED */
826 # define ATTR_UNUSED(x) x
827 #endif /* !HAVE_ATTR_UNUSED */
833 #endif /* HAVE_FSEEKO */
836 #ifndef MAXHOSTNAMELEN
837 #define MAXHOSTNAMELEN 256
841 #ifndef HAVE_SNPRINTF
842 #define snprintf snprintf_unbound
843 #define vsnprintf vsnprintf_unbound
845 int snprintf (char *str, size_t count, const char *fmt, ...);
846 int vsnprintf (char *str, size_t count, const char *fmt, va_list arg);
847 #endif /* HAVE_SNPRINTF */
850 #ifndef HAVE_INET_PTON
851 #define inet_pton inet_pton_unbound
852 int inet_pton(int af, const char* src, void* dst);
853 #endif /* HAVE_INET_PTON */
856 #ifndef HAVE_INET_NTOP
857 #define inet_ntop inet_ntop_unbound
858 const char *inet_ntop(int af, const void *src, char *dst, size_t size);
862 #ifndef HAVE_INET_ATON
863 #define inet_aton inet_aton_unbound
864 int inet_aton(const char *cp, struct in_addr *addr);
869 #define memmove memmove_unbound
870 void *memmove(void *dest, const void *src, size_t n);
875 #define strlcat strlcat_unbound
876 size_t strlcat(char *dst, const char *src, size_t siz);
881 #define strlcpy strlcpy_unbound
882 size_t strlcpy(char *dst, const char *src, size_t siz);
886 #ifndef HAVE_GMTIME_R
887 #define gmtime_r gmtime_r_unbound
888 struct tm *gmtime_r(const time_t *timep, struct tm *result);
892 #if !defined(HAVE_SLEEP) || defined(HAVE_WINDOWS_H)
893 #define sleep(x) Sleep((x)*1000) /* on win32 */
894 #endif /* HAVE_SLEEP */
898 #define usleep(x) Sleep((x)/1000 + 1) /* on win32 */
899 #endif /* HAVE_USLEEP */
903 #define random rand /* on win32, for tests only (bad random) */
904 #endif /* HAVE_RANDOM */
908 #define srandom(x) srand(x) /* on win32, for tests only (bad random) */
909 #endif /* HAVE_SRANDOM */
912 /* detect if we need to cast to unsigned int for FD_SET to avoid warnings */
913 #ifdef HAVE_WINSOCK2_H
914 #define FD_SET_T (u_int)
921 #define IPV6_MIN_MTU 1280
922 #endif /* IPV6_MIN_MTU */
925 #ifdef MEMCMP_IS_BROKEN
926 #include "compat/memcmp.h"
927 #define memcmp memcmp_unbound
928 int memcmp(const void *x, const void *y, size_t n);
934 #define ctime_r unbound_ctime_r
935 char *ctime_r(const time_t *timep, char *buf);
938 #if !defined(HAVE_STRPTIME) || !defined(STRPTIME_WORKS)
939 #define strptime unbound_strptime
941 char *strptime(const char *s, const char *format, struct tm *tm);
945 # if !HAVE_DECL_STRLCPY
946 size_t strlcpy(char *dst, const char *src, size_t siz);
948 # if !HAVE_DECL_STRLCAT
949 size_t strlcat(char *dst, const char *src, size_t siz);
951 # if !HAVE_DECL_ARC4RANDOM && defined(HAVE_ARC4RANDOM)
952 uint32_t arc4random(void);
954 # if !HAVE_DECL_ARC4RANDOM_UNIFORM && defined(HAVE_ARC4RANDOM_UNIFORM)
955 uint32_t arc4random_uniform(uint32_t upper_bound);
957 #endif /* HAVE_LIBRESSL */
958 #ifndef HAVE_ARC4RANDOM
959 void explicit_bzero(void* buf, size_t len);
960 int getentropy(void* buf, size_t len);
961 uint32_t arc4random(void);
962 void arc4random_buf(void* buf, size_t n);
963 void _ARC4_LOCK(void);
964 void _ARC4_UNLOCK(void);
966 #ifndef HAVE_ARC4RANDOM_UNIFORM
967 uint32_t arc4random_uniform(uint32_t upper_bound);
970 #ifndef SHA512_DIGEST_LENGTH
971 #define SHA512_BLOCK_LENGTH 128
972 #define SHA512_DIGEST_LENGTH 64
973 #define SHA512_DIGEST_STRING_LENGTH (SHA512_DIGEST_LENGTH * 2 + 1)
974 typedef struct _SHA512_CTX {
976 uint64_t bitcount[2];
977 uint8_t buffer[SHA512_BLOCK_LENGTH];
979 #endif /* SHA512_DIGEST_LENGTH */
980 void SHA512_Init(SHA512_CTX*);
981 void SHA512_Update(SHA512_CTX*, void*, size_t);
982 void SHA512_Final(uint8_t[SHA512_DIGEST_LENGTH], SHA512_CTX*);
983 unsigned char *SHA512(void* data, unsigned int data_len, unsigned char *digest);
984 #endif /* COMPAT_SHA512 */
988 #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))
989 /* using version of libevent that is not threadsafe. */
990 # define LIBEVENT_SIGNAL_PROBLEM 1
993 #ifndef CHECKED_INET6
994 # define CHECKED_INET6
1000 #endif /* CHECKED_INET6 */
1002 #ifndef HAVE_GETADDRINFO
1003 struct sockaddr_storage;
1004 #include "compat/fake-rfc2553.h"
1007 #ifdef UNBOUND_ALLOC_STATS
1008 # define malloc(s) unbound_stat_malloc_log(s, __FILE__, __LINE__, __func__)
1009 # define calloc(n,s) unbound_stat_calloc_log(n, s, __FILE__, __LINE__, __func__)
1010 # define free(p) unbound_stat_free_log(p, __FILE__, __LINE__, __func__)
1011 # define realloc(p,s) unbound_stat_realloc_log(p, s, __FILE__, __LINE__, __func__)
1012 void *unbound_stat_malloc(size_t size);
1013 void *unbound_stat_calloc(size_t nmemb, size_t size);
1014 void unbound_stat_free(void *ptr);
1015 void *unbound_stat_realloc(void *ptr, size_t size);
1016 void *unbound_stat_malloc_log(size_t size, const char* file, int line,
1018 void *unbound_stat_calloc_log(size_t nmemb, size_t size, const char* file,
1019 int line, const char* func);
1020 void unbound_stat_free_log(void *ptr, const char* file, int line,
1022 void *unbound_stat_realloc_log(void *ptr, size_t size, const char* file,
1023 int line, const char* func);
1024 #elif defined(UNBOUND_ALLOC_LITE)
1025 # include "util/alloc.h"
1026 #endif /* UNBOUND_ALLOC_LITE and UNBOUND_ALLOC_STATS */
1028 /** default port for DNS traffic. */
1029 #define UNBOUND_DNS_PORT 53
1030 /** default port for unbound control traffic, registered port with IANA,
1031 ub-dns-control 8953/tcp unbound dns nameserver control */
1032 #define UNBOUND_CONTROL_PORT 8953
1033 /** the version of unbound-control that this software implements */
1034 #define UNBOUND_CONTROL_VERSION 1