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 /* Whether the C compiler accepts the "weak" attribute */
48 /* Define to 1 if you have the `chown' function. */
51 /* Define to 1 if you have the `chroot' function. */
54 /* Define to 1 if you have the `CRYPTO_cleanup_all_ex_data' function. */
55 #undef HAVE_CRYPTO_CLEANUP_ALL_EX_DATA
57 /* Define to 1 if you have the `ctime_r' function. */
60 /* Define to 1 if you have the `daemon' function. */
63 /* Define to 1 if you have the declaration of `arc4random', and to 0 if you
65 #undef HAVE_DECL_ARC4RANDOM
67 /* Define to 1 if you have the declaration of `arc4random_uniform', and to 0
69 #undef HAVE_DECL_ARC4RANDOM_UNIFORM
71 /* Define to 1 if you have the declaration of `inet_ntop', and to 0 if you
73 #undef HAVE_DECL_INET_NTOP
75 /* Define to 1 if you have the declaration of `inet_pton', and to 0 if you
77 #undef HAVE_DECL_INET_PTON
79 /* Define to 1 if you have the declaration of `NID_secp384r1', and to 0 if you
81 #undef HAVE_DECL_NID_SECP384R1
83 /* Define to 1 if you have the declaration of `NID_X9_62_prime256v1', and to 0
85 #undef HAVE_DECL_NID_X9_62_PRIME256V1
87 /* Define to 1 if you have the declaration of `reallocarray', and to 0 if you
89 #undef HAVE_DECL_REALLOCARRAY
91 /* Define to 1 if you have the declaration of `sk_SSL_COMP_pop_free', and to 0
93 #undef HAVE_DECL_SK_SSL_COMP_POP_FREE
95 /* Define to 1 if you have the declaration of
96 `SSL_COMP_get_compression_methods', and to 0 if you don't. */
97 #undef HAVE_DECL_SSL_COMP_GET_COMPRESSION_METHODS
99 /* Define to 1 if you have the declaration of `SSL_CTX_set_ecdh_auto', and to
101 #undef HAVE_DECL_SSL_CTX_SET_ECDH_AUTO
103 /* Define to 1 if you have the declaration of `strlcat', and to 0 if you
105 #undef HAVE_DECL_STRLCAT
107 /* Define to 1 if you have the declaration of `strlcpy', and to 0 if you
109 #undef HAVE_DECL_STRLCPY
111 /* Define to 1 if you have the declaration of `XML_StopParser', and to 0 if
113 #undef HAVE_DECL_XML_STOPPARSER
115 /* Define to 1 if you have the <dlfcn.h> header file. */
118 /* Define to 1 if you have the `DSA_SIG_set0' function. */
119 #undef HAVE_DSA_SIG_SET0
121 /* Define to 1 if you have the <endian.h> header file. */
124 /* Define to 1 if you have the `endprotoent' function. */
125 #undef HAVE_ENDPROTOENT
127 /* Define to 1 if you have the `endpwent' function. */
130 /* Define to 1 if you have the `endservent' function. */
131 #undef HAVE_ENDSERVENT
133 /* Define to 1 if you have the `ERR_free_strings' function. */
134 #undef HAVE_ERR_FREE_STRINGS
136 /* Define to 1 if you have the `ERR_load_crypto_strings' function. */
137 #undef HAVE_ERR_LOAD_CRYPTO_STRINGS
139 /* Define to 1 if you have the `event_base_free' function. */
140 #undef HAVE_EVENT_BASE_FREE
142 /* Define to 1 if you have the `event_base_get_method' function. */
143 #undef HAVE_EVENT_BASE_GET_METHOD
145 /* Define to 1 if you have the `event_base_new' function. */
146 #undef HAVE_EVENT_BASE_NEW
148 /* Define to 1 if you have the `event_base_once' function. */
149 #undef HAVE_EVENT_BASE_ONCE
151 /* Define to 1 if you have the <event.h> header file. */
154 /* Define to 1 if you have the `EVP_cleanup' function. */
155 #undef HAVE_EVP_CLEANUP
157 /* Define to 1 if you have the `EVP_dss1' function. */
160 /* Define to 1 if you have the `EVP_MD_CTX_new' function. */
161 #undef HAVE_EVP_MD_CTX_NEW
163 /* Define to 1 if you have the `EVP_sha1' function. */
166 /* Define to 1 if you have the `EVP_sha256' function. */
167 #undef HAVE_EVP_SHA256
169 /* Define to 1 if you have the `EVP_sha512' function. */
170 #undef HAVE_EVP_SHA512
172 /* Define to 1 if you have the `ev_default_loop' function. */
173 #undef HAVE_EV_DEFAULT_LOOP
175 /* Define to 1 if you have the `ev_loop' function. */
178 /* Define to 1 if you have the <expat.h> header file. */
181 /* Define to 1 if you have the `fcntl' function. */
184 /* Define to 1 if you have the `FIPS_mode' function. */
185 #undef HAVE_FIPS_MODE
187 /* Define to 1 if you have the `fork' function. */
190 /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
193 /* Define to 1 if you have the `fsync' function. */
196 /* Whether getaddrinfo is available */
197 #undef HAVE_GETADDRINFO
199 /* Define to 1 if you have the `getauxval' function. */
200 #undef HAVE_GETAUXVAL
202 /* Define to 1 if you have the `getentropy' function. */
203 #undef HAVE_GETENTROPY
205 /* Define to 1 if you have the <getopt.h> header file. */
208 /* Define to 1 if you have the `getpwnam' function. */
211 /* Define to 1 if you have the `getrlimit' function. */
212 #undef HAVE_GETRLIMIT
214 /* Define to 1 if you have the `glob' function. */
217 /* Define to 1 if you have the <glob.h> header file. */
220 /* Define to 1 if you have the `gmtime_r' function. */
223 /* Define to 1 if you have the <grp.h> header file. */
226 /* If you have HMAC_Update */
227 #undef HAVE_HMAC_UPDATE
229 /* Define to 1 if you have the `inet_aton' function. */
230 #undef HAVE_INET_ATON
232 /* Define to 1 if you have the `inet_ntop' function. */
233 #undef HAVE_INET_NTOP
235 /* Define to 1 if you have the `inet_pton' function. */
236 #undef HAVE_INET_PTON
238 /* Define to 1 if you have the `initgroups' function. */
239 #undef HAVE_INITGROUPS
241 /* Define to 1 if you have the <inttypes.h> header file. */
242 #undef HAVE_INTTYPES_H
244 /* if the function 'ioctlsocket' is available */
245 #undef HAVE_IOCTLSOCKET
247 /* Define to 1 if you have the <iphlpapi.h> header file. */
248 #undef HAVE_IPHLPAPI_H
250 /* Define to 1 if you have the `isblank' function. */
253 /* Define to 1 if you have the `kill' function. */
256 /* Define if we have LibreSSL */
259 /* Define to 1 if you have the `localtime_r' function. */
260 #undef HAVE_LOCALTIME_R
262 /* Define to 1 if you have the <login_cap.h> header file. */
263 #undef HAVE_LOGIN_CAP_H
265 /* If have GNU libc compatible malloc */
268 /* Define to 1 if you have the `memmove' function. */
271 /* Define to 1 if you have the <memory.h> header file. */
274 /* Define to 1 if you have the <netdb.h> header file. */
277 /* Define to 1 if you have the <netinet/in.h> header file. */
278 #undef HAVE_NETINET_IN_H
280 /* Define to 1 if you have the <netinet/tcp.h> header file. */
281 #undef HAVE_NETINET_TCP_H
283 /* Use libnettle for crypto */
286 /* Define to 1 if you have the <nettle/dsa-compat.h> header file. */
287 #undef HAVE_NETTLE_DSA_COMPAT_H
289 /* Use libnss for crypto */
292 /* Define to 1 if you have the `OpenSSL_add_all_digests' function. */
293 #undef HAVE_OPENSSL_ADD_ALL_DIGESTS
295 /* Define to 1 if you have the <openssl/bn.h> header file. */
296 #undef HAVE_OPENSSL_BN_H
298 /* Define to 1 if you have the `OPENSSL_config' function. */
299 #undef HAVE_OPENSSL_CONFIG
301 /* Define to 1 if you have the <openssl/conf.h> header file. */
302 #undef HAVE_OPENSSL_CONF_H
304 /* Define to 1 if you have the <openssl/dh.h> header file. */
305 #undef HAVE_OPENSSL_DH_H
307 /* Define to 1 if you have the <openssl/dsa.h> header file. */
308 #undef HAVE_OPENSSL_DSA_H
310 /* Define to 1 if you have the <openssl/engine.h> header file. */
311 #undef HAVE_OPENSSL_ENGINE_H
313 /* Define to 1 if you have the <openssl/err.h> header file. */
314 #undef HAVE_OPENSSL_ERR_H
316 /* Define to 1 if you have the `OPENSSL_init_crypto' function. */
317 #undef HAVE_OPENSSL_INIT_CRYPTO
319 /* Define to 1 if you have the `OPENSSL_init_ssl' function. */
320 #undef HAVE_OPENSSL_INIT_SSL
322 /* Define to 1 if you have the <openssl/rand.h> header file. */
323 #undef HAVE_OPENSSL_RAND_H
325 /* Define to 1 if you have the <openssl/rsa.h> header file. */
326 #undef HAVE_OPENSSL_RSA_H
328 /* Define to 1 if you have the <openssl/ssl.h> header file. */
329 #undef HAVE_OPENSSL_SSL_H
331 /* Define if you have POSIX threads libraries and header files. */
334 /* Have PTHREAD_PRIO_INHERIT. */
335 #undef HAVE_PTHREAD_PRIO_INHERIT
337 /* Define to 1 if the system has the type `pthread_rwlock_t'. */
338 #undef HAVE_PTHREAD_RWLOCK_T
340 /* Define to 1 if the system has the type `pthread_spinlock_t'. */
341 #undef HAVE_PTHREAD_SPINLOCK_T
343 /* Define to 1 if you have the <pwd.h> header file. */
346 /* Define if you have Python libraries and header files. */
349 /* Define to 1 if you have the `random' function. */
352 /* Define to 1 if you have the `RAND_cleanup' function. */
353 #undef HAVE_RAND_CLEANUP
355 /* Define to 1 if you have the `reallocarray' function. */
356 #undef HAVE_REALLOCARRAY
358 /* Define to 1 if you have the `recvmsg' function. */
361 /* Define to 1 if you have the `sendmsg' function. */
364 /* Define to 1 if you have the `setregid' function. */
367 /* Define to 1 if you have the `setresgid' function. */
368 #undef HAVE_SETRESGID
370 /* Define to 1 if you have the `setresuid' function. */
371 #undef HAVE_SETRESUID
373 /* Define to 1 if you have the `setreuid' function. */
376 /* Define to 1 if you have the `setrlimit' function. */
377 #undef HAVE_SETRLIMIT
379 /* Define to 1 if you have the `setsid' function. */
382 /* Define to 1 if you have the `setusercontext' function. */
383 #undef HAVE_SETUSERCONTEXT
385 /* Define to 1 if you have the `SHA512_Update' function. */
386 #undef HAVE_SHA512_UPDATE
388 /* Define to 1 if you have the `sigprocmask' function. */
389 #undef HAVE_SIGPROCMASK
391 /* Define to 1 if you have the `sleep' function. */
394 /* Define to 1 if you have the `snprintf' function. */
397 /* Define to 1 if you have the `socketpair' function. */
398 #undef HAVE_SOCKETPAIR
400 /* Using Solaris threads */
401 #undef HAVE_SOLARIS_THREADS
403 /* Define to 1 if you have the `srandom' function. */
406 /* Define if you have the SSL libraries installed. */
409 /* Define to 1 if you have the `SSL_CTX_set_security_level' function. */
410 #undef HAVE_SSL_CTX_SET_SECURITY_LEVEL
412 /* Define to 1 if you have the <stdarg.h> header file. */
415 /* Define to 1 if you have the <stdbool.h> header file. */
416 #undef HAVE_STDBOOL_H
418 /* Define to 1 if you have the <stdint.h> header file. */
421 /* Define to 1 if you have the <stdlib.h> header file. */
424 /* Define to 1 if you have the `strftime' function. */
427 /* Define to 1 if you have the <strings.h> header file. */
428 #undef HAVE_STRINGS_H
430 /* Define to 1 if you have the <string.h> header file. */
433 /* Define to 1 if you have the `strlcat' function. */
436 /* Define to 1 if you have the `strlcpy' function. */
439 /* Define to 1 if you have the `strptime' function. */
442 /* Define to 1 if you have the `strsep' function. */
445 /* Define to 1 if `ipi_spec_dst' is a member of `struct in_pktinfo'. */
446 #undef HAVE_STRUCT_IN_PKTINFO_IPI_SPEC_DST
448 /* Define to 1 if `sun_len' is a member of `struct sockaddr_un'. */
449 #undef HAVE_STRUCT_SOCKADDR_UN_SUN_LEN
451 /* Define if you have Swig libraries and header files. */
454 /* Define to 1 if you have the <syslog.h> header file. */
457 /* Define to 1 if systemd should be used */
460 /* Define to 1 if you have the <sys/param.h> header file. */
461 #undef HAVE_SYS_PARAM_H
463 /* Define to 1 if you have the <sys/resource.h> header file. */
464 #undef HAVE_SYS_RESOURCE_H
466 /* Define to 1 if you have the <sys/sha2.h> header file. */
467 #undef HAVE_SYS_SHA2_H
469 /* Define to 1 if you have the <sys/socket.h> header file. */
470 #undef HAVE_SYS_SOCKET_H
472 /* Define to 1 if you have the <sys/stat.h> header file. */
473 #undef HAVE_SYS_STAT_H
475 /* Define to 1 if you have the <sys/sysctl.h> header file. */
476 #undef HAVE_SYS_SYSCTL_H
478 /* Define to 1 if you have the <sys/types.h> header file. */
479 #undef HAVE_SYS_TYPES_H
481 /* Define to 1 if you have the <sys/uio.h> header file. */
482 #undef HAVE_SYS_UIO_H
484 /* Define to 1 if you have the <sys/un.h> header file. */
487 /* Define to 1 if you have the <sys/wait.h> header file. */
488 #undef HAVE_SYS_WAIT_H
490 /* Define to 1 if you have the <time.h> header file. */
493 /* Define to 1 if you have the `tzset' function. */
496 /* Define to 1 if you have the <unistd.h> header file. */
499 /* Define to 1 if you have the `usleep' function. */
502 /* Define to 1 if you have the `vfork' function. */
505 /* Define to 1 if you have the <vfork.h> header file. */
508 /* Define to 1 if you have the <windows.h> header file. */
509 #undef HAVE_WINDOWS_H
511 /* Using Windows threads */
512 #undef HAVE_WINDOWS_THREADS
514 /* Define to 1 if you have the <winsock2.h> header file. */
515 #undef HAVE_WINSOCK2_H
517 /* Define to 1 if `fork' works. */
518 #undef HAVE_WORKING_FORK
520 /* Define to 1 if `vfork' works. */
521 #undef HAVE_WORKING_VFORK
523 /* Define to 1 if you have the `writev' function. */
526 /* Define to 1 if you have the <ws2tcpip.h> header file. */
527 #undef HAVE_WS2TCPIP_H
529 /* Define to 1 if you have the `_beginthreadex' function. */
530 #undef HAVE__BEGINTHREADEX
532 /* if lex has yylex_destroy */
533 #undef LEX_HAS_YYLEX_DESTROY
535 /* Define to the sub-directory where libtool stores uninstalled libraries. */
538 /* Define to the maximum message length to pass to syslog. */
539 #undef MAXSYSLOGMSGLEN
541 /* Define if memcmp() does not compare unsigned bytes */
542 #undef MEMCMP_IS_BROKEN
544 /* Define if mkdir has one argument. */
545 #undef MKDIR_HAS_ONE_ARG
547 /* Define if the network stack does not fully support nonblocking io (causes
548 lower performance). */
549 #undef NONBLOCKING_IS_BROKEN
551 /* Put -D_ALL_SOURCE define in config.h */
552 #undef OMITTED__D_ALL_SOURCE
554 /* Put -D_BSD_SOURCE define in config.h */
555 #undef OMITTED__D_BSD_SOURCE
557 /* Put -D_DEFAULT_SOURCE define in config.h */
558 #undef OMITTED__D_DEFAULT_SOURCE
560 /* Put -D_GNU_SOURCE define in config.h */
561 #undef OMITTED__D_GNU_SOURCE
563 /* Put -D_LARGEFILE_SOURCE=1 define in config.h */
564 #undef OMITTED__D_LARGEFILE_SOURCE_1
566 /* Put -D_POSIX_C_SOURCE=200112 define in config.h */
567 #undef OMITTED__D_POSIX_C_SOURCE_200112
569 /* Put -D_XOPEN_SOURCE=600 define in config.h */
570 #undef OMITTED__D_XOPEN_SOURCE_600
572 /* Put -D_XOPEN_SOURCE_EXTENDED=1 define in config.h */
573 #undef OMITTED__D_XOPEN_SOURCE_EXTENDED_1
575 /* Put -D__EXTENSIONS__ define in config.h */
576 #undef OMITTED__D__EXTENSIONS__
578 /* Define to the address where bug reports for this package should be sent. */
579 #undef PACKAGE_BUGREPORT
581 /* Define to the full name of this package. */
584 /* Define to the full name and version of this package. */
585 #undef PACKAGE_STRING
587 /* Define to the one symbol short name of this package. */
588 #undef PACKAGE_TARNAME
590 /* Define to the home page for this package. */
593 /* Define to the version of this package. */
594 #undef PACKAGE_VERSION
596 /* default pidfile location */
599 /* Define to necessary symbol if this constant uses a non-standard name on
601 #undef PTHREAD_CREATE_JOINABLE
603 /* Define as the return type of signal handlers (`int' or `void'). */
606 /* default rootkey location */
607 #undef ROOT_ANCHOR_FILE
609 /* default rootcert location */
610 #undef ROOT_CERT_FILE
612 /* version number for resource files */
613 #undef RSRC_PACKAGE_VERSION
615 /* Directory to chdir to */
621 /* The size of `time_t', as computed by sizeof. */
624 /* define if (v)snprintf does not return length needed, (but length used) */
625 #undef SNPRINTF_RET_BROKEN
627 /* Define to 1 if you have the ANSI C header files. */
630 /* use default strptime. */
631 #undef STRPTIME_WORKS
633 /* Use win32 resources and API */
636 /* default username */
639 /* use to enable lightweight alloc assertions, for debug use */
640 #undef UNBOUND_ALLOC_LITE
642 /* use malloc not regions, for debug use */
643 #undef UNBOUND_ALLOC_NONREGIONAL
645 /* use statistics for allocs and frees, for debug use */
646 #undef UNBOUND_ALLOC_STATS
648 /* define this to enable debug checks. */
651 /* Define to 1 to use cachedb support */
654 /* Define to 1 to enable dnstap support */
657 /* Define this to enable DSA support. */
660 /* Define this to enable ECDSA support. */
663 /* Define this to enable an EVP workaround for older openssl */
664 #undef USE_ECDSA_EVP_WORKAROUND
666 /* Define this to enable GOST support. */
669 /* Define if you want to use internal select based events */
670 #undef USE_MINI_EVENT
672 /* Define this to enable client TCP Fast Open. */
673 #undef USE_MSG_FASTOPEN
675 /* Define this to enable client TCP Fast Open. */
676 #undef USE_OSX_MSG_FASTOPEN
678 /* Define this to enable SHA256 and SHA512 support. */
681 /* Enable extensions on AIX 3, Interix. */
685 /* Enable GNU extensions on systems that have them. */
689 /* Enable threading extensions on Solaris. */
690 #ifndef _POSIX_PTHREAD_SEMANTICS
691 # undef _POSIX_PTHREAD_SEMANTICS
693 /* Enable extensions on HP NonStop. */
694 #ifndef _TANDEM_SOURCE
695 # undef _TANDEM_SOURCE
697 /* Enable general extensions on Solaris. */
698 #ifndef __EXTENSIONS__
699 # undef __EXTENSIONS__
703 /* Define this to enable server TCP Fast Open. */
704 #undef USE_TCP_FASTOPEN
706 /* Whether the windows socket API is used */
709 /* the version of the windows API enabled */
712 /* Define if you want Python module. */
713 #undef WITH_PYTHONMODULE
715 /* Define if you want PyUnbound. */
716 #undef WITH_PYUNBOUND
718 /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
720 #undef YYTEXT_POINTER
722 /* Enable large inode numbers on Mac OS X 10.5. */
723 #ifndef _DARWIN_USE_64_BIT_INODE
724 # define _DARWIN_USE_64_BIT_INODE 1
727 /* Number of bits in a file offset, on hosts where this is settable. */
728 #undef _FILE_OFFSET_BITS
730 /* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
731 #undef _LARGEFILE_SOURCE
733 /* Define for large files, on AIX-style hosts. */
736 /* Define to 1 if on MINIX. */
739 /* Enable for compile on Minix */
740 #undef _NETBSD_SOURCE
742 /* Define to 2 if the system does not provide POSIX.1 features except with
744 #undef _POSIX_1_SOURCE
746 /* Define to 1 if you need to in order for `stat' and other things to work. */
749 /* Define to empty if `const' does not conform to ANSI C. */
752 /* Define to `int' if <sys/types.h> doesn't define. */
761 /* Define to `__inline__' or `__inline' if that's what the C compiler
762 calls it, or to nothing if 'inline' is not supported under any name. */
767 /* Define to `short' if <sys/types.h> does not define. */
770 /* Define to `int' if <sys/types.h> does not define. */
773 /* Define to `long long' if <sys/types.h> does not define. */
776 /* Define to `signed char' if <sys/types.h> does not define. */
779 /* Define if replacement function should be used. */
782 /* Define to `long int' if <sys/types.h> does not define. */
785 /* Define to `int' if <sys/types.h> does not define. */
788 /* Define to 'int' if not defined */
791 /* Define to `unsigned int' if <sys/types.h> does not define. */
794 /* Define to 'int' if not defined */
797 /* Define to `int' if <sys/types.h> does not define. */
800 /* Define to 'unsigned char if not defined */
803 /* Define to `int' if <sys/types.h> doesn't define. */
806 /* Define to `unsigned short' if <sys/types.h> does not define. */
809 /* Define to `unsigned int' if <sys/types.h> does not define. */
812 /* Define to `unsigned long long' if <sys/types.h> does not define. */
815 /* Define to `unsigned char' if <sys/types.h> does not define. */
818 /* Define as `fork' if `vfork' does not work. */
821 #if defined(OMITTED__D_GNU_SOURCE) && !defined(_GNU_SOURCE)
822 #define _GNU_SOURCE 1
825 #if defined(OMITTED__D_BSD_SOURCE) && !defined(_BSD_SOURCE)
826 #define _BSD_SOURCE 1
829 #if defined(OMITTED__D_DEFAULT_SOURCE) && !defined(_DEFAULT_SOURCE)
830 #define _DEFAULT_SOURCE 1
833 #if defined(OMITTED__D__EXTENSIONS__) && !defined(__EXTENSIONS__)
834 #define __EXTENSIONS__ 1
837 #if defined(OMITTED__D_POSIX_C_SOURCE_200112) && !defined(_POSIX_C_SOURCE)
838 #define _POSIX_C_SOURCE 200112
841 #if defined(OMITTED__D_XOPEN_SOURCE_600) && !defined(_XOPEN_SOURCE)
842 #define _XOPEN_SOURCE 600
845 #if defined(OMITTED__D_XOPEN_SOURCE_EXTENDED_1) && !defined(_XOPEN_SOURCE_EXTENDED)
846 #define _XOPEN_SOURCE_EXTENDED 1
849 #if defined(OMITTED__D_ALL_SOURCE) && !defined(_ALL_SOURCE)
850 #define _ALL_SOURCE 1
853 #if defined(OMITTED__D_LARGEFILE_SOURCE_1) && !defined(_LARGEFILE_SOURCE)
854 #define _LARGEFILE_SOURCE 1
860 #ifndef UNBOUND_DEBUG
864 /** Use small-ldns codebase */
867 # define LDNS_BUILD_CONFIG_HAVE_SSL 1
891 #include <sys/param.h>
894 #ifdef HAVE_SYS_SOCKET_H
895 #include <sys/socket.h>
898 #ifdef HAVE_SYS_UIO_H
902 #ifdef HAVE_NETINET_IN_H
903 #include <netinet/in.h>
906 #ifdef HAVE_NETINET_TCP_H
907 #include <netinet/tcp.h>
910 #ifdef HAVE_ARPA_INET_H
911 #include <arpa/inet.h>
914 #ifdef HAVE_WINSOCK2_H
915 #include <winsock2.h>
918 #ifdef HAVE_WS2TCPIP_H
919 #include <ws2tcpip.h>
925 #define ARG_LL "%I64"
929 #define AF_LOCAL AF_UNIX
934 #ifdef HAVE_ATTR_FORMAT
935 # define ATTR_FORMAT(archetype, string_index, first_to_check) \
936 __attribute__ ((format (archetype, string_index, first_to_check)))
937 #else /* !HAVE_ATTR_FORMAT */
938 # define ATTR_FORMAT(archetype, string_index, first_to_check) /* empty */
939 #endif /* !HAVE_ATTR_FORMAT */
943 # define ATTR_UNUSED(x) x
944 #elif defined(__cplusplus)
945 # define ATTR_UNUSED(x)
946 #elif defined(HAVE_ATTR_UNUSED)
947 # define ATTR_UNUSED(x) x __attribute__((unused))
948 #else /* !HAVE_ATTR_UNUSED */
949 # define ATTR_UNUSED(x) x
950 #endif /* !HAVE_ATTR_UNUSED */
956 #endif /* HAVE_FSEEKO */
959 #ifndef MAXHOSTNAMELEN
960 #define MAXHOSTNAMELEN 256
963 #if !defined(HAVE_SNPRINTF) || defined(SNPRINTF_RET_BROKEN)
964 #define snprintf snprintf_unbound
965 #define vsnprintf vsnprintf_unbound
967 int snprintf (char *str, size_t count, const char *fmt, ...);
968 int vsnprintf (char *str, size_t count, const char *fmt, va_list arg);
969 #endif /* HAVE_SNPRINTF or SNPRINTF_RET_BROKEN */
971 #ifndef HAVE_INET_PTON
972 #define inet_pton inet_pton_unbound
973 int inet_pton(int af, const char* src, void* dst);
974 #endif /* HAVE_INET_PTON */
977 #ifndef HAVE_INET_NTOP
978 #define inet_ntop inet_ntop_unbound
979 const char *inet_ntop(int af, const void *src, char *dst, size_t size);
983 #ifndef HAVE_INET_ATON
984 #define inet_aton inet_aton_unbound
985 int inet_aton(const char *cp, struct in_addr *addr);
990 #define memmove memmove_unbound
991 void *memmove(void *dest, const void *src, size_t n);
996 #define strlcat strlcat_unbound
997 size_t strlcat(char *dst, const char *src, size_t siz);
1001 #ifndef HAVE_STRLCPY
1002 #define strlcpy strlcpy_unbound
1003 size_t strlcpy(char *dst, const char *src, size_t siz);
1007 #ifndef HAVE_GMTIME_R
1008 #define gmtime_r gmtime_r_unbound
1009 struct tm *gmtime_r(const time_t *timep, struct tm *result);
1013 #ifndef HAVE_REALLOCARRAY
1014 #define reallocarray reallocarrayunbound
1015 void* reallocarray(void *ptr, size_t nmemb, size_t size);
1019 #if !defined(HAVE_SLEEP) || defined(HAVE_WINDOWS_H)
1020 #define sleep(x) Sleep((x)*1000) /* on win32 */
1021 #endif /* HAVE_SLEEP */
1025 #define usleep(x) Sleep((x)/1000 + 1) /* on win32 */
1026 #endif /* HAVE_USLEEP */
1030 #define random rand /* on win32, for tests only (bad random) */
1031 #endif /* HAVE_RANDOM */
1034 #ifndef HAVE_SRANDOM
1035 #define srandom(x) srand(x) /* on win32, for tests only (bad random) */
1036 #endif /* HAVE_SRANDOM */
1039 /* detect if we need to cast to unsigned int for FD_SET to avoid warnings */
1040 #ifdef HAVE_WINSOCK2_H
1041 #define FD_SET_T (u_int)
1047 #ifndef IPV6_MIN_MTU
1048 #define IPV6_MIN_MTU 1280
1049 #endif /* IPV6_MIN_MTU */
1052 #ifdef MEMCMP_IS_BROKEN
1053 #include "compat/memcmp.h"
1054 #define memcmp memcmp_unbound
1055 int memcmp(const void *x, const void *y, size_t n);
1060 #ifndef HAVE_CTIME_R
1061 #define ctime_r unbound_ctime_r
1062 char *ctime_r(const time_t *timep, char *buf);
1066 #define strsep unbound_strsep
1067 char *strsep(char **stringp, const char *delim);
1070 #ifndef HAVE_ISBLANK
1071 #define isblank unbound_isblank
1075 #if defined(HAVE_INET_NTOP) && !HAVE_DECL_INET_NTOP
1076 const char *inet_ntop(int af, const void *src, char *dst, size_t size);
1079 #if defined(HAVE_INET_PTON) && !HAVE_DECL_INET_PTON
1080 int inet_pton(int af, const char* src, void* dst);
1083 #if !defined(HAVE_STRPTIME) || !defined(STRPTIME_WORKS)
1084 #define strptime unbound_strptime
1086 char *strptime(const char *s, const char *format, struct tm *tm);
1089 #ifdef HAVE_LIBRESSL
1090 # if !HAVE_DECL_STRLCPY
1091 size_t strlcpy(char *dst, const char *src, size_t siz);
1093 # if !HAVE_DECL_STRLCAT
1094 size_t strlcat(char *dst, const char *src, size_t siz);
1096 # if !HAVE_DECL_ARC4RANDOM && defined(HAVE_ARC4RANDOM)
1097 uint32_t arc4random(void);
1099 # if !HAVE_DECL_ARC4RANDOM_UNIFORM && defined(HAVE_ARC4RANDOM_UNIFORM)
1100 uint32_t arc4random_uniform(uint32_t upper_bound);
1102 # if !HAVE_DECL_REALLOCARRAY
1103 void *reallocarray(void *ptr, size_t nmemb, size_t size);
1105 #endif /* HAVE_LIBRESSL */
1106 #ifndef HAVE_ARC4RANDOM
1107 void explicit_bzero(void* buf, size_t len);
1108 int getentropy(void* buf, size_t len);
1109 uint32_t arc4random(void);
1110 void arc4random_buf(void* buf, size_t n);
1111 void _ARC4_LOCK(void);
1112 void _ARC4_UNLOCK(void);
1114 #ifndef HAVE_ARC4RANDOM_UNIFORM
1115 uint32_t arc4random_uniform(uint32_t upper_bound);
1117 #ifdef COMPAT_SHA512
1118 #ifndef SHA512_DIGEST_LENGTH
1119 #define SHA512_BLOCK_LENGTH 128
1120 #define SHA512_DIGEST_LENGTH 64
1121 #define SHA512_DIGEST_STRING_LENGTH (SHA512_DIGEST_LENGTH * 2 + 1)
1122 typedef struct _SHA512_CTX {
1124 uint64_t bitcount[2];
1125 uint8_t buffer[SHA512_BLOCK_LENGTH];
1127 #endif /* SHA512_DIGEST_LENGTH */
1128 void SHA512_Init(SHA512_CTX*);
1129 void SHA512_Update(SHA512_CTX*, void*, size_t);
1130 void SHA512_Final(uint8_t[SHA512_DIGEST_LENGTH], SHA512_CTX*);
1131 unsigned char *SHA512(void* data, unsigned int data_len, unsigned char *digest);
1132 #endif /* COMPAT_SHA512 */
1136 #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))
1137 /* using version of libevent that is not threadsafe. */
1138 # define LIBEVENT_SIGNAL_PROBLEM 1
1141 #ifndef CHECKED_INET6
1142 # define CHECKED_INET6
1146 # define AF_INET6 28
1148 #endif /* CHECKED_INET6 */
1150 #ifndef HAVE_GETADDRINFO
1151 struct sockaddr_storage;
1152 #include "compat/fake-rfc2553.h"
1155 #ifdef UNBOUND_ALLOC_STATS
1156 # define malloc(s) unbound_stat_malloc_log(s, __FILE__, __LINE__, __func__)
1157 # define calloc(n,s) unbound_stat_calloc_log(n, s, __FILE__, __LINE__, __func__)
1158 # define free(p) unbound_stat_free_log(p, __FILE__, __LINE__, __func__)
1159 # define realloc(p,s) unbound_stat_realloc_log(p, s, __FILE__, __LINE__, __func__)
1160 void *unbound_stat_malloc(size_t size);
1161 void *unbound_stat_calloc(size_t nmemb, size_t size);
1162 void unbound_stat_free(void *ptr);
1163 void *unbound_stat_realloc(void *ptr, size_t size);
1164 void *unbound_stat_malloc_log(size_t size, const char* file, int line,
1166 void *unbound_stat_calloc_log(size_t nmemb, size_t size, const char* file,
1167 int line, const char* func);
1168 void unbound_stat_free_log(void *ptr, const char* file, int line,
1170 void *unbound_stat_realloc_log(void *ptr, size_t size, const char* file,
1171 int line, const char* func);
1172 #elif defined(UNBOUND_ALLOC_LITE)
1173 # include "util/alloc.h"
1174 #endif /* UNBOUND_ALLOC_LITE and UNBOUND_ALLOC_STATS */
1176 /** default port for DNS traffic. */
1177 #define UNBOUND_DNS_PORT 53
1178 /** default port for unbound control traffic, registered port with IANA,
1179 ub-dns-control 8953/tcp unbound dns nameserver control */
1180 #define UNBOUND_CONTROL_PORT 8953
1181 /** the version of unbound-control that this software implements */
1182 #define UNBOUND_CONTROL_VERSION 1