1 /* config.h.in. Generated from configure.ac by autoheader. */
3 /* Directory to chroot to */
6 /* Define this to enable client subnet option. */
9 /* Do sha512 definitions in config.h */
12 /* Pathname to the Unbound configuration file */
15 /* Define this if on macOSX10.4-darwin8 and setreuid and setregid do not work
17 #undef DARWIN_BROKEN_SETREUID
19 /* Whether daemon is deprecated */
20 #undef DEPRECATED_DAEMON
22 /* default dnstap socket path */
23 #undef DNSTAP_SOCKET_PATH
25 /* Define if you want to use debug lock checking (slow). */
26 #undef ENABLE_LOCK_CHECKS
28 /* Define this if you enabled-allsymbols from libunbound to link binaries to
29 it for smaller install size, but the libunbound export table is polluted by
31 #undef EXPORT_ALL_SYMBOLS
33 /* Define to 1 if you have the `arc4random' function. */
34 #undef HAVE_ARC4RANDOM
36 /* Define to 1 if you have the `arc4random_uniform' function. */
37 #undef HAVE_ARC4RANDOM_UNIFORM
39 /* Define to 1 if you have the <arpa/inet.h> header file. */
40 #undef HAVE_ARPA_INET_H
42 /* Whether the C compiler accepts the "format" attribute */
43 #undef HAVE_ATTR_FORMAT
45 /* Whether the C compiler accepts the "unused" attribute */
46 #undef HAVE_ATTR_UNUSED
48 /* Whether the C compiler accepts the "weak" attribute */
51 /* Define to 1 if you have the `chown' function. */
54 /* Define to 1 if you have the `chroot' function. */
57 /* Define to 1 if you have the `CRYPTO_cleanup_all_ex_data' function. */
58 #undef HAVE_CRYPTO_CLEANUP_ALL_EX_DATA
60 /* Define to 1 if you have the `ctime_r' function. */
63 /* Define to 1 if you have the `daemon' function. */
66 /* Define to 1 if you have the declaration of `arc4random', and to 0 if you
68 #undef HAVE_DECL_ARC4RANDOM
70 /* Define to 1 if you have the declaration of `arc4random_uniform', and to 0
72 #undef HAVE_DECL_ARC4RANDOM_UNIFORM
74 /* Define to 1 if you have the declaration of `inet_ntop', and to 0 if you
76 #undef HAVE_DECL_INET_NTOP
78 /* Define to 1 if you have the declaration of `inet_pton', and to 0 if you
80 #undef HAVE_DECL_INET_PTON
82 /* Define to 1 if you have the declaration of `NID_secp384r1', and to 0 if you
84 #undef HAVE_DECL_NID_SECP384R1
86 /* Define to 1 if you have the declaration of `NID_X9_62_prime256v1', and to 0
88 #undef HAVE_DECL_NID_X9_62_PRIME256V1
90 /* Define to 1 if you have the declaration of `reallocarray', and to 0 if you
92 #undef HAVE_DECL_REALLOCARRAY
94 /* Define to 1 if you have the declaration of `sk_SSL_COMP_pop_free', and to 0
96 #undef HAVE_DECL_SK_SSL_COMP_POP_FREE
98 /* Define to 1 if you have the declaration of
99 `SSL_COMP_get_compression_methods', and to 0 if you don't. */
100 #undef HAVE_DECL_SSL_COMP_GET_COMPRESSION_METHODS
102 /* Define to 1 if you have the declaration of `SSL_CTX_set_ecdh_auto', and to
104 #undef HAVE_DECL_SSL_CTX_SET_ECDH_AUTO
106 /* Define to 1 if you have the declaration of `strlcat', and to 0 if you
108 #undef HAVE_DECL_STRLCAT
110 /* Define to 1 if you have the declaration of `strlcpy', and to 0 if you
112 #undef HAVE_DECL_STRLCPY
114 /* Define to 1 if you have the declaration of `XML_StopParser', and to 0 if
116 #undef HAVE_DECL_XML_STOPPARSER
118 /* Define to 1 if you have the <dlfcn.h> header file. */
121 /* Define to 1 if you have the `DSA_SIG_set0' function. */
122 #undef HAVE_DSA_SIG_SET0
124 /* Define to 1 if you have the <endian.h> header file. */
127 /* Define to 1 if you have the `endprotoent' function. */
128 #undef HAVE_ENDPROTOENT
130 /* Define to 1 if you have the `endpwent' function. */
133 /* Define to 1 if you have the `endservent' function. */
134 #undef HAVE_ENDSERVENT
136 /* Define to 1 if you have the `ERR_free_strings' function. */
137 #undef HAVE_ERR_FREE_STRINGS
139 /* Define to 1 if you have the `ERR_load_crypto_strings' function. */
140 #undef HAVE_ERR_LOAD_CRYPTO_STRINGS
142 /* Define to 1 if you have the `event_base_free' function. */
143 #undef HAVE_EVENT_BASE_FREE
145 /* Define to 1 if you have the `event_base_get_method' function. */
146 #undef HAVE_EVENT_BASE_GET_METHOD
148 /* Define to 1 if you have the `event_base_new' function. */
149 #undef HAVE_EVENT_BASE_NEW
151 /* Define to 1 if you have the `event_base_once' function. */
152 #undef HAVE_EVENT_BASE_ONCE
154 /* Define to 1 if you have the <event.h> header file. */
157 /* Define to 1 if you have the `EVP_cleanup' function. */
158 #undef HAVE_EVP_CLEANUP
160 /* Define to 1 if you have the `EVP_dss1' function. */
163 /* Define to 1 if you have the `EVP_MD_CTX_new' function. */
164 #undef HAVE_EVP_MD_CTX_NEW
166 /* Define to 1 if you have the `EVP_sha1' function. */
169 /* Define to 1 if you have the `EVP_sha256' function. */
170 #undef HAVE_EVP_SHA256
172 /* Define to 1 if you have the `EVP_sha512' function. */
173 #undef HAVE_EVP_SHA512
175 /* Define to 1 if you have the `ev_default_loop' function. */
176 #undef HAVE_EV_DEFAULT_LOOP
178 /* Define to 1 if you have the `ev_loop' function. */
181 /* Define to 1 if you have the <expat.h> header file. */
184 /* Define to 1 if you have the `fcntl' function. */
187 /* Define to 1 if you have the `FIPS_mode' function. */
188 #undef HAVE_FIPS_MODE
190 /* Define to 1 if you have the `fork' function. */
193 /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
196 /* Define to 1 if you have the `fsync' function. */
199 /* Whether getaddrinfo is available */
200 #undef HAVE_GETADDRINFO
202 /* Define to 1 if you have the `getauxval' function. */
203 #undef HAVE_GETAUXVAL
205 /* Define to 1 if you have the `getentropy' function. */
206 #undef HAVE_GETENTROPY
208 /* Define to 1 if you have the <getopt.h> header file. */
211 /* Define to 1 if you have the `getpwnam' function. */
214 /* Define to 1 if you have the `getrlimit' function. */
215 #undef HAVE_GETRLIMIT
217 /* Define to 1 if you have the `glob' function. */
220 /* Define to 1 if you have the <glob.h> header file. */
223 /* Define to 1 if you have the `gmtime_r' function. */
226 /* Define to 1 if you have the <grp.h> header file. */
229 /* If you have HMAC_Update */
230 #undef HAVE_HMAC_UPDATE
232 /* Define to 1 if you have the `inet_aton' function. */
233 #undef HAVE_INET_ATON
235 /* Define to 1 if you have the `inet_ntop' function. */
236 #undef HAVE_INET_NTOP
238 /* Define to 1 if you have the `inet_pton' function. */
239 #undef HAVE_INET_PTON
241 /* Define to 1 if you have the `initgroups' function. */
242 #undef HAVE_INITGROUPS
244 /* Define to 1 if you have the <inttypes.h> header file. */
245 #undef HAVE_INTTYPES_H
247 /* if the function 'ioctlsocket' is available */
248 #undef HAVE_IOCTLSOCKET
250 /* Define to 1 if you have the <iphlpapi.h> header file. */
251 #undef HAVE_IPHLPAPI_H
253 /* Define to 1 if you have the `isblank' function. */
256 /* Define to 1 if you have the `kill' function. */
259 /* Define if we have LibreSSL */
262 /* Define to 1 if you have the `localtime_r' function. */
263 #undef HAVE_LOCALTIME_R
265 /* Define to 1 if you have the <login_cap.h> header file. */
266 #undef HAVE_LOGIN_CAP_H
268 /* If have GNU libc compatible malloc */
271 /* Define to 1 if you have the `memmove' function. */
274 /* Define to 1 if you have the <memory.h> header file. */
277 /* Define to 1 if you have the <netdb.h> header file. */
280 /* Define to 1 if you have the <netinet/in.h> header file. */
281 #undef HAVE_NETINET_IN_H
283 /* Define to 1 if you have the <netinet/tcp.h> header file. */
284 #undef HAVE_NETINET_TCP_H
286 /* Use libnettle for crypto */
289 /* Define to 1 if you have the <nettle/dsa-compat.h> header file. */
290 #undef HAVE_NETTLE_DSA_COMPAT_H
292 /* Use libnss for crypto */
295 /* Define to 1 if you have the `OpenSSL_add_all_digests' function. */
296 #undef HAVE_OPENSSL_ADD_ALL_DIGESTS
298 /* Define to 1 if you have the <openssl/bn.h> header file. */
299 #undef HAVE_OPENSSL_BN_H
301 /* Define to 1 if you have the `OPENSSL_config' function. */
302 #undef HAVE_OPENSSL_CONFIG
304 /* Define to 1 if you have the <openssl/conf.h> header file. */
305 #undef HAVE_OPENSSL_CONF_H
307 /* Define to 1 if you have the <openssl/dh.h> header file. */
308 #undef HAVE_OPENSSL_DH_H
310 /* Define to 1 if you have the <openssl/dsa.h> header file. */
311 #undef HAVE_OPENSSL_DSA_H
313 /* Define to 1 if you have the <openssl/engine.h> header file. */
314 #undef HAVE_OPENSSL_ENGINE_H
316 /* Define to 1 if you have the <openssl/err.h> header file. */
317 #undef HAVE_OPENSSL_ERR_H
319 /* Define to 1 if you have the `OPENSSL_init_crypto' function. */
320 #undef HAVE_OPENSSL_INIT_CRYPTO
322 /* Define to 1 if you have the `OPENSSL_init_ssl' function. */
323 #undef HAVE_OPENSSL_INIT_SSL
325 /* Define to 1 if you have the <openssl/rand.h> header file. */
326 #undef HAVE_OPENSSL_RAND_H
328 /* Define to 1 if you have the <openssl/rsa.h> header file. */
329 #undef HAVE_OPENSSL_RSA_H
331 /* Define to 1 if you have the <openssl/ssl.h> header file. */
332 #undef HAVE_OPENSSL_SSL_H
334 /* Define if you have POSIX threads libraries and header files. */
337 /* Have PTHREAD_PRIO_INHERIT. */
338 #undef HAVE_PTHREAD_PRIO_INHERIT
340 /* Define to 1 if the system has the type `pthread_rwlock_t'. */
341 #undef HAVE_PTHREAD_RWLOCK_T
343 /* Define to 1 if the system has the type `pthread_spinlock_t'. */
344 #undef HAVE_PTHREAD_SPINLOCK_T
346 /* Define to 1 if you have the <pwd.h> header file. */
349 /* Define if you have Python libraries and header files. */
352 /* Define to 1 if you have the `random' function. */
355 /* Define to 1 if you have the `RAND_cleanup' function. */
356 #undef HAVE_RAND_CLEANUP
358 /* Define to 1 if you have the `reallocarray' function. */
359 #undef HAVE_REALLOCARRAY
361 /* Define to 1 if you have the `recvmsg' function. */
364 /* Define to 1 if you have the `sendmsg' function. */
367 /* Define to 1 if you have the `setregid' function. */
370 /* Define to 1 if you have the `setresgid' function. */
371 #undef HAVE_SETRESGID
373 /* Define to 1 if you have the `setresuid' function. */
374 #undef HAVE_SETRESUID
376 /* Define to 1 if you have the `setreuid' function. */
379 /* Define to 1 if you have the `setrlimit' function. */
380 #undef HAVE_SETRLIMIT
382 /* Define to 1 if you have the `setsid' function. */
385 /* Define to 1 if you have the `setusercontext' function. */
386 #undef HAVE_SETUSERCONTEXT
388 /* Define to 1 if you have the `SHA512_Update' function. */
389 #undef HAVE_SHA512_UPDATE
391 /* Define to 1 if you have the `shmget' function. */
394 /* Define to 1 if you have the `sigprocmask' function. */
395 #undef HAVE_SIGPROCMASK
397 /* Define to 1 if you have the `sleep' function. */
400 /* Define to 1 if you have the `snprintf' function. */
403 /* Define to 1 if you have the `socketpair' function. */
404 #undef HAVE_SOCKETPAIR
406 /* Using Solaris threads */
407 #undef HAVE_SOLARIS_THREADS
409 /* Define to 1 if you have the `srandom' function. */
412 /* Define if you have the SSL libraries installed. */
415 /* Define to 1 if you have the `SSL_CTX_set_security_level' function. */
416 #undef HAVE_SSL_CTX_SET_SECURITY_LEVEL
418 /* Define to 1 if you have the <stdarg.h> header file. */
421 /* Define to 1 if you have the <stdbool.h> header file. */
422 #undef HAVE_STDBOOL_H
424 /* Define to 1 if you have the <stdint.h> header file. */
427 /* Define to 1 if you have the <stdlib.h> header file. */
430 /* Define to 1 if you have the `strftime' function. */
433 /* Define to 1 if you have the <strings.h> header file. */
434 #undef HAVE_STRINGS_H
436 /* Define to 1 if you have the <string.h> header file. */
439 /* Define to 1 if you have the `strlcat' function. */
442 /* Define to 1 if you have the `strlcpy' function. */
445 /* Define to 1 if you have the `strptime' function. */
448 /* Define to 1 if you have the `strsep' function. */
451 /* Define to 1 if `ipi_spec_dst' is a member of `struct in_pktinfo'. */
452 #undef HAVE_STRUCT_IN_PKTINFO_IPI_SPEC_DST
454 /* Define to 1 if `sun_len' is a member of `struct sockaddr_un'. */
455 #undef HAVE_STRUCT_SOCKADDR_UN_SUN_LEN
457 /* Define if you have Swig libraries and header files. */
460 /* Define to 1 if you have the <syslog.h> header file. */
463 /* Define to 1 if systemd should be used */
466 /* Define to 1 if you have the <sys/ipc.h> header file. */
467 #undef HAVE_SYS_IPC_H
469 /* Define to 1 if you have the <sys/param.h> header file. */
470 #undef HAVE_SYS_PARAM_H
472 /* Define to 1 if you have the <sys/resource.h> header file. */
473 #undef HAVE_SYS_RESOURCE_H
475 /* Define to 1 if you have the <sys/sha2.h> header file. */
476 #undef HAVE_SYS_SHA2_H
478 /* Define to 1 if you have the <sys/shm.h> header file. */
479 #undef HAVE_SYS_SHM_H
481 /* Define to 1 if you have the <sys/socket.h> header file. */
482 #undef HAVE_SYS_SOCKET_H
484 /* Define to 1 if you have the <sys/stat.h> header file. */
485 #undef HAVE_SYS_STAT_H
487 /* Define to 1 if you have the <sys/sysctl.h> header file. */
488 #undef HAVE_SYS_SYSCTL_H
490 /* Define to 1 if you have the <sys/types.h> header file. */
491 #undef HAVE_SYS_TYPES_H
493 /* Define to 1 if you have the <sys/uio.h> header file. */
494 #undef HAVE_SYS_UIO_H
496 /* Define to 1 if you have the <sys/un.h> header file. */
499 /* Define to 1 if you have the <sys/wait.h> header file. */
500 #undef HAVE_SYS_WAIT_H
502 /* Define to 1 if you have the <time.h> header file. */
505 /* Define to 1 if you have the `tzset' function. */
508 /* Define to 1 if you have the <unistd.h> header file. */
511 /* Define to 1 if you have the `usleep' function. */
514 /* Define to 1 if you have the `vfork' function. */
517 /* Define to 1 if you have the <vfork.h> header file. */
520 /* Define to 1 if you have the <windows.h> header file. */
521 #undef HAVE_WINDOWS_H
523 /* Using Windows threads */
524 #undef HAVE_WINDOWS_THREADS
526 /* Define to 1 if you have the <winsock2.h> header file. */
527 #undef HAVE_WINSOCK2_H
529 /* Define to 1 if `fork' works. */
530 #undef HAVE_WORKING_FORK
532 /* Define to 1 if `vfork' works. */
533 #undef HAVE_WORKING_VFORK
535 /* Define to 1 if you have the `writev' function. */
538 /* Define to 1 if you have the <ws2tcpip.h> header file. */
539 #undef HAVE_WS2TCPIP_H
541 /* Define to 1 if you have the `_beginthreadex' function. */
542 #undef HAVE__BEGINTHREADEX
544 /* if lex has yylex_destroy */
545 #undef LEX_HAS_YYLEX_DESTROY
547 /* Define to the sub-directory where libtool stores uninstalled libraries. */
550 /* Define to the maximum message length to pass to syslog. */
551 #undef MAXSYSLOGMSGLEN
553 /* Define if memcmp() does not compare unsigned bytes */
554 #undef MEMCMP_IS_BROKEN
556 /* Define if mkdir has one argument. */
557 #undef MKDIR_HAS_ONE_ARG
559 /* Define if the network stack does not fully support nonblocking io (causes
560 lower performance). */
561 #undef NONBLOCKING_IS_BROKEN
563 /* Put -D_ALL_SOURCE define in config.h */
564 #undef OMITTED__D_ALL_SOURCE
566 /* Put -D_BSD_SOURCE define in config.h */
567 #undef OMITTED__D_BSD_SOURCE
569 /* Put -D_DEFAULT_SOURCE define in config.h */
570 #undef OMITTED__D_DEFAULT_SOURCE
572 /* Put -D_GNU_SOURCE define in config.h */
573 #undef OMITTED__D_GNU_SOURCE
575 /* Put -D_LARGEFILE_SOURCE=1 define in config.h */
576 #undef OMITTED__D_LARGEFILE_SOURCE_1
578 /* Put -D_POSIX_C_SOURCE=200112 define in config.h */
579 #undef OMITTED__D_POSIX_C_SOURCE_200112
581 /* Put -D_XOPEN_SOURCE=600 define in config.h */
582 #undef OMITTED__D_XOPEN_SOURCE_600
584 /* Put -D_XOPEN_SOURCE_EXTENDED=1 define in config.h */
585 #undef OMITTED__D_XOPEN_SOURCE_EXTENDED_1
587 /* Put -D__EXTENSIONS__ define in config.h */
588 #undef OMITTED__D__EXTENSIONS__
590 /* Define to the address where bug reports for this package should be sent. */
591 #undef PACKAGE_BUGREPORT
593 /* Define to the full name of this package. */
596 /* Define to the full name and version of this package. */
597 #undef PACKAGE_STRING
599 /* Define to the one symbol short name of this package. */
600 #undef PACKAGE_TARNAME
602 /* Define to the home page for this package. */
605 /* Define to the version of this package. */
606 #undef PACKAGE_VERSION
608 /* default pidfile location */
611 /* Define to necessary symbol if this constant uses a non-standard name on
613 #undef PTHREAD_CREATE_JOINABLE
615 /* Define as the return type of signal handlers (`int' or `void'). */
618 /* default rootkey location */
619 #undef ROOT_ANCHOR_FILE
621 /* default rootcert location */
622 #undef ROOT_CERT_FILE
624 /* version number for resource files */
625 #undef RSRC_PACKAGE_VERSION
627 /* Directory to chdir to */
633 /* The size of `time_t', as computed by sizeof. */
636 /* define if (v)snprintf does not return length needed, (but length used) */
637 #undef SNPRINTF_RET_BROKEN
639 /* Define to 1 if you have the ANSI C header files. */
642 /* use default strptime. */
643 #undef STRPTIME_WORKS
645 /* Use win32 resources and API */
648 /* default username */
651 /* use to enable lightweight alloc assertions, for debug use */
652 #undef UNBOUND_ALLOC_LITE
654 /* use malloc not regions, for debug use */
655 #undef UNBOUND_ALLOC_NONREGIONAL
657 /* use statistics for allocs and frees, for debug use */
658 #undef UNBOUND_ALLOC_STATS
660 /* define this to enable debug checks. */
663 /* Define to 1 to use cachedb support */
666 /* Define to 1 to enable dnscrypt support */
669 /* Define to 1 to enable dnstap support */
672 /* Define this to enable DSA support. */
675 /* Define this to enable ECDSA support. */
678 /* Define this to enable an EVP workaround for older openssl */
679 #undef USE_ECDSA_EVP_WORKAROUND
681 /* Define this to enable GOST support. */
684 /* Define if you want to use internal select based events */
685 #undef USE_MINI_EVENT
687 /* Define this to enable client TCP Fast Open. */
688 #undef USE_MSG_FASTOPEN
690 /* Define this to enable client TCP Fast Open. */
691 #undef USE_OSX_MSG_FASTOPEN
693 /* Define this to enable SHA1 support. */
696 /* Define this to enable SHA256 and SHA512 support. */
699 /* Enable extensions on AIX 3, Interix. */
703 /* Enable GNU extensions on systems that have them. */
707 /* Enable threading extensions on Solaris. */
708 #ifndef _POSIX_PTHREAD_SEMANTICS
709 # undef _POSIX_PTHREAD_SEMANTICS
711 /* Enable extensions on HP NonStop. */
712 #ifndef _TANDEM_SOURCE
713 # undef _TANDEM_SOURCE
715 /* Enable general extensions on Solaris. */
716 #ifndef __EXTENSIONS__
717 # undef __EXTENSIONS__
721 /* Define this to enable server TCP Fast Open. */
722 #undef USE_TCP_FASTOPEN
724 /* Whether the windows socket API is used */
727 /* the version of the windows API enabled */
730 /* Define if you want Python module. */
731 #undef WITH_PYTHONMODULE
733 /* Define if you want PyUnbound. */
734 #undef WITH_PYUNBOUND
736 /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
738 #undef YYTEXT_POINTER
740 /* Enable large inode numbers on Mac OS X 10.5. */
741 #ifndef _DARWIN_USE_64_BIT_INODE
742 # define _DARWIN_USE_64_BIT_INODE 1
745 /* Number of bits in a file offset, on hosts where this is settable. */
746 #undef _FILE_OFFSET_BITS
748 /* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
749 #undef _LARGEFILE_SOURCE
751 /* Define for large files, on AIX-style hosts. */
754 /* Define to 1 if on MINIX. */
757 /* Enable for compile on Minix */
758 #undef _NETBSD_SOURCE
760 /* Define to 2 if the system does not provide POSIX.1 features except with
762 #undef _POSIX_1_SOURCE
764 /* Define to 1 if you need to in order for `stat' and other things to work. */
767 /* Define to empty if `const' does not conform to ANSI C. */
770 /* Define to `int' if <sys/types.h> doesn't define. */
779 /* Define to `__inline__' or `__inline' if that's what the C compiler
780 calls it, or to nothing if 'inline' is not supported under any name. */
785 /* Define to `short' if <sys/types.h> does not define. */
788 /* Define to `int' if <sys/types.h> does not define. */
791 /* Define to `long long' if <sys/types.h> does not define. */
794 /* Define to `signed char' if <sys/types.h> does not define. */
797 /* Define if replacement function should be used. */
800 /* Define to `long int' if <sys/types.h> does not define. */
803 /* Define to `int' if <sys/types.h> does not define. */
806 /* Define to 'int' if not defined */
809 /* Define to `unsigned int' if <sys/types.h> does not define. */
812 /* Define to 'int' if not defined */
815 /* Define to `int' if <sys/types.h> does not define. */
818 /* Define to 'unsigned char if not defined */
821 /* Define to `int' if <sys/types.h> doesn't define. */
824 /* Define to `unsigned short' if <sys/types.h> does not define. */
827 /* Define to `unsigned int' if <sys/types.h> does not define. */
830 /* Define to `unsigned long long' if <sys/types.h> does not define. */
833 /* Define to `unsigned char' if <sys/types.h> does not define. */
836 /* Define as `fork' if `vfork' does not work. */
839 #if defined(OMITTED__D_GNU_SOURCE) && !defined(_GNU_SOURCE)
840 #define _GNU_SOURCE 1
843 #if defined(OMITTED__D_BSD_SOURCE) && !defined(_BSD_SOURCE)
844 #define _BSD_SOURCE 1
847 #if defined(OMITTED__D_DEFAULT_SOURCE) && !defined(_DEFAULT_SOURCE)
848 #define _DEFAULT_SOURCE 1
851 #if defined(OMITTED__D__EXTENSIONS__) && !defined(__EXTENSIONS__)
852 #define __EXTENSIONS__ 1
855 #if defined(OMITTED__D_POSIX_C_SOURCE_200112) && !defined(_POSIX_C_SOURCE)
856 #define _POSIX_C_SOURCE 200112
859 #if defined(OMITTED__D_XOPEN_SOURCE_600) && !defined(_XOPEN_SOURCE)
860 #define _XOPEN_SOURCE 600
863 #if defined(OMITTED__D_XOPEN_SOURCE_EXTENDED_1) && !defined(_XOPEN_SOURCE_EXTENDED)
864 #define _XOPEN_SOURCE_EXTENDED 1
867 #if defined(OMITTED__D_ALL_SOURCE) && !defined(_ALL_SOURCE)
868 #define _ALL_SOURCE 1
871 #if defined(OMITTED__D_LARGEFILE_SOURCE_1) && !defined(_LARGEFILE_SOURCE)
872 #define _LARGEFILE_SOURCE 1
878 #ifndef UNBOUND_DEBUG
882 /** Use small-ldns codebase */
885 # define LDNS_BUILD_CONFIG_HAVE_SSL 1
909 #include <sys/param.h>
912 #ifdef HAVE_SYS_SOCKET_H
913 #include <sys/socket.h>
916 #ifdef HAVE_SYS_UIO_H
920 #ifdef HAVE_NETINET_IN_H
921 #include <netinet/in.h>
924 #ifdef HAVE_NETINET_TCP_H
925 #include <netinet/tcp.h>
928 #ifdef HAVE_ARPA_INET_H
929 #include <arpa/inet.h>
932 #ifdef HAVE_WINSOCK2_H
933 #include <winsock2.h>
936 #ifdef HAVE_WS2TCPIP_H
937 #include <ws2tcpip.h>
943 #define ARG_LL "%I64"
947 #define AF_LOCAL AF_UNIX
952 #ifdef HAVE_ATTR_FORMAT
953 # define ATTR_FORMAT(archetype, string_index, first_to_check) \
954 __attribute__ ((format (archetype, string_index, first_to_check)))
955 #else /* !HAVE_ATTR_FORMAT */
956 # define ATTR_FORMAT(archetype, string_index, first_to_check) /* empty */
957 #endif /* !HAVE_ATTR_FORMAT */
961 # define ATTR_UNUSED(x) x
962 #elif defined(__cplusplus)
963 # define ATTR_UNUSED(x)
964 #elif defined(HAVE_ATTR_UNUSED)
965 # define ATTR_UNUSED(x) x __attribute__((unused))
966 #else /* !HAVE_ATTR_UNUSED */
967 # define ATTR_UNUSED(x) x
968 #endif /* !HAVE_ATTR_UNUSED */
974 #endif /* HAVE_FSEEKO */
977 #ifndef MAXHOSTNAMELEN
978 #define MAXHOSTNAMELEN 256
981 #if !defined(HAVE_SNPRINTF) || defined(SNPRINTF_RET_BROKEN)
982 #define snprintf snprintf_unbound
983 #define vsnprintf vsnprintf_unbound
985 int snprintf (char *str, size_t count, const char *fmt, ...);
986 int vsnprintf (char *str, size_t count, const char *fmt, va_list arg);
987 #endif /* HAVE_SNPRINTF or SNPRINTF_RET_BROKEN */
989 #ifndef HAVE_INET_PTON
990 #define inet_pton inet_pton_unbound
991 int inet_pton(int af, const char* src, void* dst);
992 #endif /* HAVE_INET_PTON */
995 #ifndef HAVE_INET_NTOP
996 #define inet_ntop inet_ntop_unbound
997 const char *inet_ntop(int af, const void *src, char *dst, size_t size);
1001 #ifndef HAVE_INET_ATON
1002 #define inet_aton inet_aton_unbound
1003 int inet_aton(const char *cp, struct in_addr *addr);
1007 #ifndef HAVE_MEMMOVE
1008 #define memmove memmove_unbound
1009 void *memmove(void *dest, const void *src, size_t n);
1013 #ifndef HAVE_STRLCAT
1014 #define strlcat strlcat_unbound
1015 size_t strlcat(char *dst, const char *src, size_t siz);
1019 #ifndef HAVE_STRLCPY
1020 #define strlcpy strlcpy_unbound
1021 size_t strlcpy(char *dst, const char *src, size_t siz);
1025 #ifndef HAVE_GMTIME_R
1026 #define gmtime_r gmtime_r_unbound
1027 struct tm *gmtime_r(const time_t *timep, struct tm *result);
1031 #ifndef HAVE_REALLOCARRAY
1032 #define reallocarray reallocarrayunbound
1033 void* reallocarray(void *ptr, size_t nmemb, size_t size);
1037 #if !defined(HAVE_SLEEP) || defined(HAVE_WINDOWS_H)
1038 #define sleep(x) Sleep((x)*1000) /* on win32 */
1039 #endif /* HAVE_SLEEP */
1043 #define usleep(x) Sleep((x)/1000 + 1) /* on win32 */
1044 #endif /* HAVE_USLEEP */
1048 #define random rand /* on win32, for tests only (bad random) */
1049 #endif /* HAVE_RANDOM */
1052 #ifndef HAVE_SRANDOM
1053 #define srandom(x) srand(x) /* on win32, for tests only (bad random) */
1054 #endif /* HAVE_SRANDOM */
1057 /* detect if we need to cast to unsigned int for FD_SET to avoid warnings */
1058 #ifdef HAVE_WINSOCK2_H
1059 #define FD_SET_T (u_int)
1065 #ifndef IPV6_MIN_MTU
1066 #define IPV6_MIN_MTU 1280
1067 #endif /* IPV6_MIN_MTU */
1070 #ifdef MEMCMP_IS_BROKEN
1071 #include "compat/memcmp.h"
1072 #define memcmp memcmp_unbound
1073 int memcmp(const void *x, const void *y, size_t n);
1078 #ifndef HAVE_CTIME_R
1079 #define ctime_r unbound_ctime_r
1080 char *ctime_r(const time_t *timep, char *buf);
1084 #define strsep unbound_strsep
1085 char *strsep(char **stringp, const char *delim);
1088 #ifndef HAVE_ISBLANK
1089 #define isblank unbound_isblank
1093 #if defined(HAVE_INET_NTOP) && !HAVE_DECL_INET_NTOP
1094 const char *inet_ntop(int af, const void *src, char *dst, size_t size);
1097 #if defined(HAVE_INET_PTON) && !HAVE_DECL_INET_PTON
1098 int inet_pton(int af, const char* src, void* dst);
1101 #if !defined(HAVE_STRPTIME) || !defined(STRPTIME_WORKS)
1102 #define strptime unbound_strptime
1104 char *strptime(const char *s, const char *format, struct tm *tm);
1107 #ifdef HAVE_LIBRESSL
1108 # if !HAVE_DECL_STRLCPY
1109 size_t strlcpy(char *dst, const char *src, size_t siz);
1111 # if !HAVE_DECL_STRLCAT
1112 size_t strlcat(char *dst, const char *src, size_t siz);
1114 # if !HAVE_DECL_ARC4RANDOM && defined(HAVE_ARC4RANDOM)
1115 uint32_t arc4random(void);
1117 # if !HAVE_DECL_ARC4RANDOM_UNIFORM && defined(HAVE_ARC4RANDOM_UNIFORM)
1118 uint32_t arc4random_uniform(uint32_t upper_bound);
1120 # if !HAVE_DECL_REALLOCARRAY
1121 void *reallocarray(void *ptr, size_t nmemb, size_t size);
1123 #endif /* HAVE_LIBRESSL */
1124 #ifndef HAVE_ARC4RANDOM
1125 void explicit_bzero(void* buf, size_t len);
1126 int getentropy(void* buf, size_t len);
1127 uint32_t arc4random(void);
1128 void arc4random_buf(void* buf, size_t n);
1129 void _ARC4_LOCK(void);
1130 void _ARC4_UNLOCK(void);
1132 #ifndef HAVE_ARC4RANDOM_UNIFORM
1133 uint32_t arc4random_uniform(uint32_t upper_bound);
1135 #ifdef COMPAT_SHA512
1136 #ifndef SHA512_DIGEST_LENGTH
1137 #define SHA512_BLOCK_LENGTH 128
1138 #define SHA512_DIGEST_LENGTH 64
1139 #define SHA512_DIGEST_STRING_LENGTH (SHA512_DIGEST_LENGTH * 2 + 1)
1140 typedef struct _SHA512_CTX {
1142 uint64_t bitcount[2];
1143 uint8_t buffer[SHA512_BLOCK_LENGTH];
1145 #endif /* SHA512_DIGEST_LENGTH */
1146 void SHA512_Init(SHA512_CTX*);
1147 void SHA512_Update(SHA512_CTX*, void*, size_t);
1148 void SHA512_Final(uint8_t[SHA512_DIGEST_LENGTH], SHA512_CTX*);
1149 unsigned char *SHA512(void* data, unsigned int data_len, unsigned char *digest);
1150 #endif /* COMPAT_SHA512 */
1154 #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))
1155 /* using version of libevent that is not threadsafe. */
1156 # define LIBEVENT_SIGNAL_PROBLEM 1
1159 #ifndef CHECKED_INET6
1160 # define CHECKED_INET6
1164 # define AF_INET6 28
1166 #endif /* CHECKED_INET6 */
1168 #ifndef HAVE_GETADDRINFO
1169 struct sockaddr_storage;
1170 #include "compat/fake-rfc2553.h"
1173 #ifdef UNBOUND_ALLOC_STATS
1174 # define malloc(s) unbound_stat_malloc_log(s, __FILE__, __LINE__, __func__)
1175 # define calloc(n,s) unbound_stat_calloc_log(n, s, __FILE__, __LINE__, __func__)
1176 # define free(p) unbound_stat_free_log(p, __FILE__, __LINE__, __func__)
1177 # define realloc(p,s) unbound_stat_realloc_log(p, s, __FILE__, __LINE__, __func__)
1178 void *unbound_stat_malloc(size_t size);
1179 void *unbound_stat_calloc(size_t nmemb, size_t size);
1180 void unbound_stat_free(void *ptr);
1181 void *unbound_stat_realloc(void *ptr, size_t size);
1182 void *unbound_stat_malloc_log(size_t size, const char* file, int line,
1184 void *unbound_stat_calloc_log(size_t nmemb, size_t size, const char* file,
1185 int line, const char* func);
1186 void unbound_stat_free_log(void *ptr, const char* file, int line,
1188 void *unbound_stat_realloc_log(void *ptr, size_t size, const char* file,
1189 int line, const char* func);
1190 #elif defined(UNBOUND_ALLOC_LITE)
1191 # include "util/alloc.h"
1192 #endif /* UNBOUND_ALLOC_LITE and UNBOUND_ALLOC_STATS */
1194 /** default port for DNS traffic. */
1195 #define UNBOUND_DNS_PORT 53
1196 /** default port for unbound control traffic, registered port with IANA,
1197 ub-dns-control 8953/tcp unbound dns nameserver control */
1198 #define UNBOUND_CONTROL_PORT 8953
1199 /** the version of unbound-control that this software implements */
1200 #define UNBOUND_CONTROL_VERSION 1