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_ED25519', and to 0 if you
84 #undef HAVE_DECL_NID_ED25519
86 /* Define to 1 if you have the declaration of `NID_secp384r1', and to 0 if you
88 #undef HAVE_DECL_NID_SECP384R1
90 /* Define to 1 if you have the declaration of `NID_X9_62_prime256v1', and to 0
92 #undef HAVE_DECL_NID_X9_62_PRIME256V1
94 /* Define to 1 if you have the declaration of `reallocarray', and to 0 if you
96 #undef HAVE_DECL_REALLOCARRAY
98 /* Define to 1 if you have the declaration of `sk_SSL_COMP_pop_free', and to 0
100 #undef HAVE_DECL_SK_SSL_COMP_POP_FREE
102 /* Define to 1 if you have the declaration of
103 `SSL_COMP_get_compression_methods', and to 0 if you don't. */
104 #undef HAVE_DECL_SSL_COMP_GET_COMPRESSION_METHODS
106 /* Define to 1 if you have the declaration of `SSL_CTX_set_ecdh_auto', and to
108 #undef HAVE_DECL_SSL_CTX_SET_ECDH_AUTO
110 /* Define to 1 if you have the declaration of `strlcat', and to 0 if you
112 #undef HAVE_DECL_STRLCAT
114 /* Define to 1 if you have the declaration of `strlcpy', and to 0 if you
116 #undef HAVE_DECL_STRLCPY
118 /* Define to 1 if you have the declaration of `XML_StopParser', and to 0 if
120 #undef HAVE_DECL_XML_STOPPARSER
122 /* Define to 1 if you have the <dlfcn.h> header file. */
125 /* Define to 1 if you have the `DSA_SIG_set0' function. */
126 #undef HAVE_DSA_SIG_SET0
128 /* Define to 1 if you have the <endian.h> header file. */
131 /* Define to 1 if you have the `endprotoent' function. */
132 #undef HAVE_ENDPROTOENT
134 /* Define to 1 if you have the `endpwent' function. */
137 /* Define to 1 if you have the `endservent' function. */
138 #undef HAVE_ENDSERVENT
140 /* Define to 1 if you have the `ERR_free_strings' function. */
141 #undef HAVE_ERR_FREE_STRINGS
143 /* Define to 1 if you have the `ERR_load_crypto_strings' function. */
144 #undef HAVE_ERR_LOAD_CRYPTO_STRINGS
146 /* Define to 1 if you have the `event_base_free' function. */
147 #undef HAVE_EVENT_BASE_FREE
149 /* Define to 1 if you have the `event_base_get_method' function. */
150 #undef HAVE_EVENT_BASE_GET_METHOD
152 /* Define to 1 if you have the `event_base_new' function. */
153 #undef HAVE_EVENT_BASE_NEW
155 /* Define to 1 if you have the `event_base_once' function. */
156 #undef HAVE_EVENT_BASE_ONCE
158 /* Define to 1 if you have the <event.h> header file. */
161 /* Define to 1 if you have the `EVP_cleanup' function. */
162 #undef HAVE_EVP_CLEANUP
164 /* Define to 1 if you have the `EVP_DigestVerify' function. */
165 #undef HAVE_EVP_DIGESTVERIFY
167 /* Define to 1 if you have the `EVP_dss1' function. */
170 /* Define to 1 if you have the `EVP_MD_CTX_new' function. */
171 #undef HAVE_EVP_MD_CTX_NEW
173 /* Define to 1 if you have the `EVP_sha1' function. */
176 /* Define to 1 if you have the `EVP_sha256' function. */
177 #undef HAVE_EVP_SHA256
179 /* Define to 1 if you have the `EVP_sha512' function. */
180 #undef HAVE_EVP_SHA512
182 /* Define to 1 if you have the `ev_default_loop' function. */
183 #undef HAVE_EV_DEFAULT_LOOP
185 /* Define to 1 if you have the `ev_loop' function. */
188 /* Define to 1 if you have the <expat.h> header file. */
191 /* Define to 1 if you have the `fcntl' function. */
194 /* Define to 1 if you have the `FIPS_mode' function. */
195 #undef HAVE_FIPS_MODE
197 /* Define to 1 if you have the `fork' function. */
200 /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
203 /* Define to 1 if you have the `fsync' function. */
206 /* Whether getaddrinfo is available */
207 #undef HAVE_GETADDRINFO
209 /* Define to 1 if you have the `getauxval' function. */
210 #undef HAVE_GETAUXVAL
212 /* Define to 1 if you have the `getentropy' function. */
213 #undef HAVE_GETENTROPY
215 /* Define to 1 if you have the <getopt.h> header file. */
218 /* Define to 1 if you have the `getpwnam' function. */
221 /* Define to 1 if you have the `getrlimit' function. */
222 #undef HAVE_GETRLIMIT
224 /* Define to 1 if you have the `glob' function. */
227 /* Define to 1 if you have the <glob.h> header file. */
230 /* Define to 1 if you have the `gmtime_r' function. */
233 /* Define to 1 if you have the <grp.h> header file. */
236 /* If you have HMAC_Update */
237 #undef HAVE_HMAC_UPDATE
239 /* Define to 1 if you have the `inet_aton' function. */
240 #undef HAVE_INET_ATON
242 /* Define to 1 if you have the `inet_ntop' function. */
243 #undef HAVE_INET_NTOP
245 /* Define to 1 if you have the `inet_pton' function. */
246 #undef HAVE_INET_PTON
248 /* Define to 1 if you have the `initgroups' function. */
249 #undef HAVE_INITGROUPS
251 /* Define to 1 if you have the <inttypes.h> header file. */
252 #undef HAVE_INTTYPES_H
254 /* if the function 'ioctlsocket' is available */
255 #undef HAVE_IOCTLSOCKET
257 /* Define to 1 if you have the <iphlpapi.h> header file. */
258 #undef HAVE_IPHLPAPI_H
260 /* Define to 1 if you have the `isblank' function. */
263 /* Define to 1 if you have the `kill' function. */
266 /* Define if we have LibreSSL */
269 /* Define to 1 if you have the `localtime_r' function. */
270 #undef HAVE_LOCALTIME_R
272 /* Define to 1 if you have the <login_cap.h> header file. */
273 #undef HAVE_LOGIN_CAP_H
275 /* If have GNU libc compatible malloc */
278 /* Define to 1 if you have the `memmove' function. */
281 /* Define to 1 if you have the <memory.h> header file. */
284 /* Define to 1 if you have the <netdb.h> header file. */
287 /* Define to 1 if you have the <netinet/in.h> header file. */
288 #undef HAVE_NETINET_IN_H
290 /* Define to 1 if you have the <netinet/tcp.h> header file. */
291 #undef HAVE_NETINET_TCP_H
293 /* Use libnettle for crypto */
296 /* Define to 1 if you have the <nettle/dsa-compat.h> header file. */
297 #undef HAVE_NETTLE_DSA_COMPAT_H
299 /* Define to 1 if you have the <nettle/eddsa.h> header file. */
300 #undef HAVE_NETTLE_EDDSA_H
302 /* Use libnss for crypto */
305 /* Define to 1 if you have the `OpenSSL_add_all_digests' function. */
306 #undef HAVE_OPENSSL_ADD_ALL_DIGESTS
308 /* Define to 1 if you have the <openssl/bn.h> header file. */
309 #undef HAVE_OPENSSL_BN_H
311 /* Define to 1 if you have the `OPENSSL_config' function. */
312 #undef HAVE_OPENSSL_CONFIG
314 /* Define to 1 if you have the <openssl/conf.h> header file. */
315 #undef HAVE_OPENSSL_CONF_H
317 /* Define to 1 if you have the <openssl/dh.h> header file. */
318 #undef HAVE_OPENSSL_DH_H
320 /* Define to 1 if you have the <openssl/dsa.h> header file. */
321 #undef HAVE_OPENSSL_DSA_H
323 /* Define to 1 if you have the <openssl/engine.h> header file. */
324 #undef HAVE_OPENSSL_ENGINE_H
326 /* Define to 1 if you have the <openssl/err.h> header file. */
327 #undef HAVE_OPENSSL_ERR_H
329 /* Define to 1 if you have the `OPENSSL_init_crypto' function. */
330 #undef HAVE_OPENSSL_INIT_CRYPTO
332 /* Define to 1 if you have the `OPENSSL_init_ssl' function. */
333 #undef HAVE_OPENSSL_INIT_SSL
335 /* Define to 1 if you have the <openssl/rand.h> header file. */
336 #undef HAVE_OPENSSL_RAND_H
338 /* Define to 1 if you have the <openssl/rsa.h> header file. */
339 #undef HAVE_OPENSSL_RSA_H
341 /* Define to 1 if you have the <openssl/ssl.h> header file. */
342 #undef HAVE_OPENSSL_SSL_H
344 /* Define if you have POSIX threads libraries and header files. */
347 /* Have PTHREAD_PRIO_INHERIT. */
348 #undef HAVE_PTHREAD_PRIO_INHERIT
350 /* Define to 1 if the system has the type `pthread_rwlock_t'. */
351 #undef HAVE_PTHREAD_RWLOCK_T
353 /* Define to 1 if the system has the type `pthread_spinlock_t'. */
354 #undef HAVE_PTHREAD_SPINLOCK_T
356 /* Define to 1 if you have the <pwd.h> header file. */
359 /* Define if you have Python libraries and header files. */
362 /* Define to 1 if you have the `random' function. */
365 /* Define to 1 if you have the `RAND_cleanup' function. */
366 #undef HAVE_RAND_CLEANUP
368 /* Define to 1 if you have the `reallocarray' function. */
369 #undef HAVE_REALLOCARRAY
371 /* Define to 1 if you have the `recvmsg' function. */
374 /* Define to 1 if you have the `sendmsg' function. */
377 /* Define to 1 if you have the `setregid' function. */
380 /* Define to 1 if you have the `setresgid' function. */
381 #undef HAVE_SETRESGID
383 /* Define to 1 if you have the `setresuid' function. */
384 #undef HAVE_SETRESUID
386 /* Define to 1 if you have the `setreuid' function. */
389 /* Define to 1 if you have the `setrlimit' function. */
390 #undef HAVE_SETRLIMIT
392 /* Define to 1 if you have the `setsid' function. */
395 /* Define to 1 if you have the `setusercontext' function. */
396 #undef HAVE_SETUSERCONTEXT
398 /* Define to 1 if you have the `SHA512_Update' function. */
399 #undef HAVE_SHA512_UPDATE
401 /* Define to 1 if you have the `shmget' function. */
404 /* Define to 1 if you have the `sigprocmask' function. */
405 #undef HAVE_SIGPROCMASK
407 /* Define to 1 if you have the `sleep' function. */
410 /* Define to 1 if you have the `snprintf' function. */
413 /* Define to 1 if you have the `socketpair' function. */
414 #undef HAVE_SOCKETPAIR
416 /* Using Solaris threads */
417 #undef HAVE_SOLARIS_THREADS
419 /* Define to 1 if you have the `srandom' function. */
422 /* Define if you have the SSL libraries installed. */
425 /* Define to 1 if you have the `SSL_CTX_set_security_level' function. */
426 #undef HAVE_SSL_CTX_SET_SECURITY_LEVEL
428 /* Define to 1 if you have the <stdarg.h> header file. */
431 /* Define to 1 if you have the <stdbool.h> header file. */
432 #undef HAVE_STDBOOL_H
434 /* Define to 1 if you have the <stdint.h> header file. */
437 /* Define to 1 if you have the <stdlib.h> header file. */
440 /* Define to 1 if you have the `strftime' function. */
443 /* Define to 1 if you have the <strings.h> header file. */
444 #undef HAVE_STRINGS_H
446 /* Define to 1 if you have the <string.h> header file. */
449 /* Define to 1 if you have the `strlcat' function. */
452 /* Define to 1 if you have the `strlcpy' function. */
455 /* Define to 1 if you have the `strptime' function. */
458 /* Define to 1 if you have the `strsep' function. */
461 /* Define to 1 if `ipi_spec_dst' is a member of `struct in_pktinfo'. */
462 #undef HAVE_STRUCT_IN_PKTINFO_IPI_SPEC_DST
464 /* Define to 1 if `sun_len' is a member of `struct sockaddr_un'. */
465 #undef HAVE_STRUCT_SOCKADDR_UN_SUN_LEN
467 /* Define if you have Swig libraries and header files. */
470 /* Define to 1 if you have the <syslog.h> header file. */
473 /* Define to 1 if systemd should be used */
476 /* Define to 1 if you have the <sys/ipc.h> header file. */
477 #undef HAVE_SYS_IPC_H
479 /* Define to 1 if you have the <sys/param.h> header file. */
480 #undef HAVE_SYS_PARAM_H
482 /* Define to 1 if you have the <sys/resource.h> header file. */
483 #undef HAVE_SYS_RESOURCE_H
485 /* Define to 1 if you have the <sys/sha2.h> header file. */
486 #undef HAVE_SYS_SHA2_H
488 /* Define to 1 if you have the <sys/shm.h> header file. */
489 #undef HAVE_SYS_SHM_H
491 /* Define to 1 if you have the <sys/socket.h> header file. */
492 #undef HAVE_SYS_SOCKET_H
494 /* Define to 1 if you have the <sys/stat.h> header file. */
495 #undef HAVE_SYS_STAT_H
497 /* Define to 1 if you have the <sys/sysctl.h> header file. */
498 #undef HAVE_SYS_SYSCTL_H
500 /* Define to 1 if you have the <sys/types.h> header file. */
501 #undef HAVE_SYS_TYPES_H
503 /* Define to 1 if you have the <sys/uio.h> header file. */
504 #undef HAVE_SYS_UIO_H
506 /* Define to 1 if you have the <sys/un.h> header file. */
509 /* Define to 1 if you have the <sys/wait.h> header file. */
510 #undef HAVE_SYS_WAIT_H
512 /* Define to 1 if you have the <time.h> header file. */
515 /* Define to 1 if you have the `tzset' function. */
518 /* Define to 1 if you have the <unistd.h> header file. */
521 /* Define to 1 if you have the `usleep' function. */
524 /* Define to 1 if you have the `vfork' function. */
527 /* Define to 1 if you have the <vfork.h> header file. */
530 /* Define to 1 if you have the <windows.h> header file. */
531 #undef HAVE_WINDOWS_H
533 /* Using Windows threads */
534 #undef HAVE_WINDOWS_THREADS
536 /* Define to 1 if you have the <winsock2.h> header file. */
537 #undef HAVE_WINSOCK2_H
539 /* Define to 1 if `fork' works. */
540 #undef HAVE_WORKING_FORK
542 /* Define to 1 if `vfork' works. */
543 #undef HAVE_WORKING_VFORK
545 /* Define to 1 if you have the `writev' function. */
548 /* Define to 1 if you have the <ws2tcpip.h> header file. */
549 #undef HAVE_WS2TCPIP_H
551 /* Define to 1 if you have the `_beginthreadex' function. */
552 #undef HAVE__BEGINTHREADEX
554 /* if lex has yylex_destroy */
555 #undef LEX_HAS_YYLEX_DESTROY
557 /* Define to the sub-directory where libtool stores uninstalled libraries. */
560 /* Define to the maximum message length to pass to syslog. */
561 #undef MAXSYSLOGMSGLEN
563 /* Define if memcmp() does not compare unsigned bytes */
564 #undef MEMCMP_IS_BROKEN
566 /* Define if mkdir has one argument. */
567 #undef MKDIR_HAS_ONE_ARG
569 /* Define if the network stack does not fully support nonblocking io (causes
570 lower performance). */
571 #undef NONBLOCKING_IS_BROKEN
573 /* Put -D_ALL_SOURCE define in config.h */
574 #undef OMITTED__D_ALL_SOURCE
576 /* Put -D_BSD_SOURCE define in config.h */
577 #undef OMITTED__D_BSD_SOURCE
579 /* Put -D_DEFAULT_SOURCE define in config.h */
580 #undef OMITTED__D_DEFAULT_SOURCE
582 /* Put -D_GNU_SOURCE define in config.h */
583 #undef OMITTED__D_GNU_SOURCE
585 /* Put -D_LARGEFILE_SOURCE=1 define in config.h */
586 #undef OMITTED__D_LARGEFILE_SOURCE_1
588 /* Put -D_POSIX_C_SOURCE=200112 define in config.h */
589 #undef OMITTED__D_POSIX_C_SOURCE_200112
591 /* Put -D_XOPEN_SOURCE=600 define in config.h */
592 #undef OMITTED__D_XOPEN_SOURCE_600
594 /* Put -D_XOPEN_SOURCE_EXTENDED=1 define in config.h */
595 #undef OMITTED__D_XOPEN_SOURCE_EXTENDED_1
597 /* Put -D__EXTENSIONS__ define in config.h */
598 #undef OMITTED__D__EXTENSIONS__
600 /* Define to the address where bug reports for this package should be sent. */
601 #undef PACKAGE_BUGREPORT
603 /* Define to the full name of this package. */
606 /* Define to the full name and version of this package. */
607 #undef PACKAGE_STRING
609 /* Define to the one symbol short name of this package. */
610 #undef PACKAGE_TARNAME
612 /* Define to the home page for this package. */
615 /* Define to the version of this package. */
616 #undef PACKAGE_VERSION
618 /* default pidfile location */
621 /* Define to necessary symbol if this constant uses a non-standard name on
623 #undef PTHREAD_CREATE_JOINABLE
625 /* Define as the return type of signal handlers (`int' or `void'). */
628 /* default rootkey location */
629 #undef ROOT_ANCHOR_FILE
631 /* default rootcert location */
632 #undef ROOT_CERT_FILE
634 /* version number for resource files */
635 #undef RSRC_PACKAGE_VERSION
637 /* Directory to chdir to */
643 /* The size of `time_t', as computed by sizeof. */
646 /* define if (v)snprintf does not return length needed, (but length used) */
647 #undef SNPRINTF_RET_BROKEN
649 /* Define to 1 if you have the ANSI C header files. */
652 /* use default strptime. */
653 #undef STRPTIME_WORKS
655 /* Use win32 resources and API */
658 /* default username */
661 /* use to enable lightweight alloc assertions, for debug use */
662 #undef UNBOUND_ALLOC_LITE
664 /* use malloc not regions, for debug use */
665 #undef UNBOUND_ALLOC_NONREGIONAL
667 /* use statistics for allocs and frees, for debug use */
668 #undef UNBOUND_ALLOC_STATS
670 /* define this to enable debug checks. */
673 /* Define to 1 to use cachedb support */
676 /* Define to 1 to enable dnscrypt support */
679 /* Define to 1 to enable dnscrypt with xchacha20 support */
680 #undef USE_DNSCRYPT_XCHACHA20
682 /* Define to 1 to enable dnstap support */
685 /* Define this to enable DSA support. */
688 /* Define this to enable ECDSA support. */
691 /* Define this to enable an EVP workaround for older openssl */
692 #undef USE_ECDSA_EVP_WORKAROUND
694 /* Define this to enable ED25519 support. */
697 /* Define this to enable GOST support. */
700 /* Define to 1 to use ipsecmod support. */
703 /* Define if you want to use internal select based events */
704 #undef USE_MINI_EVENT
706 /* Define this to enable client TCP Fast Open. */
707 #undef USE_MSG_FASTOPEN
709 /* Define this to enable client TCP Fast Open. */
710 #undef USE_OSX_MSG_FASTOPEN
712 /* Define this to enable SHA1 support. */
715 /* Define this to enable SHA256 and SHA512 support. */
718 /* Enable extensions on AIX 3, Interix. */
722 /* Enable GNU extensions on systems that have them. */
726 /* Enable threading extensions on Solaris. */
727 #ifndef _POSIX_PTHREAD_SEMANTICS
728 # undef _POSIX_PTHREAD_SEMANTICS
730 /* Enable extensions on HP NonStop. */
731 #ifndef _TANDEM_SOURCE
732 # undef _TANDEM_SOURCE
734 /* Enable general extensions on Solaris. */
735 #ifndef __EXTENSIONS__
736 # undef __EXTENSIONS__
740 /* Define this to enable server TCP Fast Open. */
741 #undef USE_TCP_FASTOPEN
743 /* Whether the windows socket API is used */
746 /* the version of the windows API enabled */
749 /* Define if you want Python module. */
750 #undef WITH_PYTHONMODULE
752 /* Define if you want PyUnbound. */
753 #undef WITH_PYUNBOUND
755 /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
757 #undef YYTEXT_POINTER
759 /* Enable large inode numbers on Mac OS X 10.5. */
760 #ifndef _DARWIN_USE_64_BIT_INODE
761 # define _DARWIN_USE_64_BIT_INODE 1
764 /* Number of bits in a file offset, on hosts where this is settable. */
765 #undef _FILE_OFFSET_BITS
767 /* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
768 #undef _LARGEFILE_SOURCE
770 /* Define for large files, on AIX-style hosts. */
773 /* Define to 1 if on MINIX. */
776 /* Enable for compile on Minix */
777 #undef _NETBSD_SOURCE
779 /* Define to 2 if the system does not provide POSIX.1 features except with
781 #undef _POSIX_1_SOURCE
783 /* Define to 1 if you need to in order for `stat' and other things to work. */
786 /* Define to empty if `const' does not conform to ANSI C. */
789 /* Define to `int' if <sys/types.h> doesn't define. */
798 /* Define to `__inline__' or `__inline' if that's what the C compiler
799 calls it, or to nothing if 'inline' is not supported under any name. */
804 /* Define to `short' if <sys/types.h> does not define. */
807 /* Define to `int' if <sys/types.h> does not define. */
810 /* Define to `long long' if <sys/types.h> does not define. */
813 /* Define to `signed char' if <sys/types.h> does not define. */
816 /* Define if replacement function should be used. */
819 /* Define to `long int' if <sys/types.h> does not define. */
822 /* Define to `int' if <sys/types.h> does not define. */
825 /* Define to 'int' if not defined */
828 /* Define to `unsigned int' if <sys/types.h> does not define. */
831 /* Define to 'int' if not defined */
834 /* Define to `int' if <sys/types.h> does not define. */
837 /* Define to 'unsigned char if not defined */
840 /* Define to `int' if <sys/types.h> doesn't define. */
843 /* Define to `unsigned short' if <sys/types.h> does not define. */
846 /* Define to `unsigned int' if <sys/types.h> does not define. */
849 /* Define to `unsigned long long' if <sys/types.h> does not define. */
852 /* Define to `unsigned char' if <sys/types.h> does not define. */
855 /* Define as `fork' if `vfork' does not work. */
858 #if defined(OMITTED__D_GNU_SOURCE) && !defined(_GNU_SOURCE)
859 #define _GNU_SOURCE 1
862 #if defined(OMITTED__D_BSD_SOURCE) && !defined(_BSD_SOURCE)
863 #define _BSD_SOURCE 1
866 #if defined(OMITTED__D_DEFAULT_SOURCE) && !defined(_DEFAULT_SOURCE)
867 #define _DEFAULT_SOURCE 1
870 #if defined(OMITTED__D__EXTENSIONS__) && !defined(__EXTENSIONS__)
871 #define __EXTENSIONS__ 1
874 #if defined(OMITTED__D_POSIX_C_SOURCE_200112) && !defined(_POSIX_C_SOURCE)
875 #define _POSIX_C_SOURCE 200112
878 #if defined(OMITTED__D_XOPEN_SOURCE_600) && !defined(_XOPEN_SOURCE)
879 #define _XOPEN_SOURCE 600
882 #if defined(OMITTED__D_XOPEN_SOURCE_EXTENDED_1) && !defined(_XOPEN_SOURCE_EXTENDED)
883 #define _XOPEN_SOURCE_EXTENDED 1
886 #if defined(OMITTED__D_ALL_SOURCE) && !defined(_ALL_SOURCE)
887 #define _ALL_SOURCE 1
890 #if defined(OMITTED__D_LARGEFILE_SOURCE_1) && !defined(_LARGEFILE_SOURCE)
891 #define _LARGEFILE_SOURCE 1
897 #ifndef UNBOUND_DEBUG
901 /** Use small-ldns codebase */
904 # define LDNS_BUILD_CONFIG_HAVE_SSL 1
928 #include <sys/param.h>
931 #ifdef HAVE_SYS_SOCKET_H
932 #include <sys/socket.h>
935 #ifdef HAVE_SYS_UIO_H
939 #ifdef HAVE_NETINET_IN_H
940 #include <netinet/in.h>
943 #ifdef HAVE_NETINET_TCP_H
944 #include <netinet/tcp.h>
947 #ifdef HAVE_ARPA_INET_H
948 #include <arpa/inet.h>
951 #ifdef HAVE_WINSOCK2_H
952 #include <winsock2.h>
955 #ifdef HAVE_WS2TCPIP_H
956 #include <ws2tcpip.h>
962 #define ARG_LL "%I64"
966 #define AF_LOCAL AF_UNIX
971 #ifdef HAVE_ATTR_FORMAT
972 # define ATTR_FORMAT(archetype, string_index, first_to_check) \
973 __attribute__ ((format (archetype, string_index, first_to_check)))
974 #else /* !HAVE_ATTR_FORMAT */
975 # define ATTR_FORMAT(archetype, string_index, first_to_check) /* empty */
976 #endif /* !HAVE_ATTR_FORMAT */
980 # define ATTR_UNUSED(x) x
981 #elif defined(__cplusplus)
982 # define ATTR_UNUSED(x)
983 #elif defined(HAVE_ATTR_UNUSED)
984 # define ATTR_UNUSED(x) x __attribute__((unused))
985 #else /* !HAVE_ATTR_UNUSED */
986 # define ATTR_UNUSED(x) x
987 #endif /* !HAVE_ATTR_UNUSED */
993 #endif /* HAVE_FSEEKO */
996 #ifndef MAXHOSTNAMELEN
997 #define MAXHOSTNAMELEN 256
1000 #if !defined(HAVE_SNPRINTF) || defined(SNPRINTF_RET_BROKEN)
1001 #define snprintf snprintf_unbound
1002 #define vsnprintf vsnprintf_unbound
1004 int snprintf (char *str, size_t count, const char *fmt, ...);
1005 int vsnprintf (char *str, size_t count, const char *fmt, va_list arg);
1006 #endif /* HAVE_SNPRINTF or SNPRINTF_RET_BROKEN */
1008 #ifndef HAVE_INET_PTON
1009 #define inet_pton inet_pton_unbound
1010 int inet_pton(int af, const char* src, void* dst);
1011 #endif /* HAVE_INET_PTON */
1014 #ifndef HAVE_INET_NTOP
1015 #define inet_ntop inet_ntop_unbound
1016 const char *inet_ntop(int af, const void *src, char *dst, size_t size);
1020 #ifndef HAVE_INET_ATON
1021 #define inet_aton inet_aton_unbound
1022 int inet_aton(const char *cp, struct in_addr *addr);
1026 #ifndef HAVE_MEMMOVE
1027 #define memmove memmove_unbound
1028 void *memmove(void *dest, const void *src, size_t n);
1032 #ifndef HAVE_STRLCAT
1033 #define strlcat strlcat_unbound
1034 size_t strlcat(char *dst, const char *src, size_t siz);
1038 #ifndef HAVE_STRLCPY
1039 #define strlcpy strlcpy_unbound
1040 size_t strlcpy(char *dst, const char *src, size_t siz);
1044 #ifndef HAVE_GMTIME_R
1045 #define gmtime_r gmtime_r_unbound
1046 struct tm *gmtime_r(const time_t *timep, struct tm *result);
1050 #ifndef HAVE_REALLOCARRAY
1051 #define reallocarray reallocarrayunbound
1052 void* reallocarray(void *ptr, size_t nmemb, size_t size);
1056 #if !defined(HAVE_SLEEP) || defined(HAVE_WINDOWS_H)
1057 #define sleep(x) Sleep((x)*1000) /* on win32 */
1058 #endif /* HAVE_SLEEP */
1062 #define usleep(x) Sleep((x)/1000 + 1) /* on win32 */
1063 #endif /* HAVE_USLEEP */
1067 #define random rand /* on win32, for tests only (bad random) */
1068 #endif /* HAVE_RANDOM */
1071 #ifndef HAVE_SRANDOM
1072 #define srandom(x) srand(x) /* on win32, for tests only (bad random) */
1073 #endif /* HAVE_SRANDOM */
1076 /* detect if we need to cast to unsigned int for FD_SET to avoid warnings */
1077 #ifdef HAVE_WINSOCK2_H
1078 #define FD_SET_T (u_int)
1084 #ifndef IPV6_MIN_MTU
1085 #define IPV6_MIN_MTU 1280
1086 #endif /* IPV6_MIN_MTU */
1089 #ifdef MEMCMP_IS_BROKEN
1090 #include "compat/memcmp.h"
1091 #define memcmp memcmp_unbound
1092 int memcmp(const void *x, const void *y, size_t n);
1097 #ifndef HAVE_CTIME_R
1098 #define ctime_r unbound_ctime_r
1099 char *ctime_r(const time_t *timep, char *buf);
1103 #define strsep unbound_strsep
1104 char *strsep(char **stringp, const char *delim);
1107 #ifndef HAVE_ISBLANK
1108 #define isblank unbound_isblank
1112 #if defined(HAVE_INET_NTOP) && !HAVE_DECL_INET_NTOP
1113 const char *inet_ntop(int af, const void *src, char *dst, size_t size);
1116 #if defined(HAVE_INET_PTON) && !HAVE_DECL_INET_PTON
1117 int inet_pton(int af, const char* src, void* dst);
1120 #if !defined(HAVE_STRPTIME) || !defined(STRPTIME_WORKS)
1121 #define strptime unbound_strptime
1123 char *strptime(const char *s, const char *format, struct tm *tm);
1126 #ifdef HAVE_LIBRESSL
1127 # if !HAVE_DECL_STRLCPY
1128 size_t strlcpy(char *dst, const char *src, size_t siz);
1130 # if !HAVE_DECL_STRLCAT
1131 size_t strlcat(char *dst, const char *src, size_t siz);
1133 # if !HAVE_DECL_ARC4RANDOM && defined(HAVE_ARC4RANDOM)
1134 uint32_t arc4random(void);
1136 # if !HAVE_DECL_ARC4RANDOM_UNIFORM && defined(HAVE_ARC4RANDOM_UNIFORM)
1137 uint32_t arc4random_uniform(uint32_t upper_bound);
1139 # if !HAVE_DECL_REALLOCARRAY
1140 void *reallocarray(void *ptr, size_t nmemb, size_t size);
1142 #endif /* HAVE_LIBRESSL */
1143 #ifndef HAVE_ARC4RANDOM
1144 void explicit_bzero(void* buf, size_t len);
1145 int getentropy(void* buf, size_t len);
1146 uint32_t arc4random(void);
1147 void arc4random_buf(void* buf, size_t n);
1148 void _ARC4_LOCK(void);
1149 void _ARC4_UNLOCK(void);
1151 #ifndef HAVE_ARC4RANDOM_UNIFORM
1152 uint32_t arc4random_uniform(uint32_t upper_bound);
1154 #ifdef COMPAT_SHA512
1155 #ifndef SHA512_DIGEST_LENGTH
1156 #define SHA512_BLOCK_LENGTH 128
1157 #define SHA512_DIGEST_LENGTH 64
1158 #define SHA512_DIGEST_STRING_LENGTH (SHA512_DIGEST_LENGTH * 2 + 1)
1159 typedef struct _SHA512_CTX {
1161 uint64_t bitcount[2];
1162 uint8_t buffer[SHA512_BLOCK_LENGTH];
1164 #endif /* SHA512_DIGEST_LENGTH */
1165 void SHA512_Init(SHA512_CTX*);
1166 void SHA512_Update(SHA512_CTX*, void*, size_t);
1167 void SHA512_Final(uint8_t[SHA512_DIGEST_LENGTH], SHA512_CTX*);
1168 unsigned char *SHA512(void* data, unsigned int data_len, unsigned char *digest);
1169 #endif /* COMPAT_SHA512 */
1173 #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))
1174 /* using version of libevent that is not threadsafe. */
1175 # define LIBEVENT_SIGNAL_PROBLEM 1
1178 #ifndef CHECKED_INET6
1179 # define CHECKED_INET6
1183 # define AF_INET6 28
1185 #endif /* CHECKED_INET6 */
1187 #ifndef HAVE_GETADDRINFO
1188 struct sockaddr_storage;
1189 #include "compat/fake-rfc2553.h"
1192 #ifdef UNBOUND_ALLOC_STATS
1193 # define malloc(s) unbound_stat_malloc_log(s, __FILE__, __LINE__, __func__)
1194 # define calloc(n,s) unbound_stat_calloc_log(n, s, __FILE__, __LINE__, __func__)
1195 # define free(p) unbound_stat_free_log(p, __FILE__, __LINE__, __func__)
1196 # define realloc(p,s) unbound_stat_realloc_log(p, s, __FILE__, __LINE__, __func__)
1197 void *unbound_stat_malloc(size_t size);
1198 void *unbound_stat_calloc(size_t nmemb, size_t size);
1199 void unbound_stat_free(void *ptr);
1200 void *unbound_stat_realloc(void *ptr, size_t size);
1201 void *unbound_stat_malloc_log(size_t size, const char* file, int line,
1203 void *unbound_stat_calloc_log(size_t nmemb, size_t size, const char* file,
1204 int line, const char* func);
1205 void unbound_stat_free_log(void *ptr, const char* file, int line,
1207 void *unbound_stat_realloc_log(void *ptr, size_t size, const char* file,
1208 int line, const char* func);
1209 #elif defined(UNBOUND_ALLOC_LITE)
1210 # include "util/alloc.h"
1211 #endif /* UNBOUND_ALLOC_LITE and UNBOUND_ALLOC_STATS */
1213 /** default port for DNS traffic. */
1214 #define UNBOUND_DNS_PORT 53
1215 /** default port for unbound control traffic, registered port with IANA,
1216 ub-dns-control 8953/tcp unbound dns nameserver control */
1217 #define UNBOUND_CONTROL_PORT 8953
1218 /** the version of unbound-control that this software implements */
1219 #define UNBOUND_CONTROL_VERSION 1