1 /* config.h. Generated from config.h.in by configure. */
2 /* config.h.in. Generated from configure.ac by autoheader. */
4 /* Directory to chroot to */
5 #define CHROOT_DIR "/var/unbound"
7 /* Do sha512 definitions in config.h */
8 /* #undef COMPAT_SHA512 */
10 /* Pathname to the Unbound configuration file */
11 #define CONFIGFILE "/var/unbound/unbound.conf"
13 /* Define this if on macOSX10.4-darwin8 and setreuid and setregid do not work
15 /* #undef DARWIN_BROKEN_SETREUID */
17 /* Whether daemon is deprecated */
18 /* #undef DEPRECATED_DAEMON */
20 /* default dnstap socket path */
21 /* #undef DNSTAP_SOCKET_PATH */
23 /* Define if you want to use debug lock checking (slow). */
24 /* #undef ENABLE_LOCK_CHECKS */
26 /* Define this if you enabled-allsymbols from libunbound to link binaries to
27 it for smaller install size, but the libunbound export table is polluted by
29 /* #undef EXPORT_ALL_SYMBOLS */
31 /* Define to 1 if you have the `arc4random' function. */
32 #define HAVE_ARC4RANDOM 1
34 /* Define to 1 if you have the `arc4random_uniform' function. */
35 #define HAVE_ARC4RANDOM_UNIFORM 1
37 /* Define to 1 if you have the <arpa/inet.h> header file. */
38 #define HAVE_ARPA_INET_H 1
40 /* Whether the C compiler accepts the "format" attribute */
41 #define HAVE_ATTR_FORMAT 1
43 /* Whether the C compiler accepts the "unused" attribute */
44 #define HAVE_ATTR_UNUSED 1
46 /* Define to 1 if you have the `chown' function. */
49 /* Define to 1 if you have the `chroot' function. */
52 /* Define to 1 if you have the `ctime_r' function. */
53 #define HAVE_CTIME_R 1
55 /* Define to 1 if you have the `daemon' function. */
58 /* Define to 1 if you have the declaration of `arc4random', and to 0 if you
60 /* #undef HAVE_DECL_ARC4RANDOM */
62 /* Define to 1 if you have the declaration of `arc4random_uniform', and to 0
64 /* #undef HAVE_DECL_ARC4RANDOM_UNIFORM */
66 /* Define to 1 if you have the declaration of `NID_secp384r1', and to 0 if you
68 #define HAVE_DECL_NID_SECP384R1 1
70 /* Define to 1 if you have the declaration of `NID_X9_62_prime256v1', and to 0
72 #define HAVE_DECL_NID_X9_62_PRIME256V1 1
74 /* Define to 1 if you have the declaration of `reallocarray', and to 0 if you
76 /* #undef HAVE_DECL_REALLOCARRAY */
78 /* Define to 1 if you have the declaration of `sk_SSL_COMP_pop_free', and to 0
80 #define HAVE_DECL_SK_SSL_COMP_POP_FREE 1
82 /* Define to 1 if you have the declaration of
83 `SSL_COMP_get_compression_methods', and to 0 if you don't. */
84 #define HAVE_DECL_SSL_COMP_GET_COMPRESSION_METHODS 1
86 /* Define to 1 if you have the declaration of `SSL_CTX_set_ecdh_auto', and to
88 #define HAVE_DECL_SSL_CTX_SET_ECDH_AUTO 0
90 /* Define to 1 if you have the declaration of `strlcat', and to 0 if you
92 /* #undef HAVE_DECL_STRLCAT */
94 /* Define to 1 if you have the declaration of `strlcpy', and to 0 if you
96 /* #undef HAVE_DECL_STRLCPY */
98 /* Define to 1 if you have the declaration of `XML_StopParser', and to 0 if
100 #define HAVE_DECL_XML_STOPPARSER 1
102 /* Define to 1 if you have the <dlfcn.h> header file. */
103 #define HAVE_DLFCN_H 1
105 /* Define to 1 if you have the <endian.h> header file. */
106 /* #undef HAVE_ENDIAN_H */
108 /* Define to 1 if you have the `endprotoent' function. */
109 #define HAVE_ENDPROTOENT 1
111 /* Define to 1 if you have the `endservent' function. */
112 #define HAVE_ENDSERVENT 1
114 /* Define to 1 if you have the `event_base_free' function. */
115 /* #undef HAVE_EVENT_BASE_FREE */
117 /* Define to 1 if you have the `event_base_get_method' function. */
118 /* #undef HAVE_EVENT_BASE_GET_METHOD */
120 /* Define to 1 if you have the `event_base_new' function. */
121 /* #undef HAVE_EVENT_BASE_NEW */
123 /* Define to 1 if you have the `event_base_once' function. */
124 /* #undef HAVE_EVENT_BASE_ONCE */
126 /* Define to 1 if you have the <event.h> header file. */
127 /* #undef HAVE_EVENT_H */
129 /* Define to 1 if you have the `EVP_sha1' function. */
130 #define HAVE_EVP_SHA1 1
132 /* Define to 1 if you have the `EVP_sha256' function. */
133 #define HAVE_EVP_SHA256 1
135 /* Define to 1 if you have the `EVP_sha512' function. */
136 #define HAVE_EVP_SHA512 1
138 /* Define to 1 if you have the `ev_default_loop' function. */
139 /* #undef HAVE_EV_DEFAULT_LOOP */
141 /* Define to 1 if you have the `ev_loop' function. */
142 /* #undef HAVE_EV_LOOP */
144 /* Define to 1 if you have the <expat.h> header file. */
145 #define HAVE_EXPAT_H 1
147 /* Define to 1 if you have the `fcntl' function. */
150 /* Define to 1 if you have the `FIPS_mode' function. */
151 #define HAVE_FIPS_MODE 1
153 /* Define to 1 if you have the `fork' function. */
156 /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
157 #define HAVE_FSEEKO 1
159 /* Define to 1 if you have the `fsync' function. */
162 /* Whether getaddrinfo is available */
163 #define HAVE_GETADDRINFO 1
165 /* Define to 1 if you have the `getauxval' function. */
166 /* #undef HAVE_GETAUXVAL */
168 /* Define to 1 if you have the `getentropy' function. */
169 /* #undef HAVE_GETENTROPY */
171 /* Define to 1 if you have the <getopt.h> header file. */
172 #define HAVE_GETOPT_H 1
174 /* Define to 1 if you have the `getpwnam' function. */
175 #define HAVE_GETPWNAM 1
177 /* Define to 1 if you have the `getrlimit' function. */
178 #define HAVE_GETRLIMIT 1
180 /* Define to 1 if you have the `glob' function. */
183 /* Define to 1 if you have the <glob.h> header file. */
184 #define HAVE_GLOB_H 1
186 /* Define to 1 if you have the `gmtime_r' function. */
187 #define HAVE_GMTIME_R 1
189 /* Define to 1 if you have the <grp.h> header file. */
192 /* If you have HMAC_CTX_init */
193 #define HAVE_HMAC_CTX_INIT 1
195 /* Define to 1 if you have the `inet_aton' function. */
196 #define HAVE_INET_ATON 1
198 /* Define to 1 if you have the `inet_ntop' function. */
199 #define HAVE_INET_NTOP 1
201 /* Define to 1 if you have the `inet_pton' function. */
202 #define HAVE_INET_PTON 1
204 /* Define to 1 if you have the `initgroups' function. */
205 #define HAVE_INITGROUPS 1
207 /* Define to 1 if you have the <inttypes.h> header file. */
208 #define HAVE_INTTYPES_H 1
210 /* if the function 'ioctlsocket' is available */
211 /* #undef HAVE_IOCTLSOCKET */
213 /* Define to 1 if you have the <iphlpapi.h> header file. */
214 /* #undef HAVE_IPHLPAPI_H */
216 /* Define to 1 if you have the `isblank' function. */
217 #define HAVE_ISBLANK 1
219 /* Define to 1 if you have the `kill' function. */
222 /* Define if we have LibreSSL */
223 /* #undef HAVE_LIBRESSL */
225 /* Define to 1 if you have the `localtime_r' function. */
226 #define HAVE_LOCALTIME_R 1
228 /* Define to 1 if you have the <login_cap.h> header file. */
229 #define HAVE_LOGIN_CAP_H 1
231 /* If have GNU libc compatible malloc */
232 #define HAVE_MALLOC 1
234 /* Define to 1 if you have the `memmove' function. */
235 #define HAVE_MEMMOVE 1
237 /* Define to 1 if you have the <memory.h> header file. */
238 #define HAVE_MEMORY_H 1
240 /* Define to 1 if you have the <netdb.h> header file. */
241 #define HAVE_NETDB_H 1
243 /* Define to 1 if you have the <netinet/in.h> header file. */
244 #define HAVE_NETINET_IN_H 1
246 /* Use libnettle for crypto */
247 /* #undef HAVE_NETTLE */
249 /* Use libnss for crypto */
250 /* #undef HAVE_NSS */
252 /* Define to 1 if you have the `OPENSSL_config' function. */
253 #define HAVE_OPENSSL_CONFIG 1
255 /* Define to 1 if you have the <openssl/conf.h> header file. */
256 #define HAVE_OPENSSL_CONF_H 1
258 /* Define to 1 if you have the <openssl/engine.h> header file. */
259 #define HAVE_OPENSSL_ENGINE_H 1
261 /* Define to 1 if you have the <openssl/err.h> header file. */
262 #define HAVE_OPENSSL_ERR_H 1
264 /* Define to 1 if you have the <openssl/rand.h> header file. */
265 #define HAVE_OPENSSL_RAND_H 1
267 /* Define to 1 if you have the <openssl/ssl.h> header file. */
268 #define HAVE_OPENSSL_SSL_H 1
270 /* Define if you have POSIX threads libraries and header files. */
271 #define HAVE_PTHREAD 1
273 /* Have PTHREAD_PRIO_INHERIT. */
274 #define HAVE_PTHREAD_PRIO_INHERIT 1
276 /* Define to 1 if the system has the type `pthread_rwlock_t'. */
277 #define HAVE_PTHREAD_RWLOCK_T 1
279 /* Define to 1 if the system has the type `pthread_spinlock_t'. */
280 #define HAVE_PTHREAD_SPINLOCK_T 1
282 /* Define to 1 if you have the <pwd.h> header file. */
285 /* Define if you have Python libraries and header files. */
286 /* #undef HAVE_PYTHON */
288 /* Define to 1 if you have the `random' function. */
289 #define HAVE_RANDOM 1
291 /* Define to 1 if you have the `reallocarray' function. */
292 /* #undef HAVE_REALLOCARRAY */
294 /* Define to 1 if you have the `recvmsg' function. */
295 #define HAVE_RECVMSG 1
297 /* Define to 1 if you have the `sbrk' function. */
298 /* #undef HAVE_SBRK */
300 /* Define to 1 if you have the `sendmsg' function. */
301 #define HAVE_SENDMSG 1
303 /* Define to 1 if you have the `setregid' function. */
304 /* #undef HAVE_SETREGID */
306 /* Define to 1 if you have the `setresgid' function. */
307 #define HAVE_SETRESGID 1
309 /* Define to 1 if you have the `setresuid' function. */
310 #define HAVE_SETRESUID 1
312 /* Define to 1 if you have the `setreuid' function. */
313 /* #undef HAVE_SETREUID */
315 /* Define to 1 if you have the `setrlimit' function. */
316 #define HAVE_SETRLIMIT 1
318 /* Define to 1 if you have the `setsid' function. */
319 #define HAVE_SETSID 1
321 /* Define to 1 if you have the `setusercontext' function. */
322 #define HAVE_SETUSERCONTEXT 1
324 /* Define to 1 if you have the `SHA512_Update' function. */
325 /* #undef HAVE_SHA512_UPDATE */
327 /* Define to 1 if you have the `sigprocmask' function. */
328 #define HAVE_SIGPROCMASK 1
330 /* Define to 1 if you have the `sleep' function. */
333 /* Define to 1 if you have the `snprintf' function. */
334 #define HAVE_SNPRINTF 1
336 /* Define to 1 if you have the `socketpair' function. */
337 #define HAVE_SOCKETPAIR 1
339 /* Using Solaris threads */
340 /* #undef HAVE_SOLARIS_THREADS */
342 /* Define to 1 if you have the `srandom' function. */
343 #define HAVE_SRANDOM 1
345 /* Define if you have the SSL libraries installed. */
346 #define HAVE_SSL /**/
348 /* Define to 1 if you have the <stdarg.h> header file. */
349 #define HAVE_STDARG_H 1
351 /* Define to 1 if you have the <stdbool.h> header file. */
352 #define HAVE_STDBOOL_H 1
354 /* Define to 1 if you have the <stdint.h> header file. */
355 #define HAVE_STDINT_H 1
357 /* Define to 1 if you have the <stdlib.h> header file. */
358 #define HAVE_STDLIB_H 1
360 /* Define to 1 if you have the `strftime' function. */
361 #define HAVE_STRFTIME 1
363 /* Define to 1 if you have the <strings.h> header file. */
364 #define HAVE_STRINGS_H 1
366 /* Define to 1 if you have the <string.h> header file. */
367 #define HAVE_STRING_H 1
369 /* Define to 1 if you have the `strlcat' function. */
370 #define HAVE_STRLCAT 1
372 /* Define to 1 if you have the `strlcpy' function. */
373 #define HAVE_STRLCPY 1
375 /* Define to 1 if you have the `strptime' function. */
376 #define HAVE_STRPTIME 1
378 /* Define to 1 if `ipi_spec_dst' is a member of `struct in_pktinfo'. */
379 /* #undef HAVE_STRUCT_IN_PKTINFO_IPI_SPEC_DST */
381 /* Define to 1 if `sun_len' is a member of `struct sockaddr_un'. */
382 #define HAVE_STRUCT_SOCKADDR_UN_SUN_LEN 1
384 /* Define if you have Swig libraries and header files. */
385 /* #undef HAVE_SWIG */
387 /* Define to 1 if you have the <syslog.h> header file. */
388 #define HAVE_SYSLOG_H 1
390 /* Define to 1 if you have the <sys/param.h> header file. */
391 #define HAVE_SYS_PARAM_H 1
393 /* Define to 1 if you have the <sys/resource.h> header file. */
394 #define HAVE_SYS_RESOURCE_H 1
396 /* Define to 1 if you have the <sys/sha2.h> header file. */
397 /* #undef HAVE_SYS_SHA2_H */
399 /* Define to 1 if you have the <sys/socket.h> header file. */
400 #define HAVE_SYS_SOCKET_H 1
402 /* Define to 1 if you have the <sys/stat.h> header file. */
403 #define HAVE_SYS_STAT_H 1
405 /* Define to 1 if you have the <sys/sysctl.h> header file. */
406 /* #undef HAVE_SYS_SYSCTL_H */
408 /* Define to 1 if you have the <sys/types.h> header file. */
409 #define HAVE_SYS_TYPES_H 1
411 /* Define to 1 if you have the <sys/uio.h> header file. */
412 #define HAVE_SYS_UIO_H 1
414 /* Define to 1 if you have the <sys/un.h> header file. */
415 #define HAVE_SYS_UN_H 1
417 /* Define to 1 if you have the <sys/wait.h> header file. */
418 #define HAVE_SYS_WAIT_H 1
420 /* Define to 1 if you have the <time.h> header file. */
421 #define HAVE_TIME_H 1
423 /* Define to 1 if you have the `tzset' function. */
426 /* Define to 1 if you have the <unistd.h> header file. */
427 #define HAVE_UNISTD_H 1
429 /* Define to 1 if you have the `usleep' function. */
430 #define HAVE_USLEEP 1
432 /* Define to 1 if you have the `vfork' function. */
435 /* Define to 1 if you have the <vfork.h> header file. */
436 /* #undef HAVE_VFORK_H */
438 /* Define to 1 if you have the <windows.h> header file. */
439 /* #undef HAVE_WINDOWS_H */
441 /* Using Windows threads */
442 /* #undef HAVE_WINDOWS_THREADS */
444 /* Define to 1 if you have the <winsock2.h> header file. */
445 /* #undef HAVE_WINSOCK2_H */
447 /* Define to 1 if `fork' works. */
448 #define HAVE_WORKING_FORK 1
450 /* Define to 1 if `vfork' works. */
451 #define HAVE_WORKING_VFORK 1
453 /* Define to 1 if you have the `writev' function. */
454 #define HAVE_WRITEV 1
456 /* Define to 1 if you have the <ws2tcpip.h> header file. */
457 /* #undef HAVE_WS2TCPIP_H */
459 /* Define to 1 if you have the `_beginthreadex' function. */
460 /* #undef HAVE__BEGINTHREADEX */
462 /* if lex has yylex_destroy */
463 #define LEX_HAS_YYLEX_DESTROY 1
465 /* Define to the sub-directory in which libtool stores uninstalled libraries.
467 #define LT_OBJDIR ".libs/"
469 /* Define to the maximum message length to pass to syslog. */
470 #define MAXSYSLOGMSGLEN 10240
472 /* Define if memcmp() does not compare unsigned bytes */
473 /* #undef MEMCMP_IS_BROKEN */
475 /* Define if mkdir has one argument. */
476 /* #undef MKDIR_HAS_ONE_ARG */
478 /* Define if the network stack does not fully support nonblocking io (causes
479 lower performance). */
480 /* #undef NONBLOCKING_IS_BROKEN */
482 /* Put -D_ALL_SOURCE define in config.h */
483 /* #undef OMITTED__D_ALL_SOURCE */
485 /* Put -D_BSD_SOURCE define in config.h */
486 /* #undef OMITTED__D_BSD_SOURCE */
488 /* Put -D_GNU_SOURCE define in config.h */
489 /* #undef OMITTED__D_GNU_SOURCE */
491 /* Put -D_LARGEFILE_SOURCE=1 define in config.h */
492 /* #undef OMITTED__D_LARGEFILE_SOURCE_1 */
494 /* Put -D_POSIX_C_SOURCE=200112 define in config.h */
495 /* #undef OMITTED__D_POSIX_C_SOURCE_200112 */
497 /* Put -D_XOPEN_SOURCE=600 define in config.h */
498 /* #undef OMITTED__D_XOPEN_SOURCE_600 */
500 /* Put -D_XOPEN_SOURCE_EXTENDED=1 define in config.h */
501 /* #undef OMITTED__D_XOPEN_SOURCE_EXTENDED_1 */
503 /* Put -D__EXTENSIONS__ define in config.h */
504 /* #undef OMITTED__D__EXTENSIONS__ */
506 /* Define to the address where bug reports for this package should be sent. */
507 #define PACKAGE_BUGREPORT "unbound-bugs@nlnetlabs.nl"
509 /* Define to the full name of this package. */
510 #define PACKAGE_NAME "unbound"
512 /* Define to the full name and version of this package. */
513 #define PACKAGE_STRING "unbound 1.5.7"
515 /* Define to the one symbol short name of this package. */
516 #define PACKAGE_TARNAME "unbound"
518 /* Define to the home page for this package. */
519 #define PACKAGE_URL ""
521 /* Define to the version of this package. */
522 #define PACKAGE_VERSION "1.5.7"
524 /* default pidfile location */
525 #define PIDFILE "/var/unbound/unbound.pid"
527 /* Define to necessary symbol if this constant uses a non-standard name on
529 /* #undef PTHREAD_CREATE_JOINABLE */
531 /* Define as the return type of signal handlers (`int' or `void'). */
532 #define RETSIGTYPE void
534 /* default rootkey location */
535 #define ROOT_ANCHOR_FILE "/var/unbound/root.key"
537 /* default rootcert location */
538 #define ROOT_CERT_FILE "/var/unbound/icannbundle.pem"
540 /* version number for resource files */
541 #define RSRC_PACKAGE_VERSION 1,5,7,0
543 /* Directory to chdir to */
544 #define RUN_DIR "/var/unbound"
547 #define SHARE_DIR "/var/unbound"
549 /* The size of `time_t', as computed by sizeof. */
550 #define SIZEOF_TIME_T 8
552 /* define if (v)snprintf does not return length needed, (but length used) */
553 /* #undef SNPRINTF_RET_BROKEN */
555 /* Define to 1 if you have the ANSI C header files. */
556 #define STDC_HEADERS 1
558 /* use default strptime. */
559 #define STRPTIME_WORKS 1
561 /* Use win32 resources and API */
562 /* #undef UB_ON_WINDOWS */
564 /* default username */
565 #define UB_USERNAME "unbound"
567 /* use to enable lightweight alloc assertions, for debug use */
568 /* #undef UNBOUND_ALLOC_LITE */
570 /* use malloc not regions, for debug use */
571 /* #undef UNBOUND_ALLOC_NONREGIONAL */
573 /* use statistics for allocs and frees, for debug use */
574 /* #undef UNBOUND_ALLOC_STATS */
576 /* define this to enable debug checks. */
577 /* #undef UNBOUND_DEBUG */
579 /* Define to 1 to enable dnstap support */
580 /* #undef USE_DNSTAP */
582 /* Define this to enable ECDSA support. */
585 /* Define this to enable an EVP workaround for older openssl */
586 /* #undef USE_ECDSA_EVP_WORKAROUND */
588 /* Define this to enable GOST support. */
591 /* Define if you want to use internal select based events */
592 #define USE_MINI_EVENT 1
594 /* Define this to enable SHA256 and SHA512 support. */
597 /* Enable extensions on AIX 3, Interix. */
599 # define _ALL_SOURCE 1
601 /* Enable GNU extensions on systems that have them. */
603 # define _GNU_SOURCE 1
605 /* Enable threading extensions on Solaris. */
606 #ifndef _POSIX_PTHREAD_SEMANTICS
607 # define _POSIX_PTHREAD_SEMANTICS 1
609 /* Enable extensions on HP NonStop. */
610 #ifndef _TANDEM_SOURCE
611 # define _TANDEM_SOURCE 1
613 /* Enable general extensions on Solaris. */
614 #ifndef __EXTENSIONS__
615 # define __EXTENSIONS__ 1
619 /* Whether the windows socket API is used */
620 /* #undef USE_WINSOCK */
622 /* the version of the windows API enabled */
623 #define WINVER 0x0502
625 /* Define if you want Python module. */
626 /* #undef WITH_PYTHONMODULE */
628 /* Define if you want PyUnbound. */
629 /* #undef WITH_PYUNBOUND */
631 /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
633 #define YYTEXT_POINTER 1
635 /* Enable large inode numbers on Mac OS X 10.5. */
636 #ifndef _DARWIN_USE_64_BIT_INODE
637 # define _DARWIN_USE_64_BIT_INODE 1
640 /* Number of bits in a file offset, on hosts where this is settable. */
641 /* #undef _FILE_OFFSET_BITS */
643 /* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
644 /* #undef _LARGEFILE_SOURCE */
646 /* Define for large files, on AIX-style hosts. */
647 /* #undef _LARGE_FILES */
649 /* Define to 1 if on MINIX. */
652 /* Enable for compile on Minix */
653 /* #undef _NETBSD_SOURCE */
655 /* Define to 2 if the system does not provide POSIX.1 features except with
657 /* #undef _POSIX_1_SOURCE */
659 /* Define to 1 if you need to in order for `stat' and other things to work. */
660 /* #undef _POSIX_SOURCE */
662 /* Define to empty if `const' does not conform to ANSI C. */
665 /* Define to `int' if <sys/types.h> doesn't define. */
669 /* #undef in_addr_t */
672 /* #undef in_port_t */
674 /* Define to `__inline__' or `__inline' if that's what the C compiler
675 calls it, or to nothing if 'inline' is not supported under any name. */
680 /* Define to `short' if <sys/types.h> does not define. */
683 /* Define to `int' if <sys/types.h> does not define. */
686 /* Define to `long long' if <sys/types.h> does not define. */
689 /* Define to `signed char' if <sys/types.h> does not define. */
692 /* Define if replacement function should be used. */
695 /* Define to `long int' if <sys/types.h> does not define. */
698 /* Define to `int' if <sys/types.h> does not define. */
701 /* Define to 'int' if not defined */
704 /* Define to `unsigned int' if <sys/types.h> does not define. */
707 /* Define to 'int' if not defined */
708 /* #undef socklen_t */
710 /* Define to `int' if <sys/types.h> does not define. */
713 /* Define to 'unsigned char if not defined */
716 /* Define to `int' if <sys/types.h> doesn't define. */
719 /* Define to `unsigned short' if <sys/types.h> does not define. */
720 /* #undef uint16_t */
722 /* Define to `unsigned int' if <sys/types.h> does not define. */
723 /* #undef uint32_t */
725 /* Define to `unsigned long long' if <sys/types.h> does not define. */
726 /* #undef uint64_t */
728 /* Define to `unsigned char' if <sys/types.h> does not define. */
731 /* Define as `fork' if `vfork' does not work. */
734 #if defined(OMITTED__D_GNU_SOURCE) && !defined(_GNU_SOURCE)
735 #define _GNU_SOURCE 1
738 #if defined(OMITTED__D_BSD_SOURCE) && !defined(_BSD_SOURCE)
739 #define _BSD_SOURCE 1
742 #if defined(OMITTED__D__EXTENSIONS__) && !defined(__EXTENSIONS__)
743 #define __EXTENSIONS__ 1
746 #if defined(OMITTED__D_POSIX_C_SOURCE_200112) && !defined(_POSIX_C_SOURCE)
747 #define _POSIX_C_SOURCE 200112
750 #if defined(OMITTED__D_XOPEN_SOURCE_600) && !defined(_XOPEN_SOURCE)
751 #define _XOPEN_SOURCE 600
754 #if defined(OMITTED__D_XOPEN_SOURCE_EXTENDED_1) && !defined(_XOPEN_SOURCE_EXTENDED)
755 #define _XOPEN_SOURCE_EXTENDED 1
758 #if defined(OMITTED__D_ALL_SOURCE) && !defined(_ALL_SOURCE)
759 #define _ALL_SOURCE 1
762 #if defined(OMITTED__D_LARGEFILE_SOURCE_1) && !defined(_LARGEFILE_SOURCE)
763 #define _LARGEFILE_SOURCE 1
769 #ifndef UNBOUND_DEBUG
773 /** Use small-ldns codebase */
776 # define LDNS_BUILD_CONFIG_HAVE_SSL 1
800 #include <sys/param.h>
803 #ifdef HAVE_SYS_SOCKET_H
804 #include <sys/socket.h>
807 #ifdef HAVE_SYS_UIO_H
811 #ifdef HAVE_NETINET_IN_H
812 #include <netinet/in.h>
815 #ifdef HAVE_ARPA_INET_H
816 #include <arpa/inet.h>
819 #ifdef HAVE_WINSOCK2_H
820 #include <winsock2.h>
823 #ifdef HAVE_WS2TCPIP_H
824 #include <ws2tcpip.h>
830 #define ARG_LL "%I64"
834 #define AF_LOCAL AF_UNIX
839 #ifdef HAVE_ATTR_FORMAT
840 # define ATTR_FORMAT(archetype, string_index, first_to_check) \
841 __attribute__ ((format (archetype, string_index, first_to_check)))
842 #else /* !HAVE_ATTR_FORMAT */
843 # define ATTR_FORMAT(archetype, string_index, first_to_check) /* empty */
844 #endif /* !HAVE_ATTR_FORMAT */
848 # define ATTR_UNUSED(x) x
849 #elif defined(__cplusplus)
850 # define ATTR_UNUSED(x)
851 #elif defined(HAVE_ATTR_UNUSED)
852 # define ATTR_UNUSED(x) x __attribute__((unused))
853 #else /* !HAVE_ATTR_UNUSED */
854 # define ATTR_UNUSED(x) x
855 #endif /* !HAVE_ATTR_UNUSED */
861 #endif /* HAVE_FSEEKO */
864 #ifndef MAXHOSTNAMELEN
865 #define MAXHOSTNAMELEN 256
868 #if !defined(HAVE_SNPRINTF) || defined(SNPRINTF_RET_BROKEN)
869 #define snprintf snprintf_unbound
870 #define vsnprintf vsnprintf_unbound
872 int snprintf (char *str, size_t count, const char *fmt, ...);
873 int vsnprintf (char *str, size_t count, const char *fmt, va_list arg);
874 #endif /* HAVE_SNPRINTF or SNPRINTF_RET_BROKEN */
876 #ifndef HAVE_INET_PTON
877 #define inet_pton inet_pton_unbound
878 int inet_pton(int af, const char* src, void* dst);
879 #endif /* HAVE_INET_PTON */
882 #ifndef HAVE_INET_NTOP
883 #define inet_ntop inet_ntop_unbound
884 const char *inet_ntop(int af, const void *src, char *dst, size_t size);
888 #ifndef HAVE_INET_ATON
889 #define inet_aton inet_aton_unbound
890 int inet_aton(const char *cp, struct in_addr *addr);
895 #define memmove memmove_unbound
896 void *memmove(void *dest, const void *src, size_t n);
901 #define strlcat strlcat_unbound
902 size_t strlcat(char *dst, const char *src, size_t siz);
907 #define strlcpy strlcpy_unbound
908 size_t strlcpy(char *dst, const char *src, size_t siz);
912 #ifndef HAVE_GMTIME_R
913 #define gmtime_r gmtime_r_unbound
914 struct tm *gmtime_r(const time_t *timep, struct tm *result);
918 #ifndef HAVE_REALLOCARRAY
919 #define reallocarray reallocarrayunbound
920 void* reallocarray(void *ptr, size_t nmemb, size_t size);
924 #if !defined(HAVE_SLEEP) || defined(HAVE_WINDOWS_H)
925 #define sleep(x) Sleep((x)*1000) /* on win32 */
926 #endif /* HAVE_SLEEP */
930 #define usleep(x) Sleep((x)/1000 + 1) /* on win32 */
931 #endif /* HAVE_USLEEP */
935 #define random rand /* on win32, for tests only (bad random) */
936 #endif /* HAVE_RANDOM */
940 #define srandom(x) srand(x) /* on win32, for tests only (bad random) */
941 #endif /* HAVE_SRANDOM */
944 /* detect if we need to cast to unsigned int for FD_SET to avoid warnings */
945 #ifdef HAVE_WINSOCK2_H
946 #define FD_SET_T (u_int)
953 #define IPV6_MIN_MTU 1280
954 #endif /* IPV6_MIN_MTU */
957 #ifdef MEMCMP_IS_BROKEN
958 #include "compat/memcmp.h"
959 #define memcmp memcmp_unbound
960 int memcmp(const void *x, const void *y, size_t n);
966 #define ctime_r unbound_ctime_r
967 char *ctime_r(const time_t *timep, char *buf);
971 #define isblank unbound_isblank
975 #if !defined(HAVE_STRPTIME) || !defined(STRPTIME_WORKS)
976 #define strptime unbound_strptime
978 char *strptime(const char *s, const char *format, struct tm *tm);
982 # if !HAVE_DECL_STRLCPY
983 size_t strlcpy(char *dst, const char *src, size_t siz);
985 # if !HAVE_DECL_STRLCAT
986 size_t strlcat(char *dst, const char *src, size_t siz);
988 # if !HAVE_DECL_ARC4RANDOM && defined(HAVE_ARC4RANDOM)
989 uint32_t arc4random(void);
991 # if !HAVE_DECL_ARC4RANDOM_UNIFORM && defined(HAVE_ARC4RANDOM_UNIFORM)
992 uint32_t arc4random_uniform(uint32_t upper_bound);
994 # if !HAVE_DECL_REALLOCARRAY
995 void *reallocarray(void *ptr, size_t nmemb, size_t size);
997 #endif /* HAVE_LIBRESSL */
998 #ifndef HAVE_ARC4RANDOM
999 void explicit_bzero(void* buf, size_t len);
1000 int getentropy(void* buf, size_t len);
1001 uint32_t arc4random(void);
1002 void arc4random_buf(void* buf, size_t n);
1003 void _ARC4_LOCK(void);
1004 void _ARC4_UNLOCK(void);
1006 #ifndef HAVE_ARC4RANDOM_UNIFORM
1007 uint32_t arc4random_uniform(uint32_t upper_bound);
1009 #ifdef COMPAT_SHA512
1010 #ifndef SHA512_DIGEST_LENGTH
1011 #define SHA512_BLOCK_LENGTH 128
1012 #define SHA512_DIGEST_LENGTH 64
1013 #define SHA512_DIGEST_STRING_LENGTH (SHA512_DIGEST_LENGTH * 2 + 1)
1014 typedef struct _SHA512_CTX {
1016 uint64_t bitcount[2];
1017 uint8_t buffer[SHA512_BLOCK_LENGTH];
1019 #endif /* SHA512_DIGEST_LENGTH */
1020 void SHA512_Init(SHA512_CTX*);
1021 void SHA512_Update(SHA512_CTX*, void*, size_t);
1022 void SHA512_Final(uint8_t[SHA512_DIGEST_LENGTH], SHA512_CTX*);
1023 unsigned char *SHA512(void* data, unsigned int data_len, unsigned char *digest);
1024 #endif /* COMPAT_SHA512 */
1028 #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))
1029 /* using version of libevent that is not threadsafe. */
1030 # define LIBEVENT_SIGNAL_PROBLEM 1
1033 #ifndef CHECKED_INET6
1034 # define CHECKED_INET6
1038 # define AF_INET6 28
1040 #endif /* CHECKED_INET6 */
1042 #ifndef HAVE_GETADDRINFO
1043 struct sockaddr_storage;
1044 #include "compat/fake-rfc2553.h"
1047 #ifdef UNBOUND_ALLOC_STATS
1048 # define malloc(s) unbound_stat_malloc_log(s, __FILE__, __LINE__, __func__)
1049 # define calloc(n,s) unbound_stat_calloc_log(n, s, __FILE__, __LINE__, __func__)
1050 # define free(p) unbound_stat_free_log(p, __FILE__, __LINE__, __func__)
1051 # define realloc(p,s) unbound_stat_realloc_log(p, s, __FILE__, __LINE__, __func__)
1052 void *unbound_stat_malloc(size_t size);
1053 void *unbound_stat_calloc(size_t nmemb, size_t size);
1054 void unbound_stat_free(void *ptr);
1055 void *unbound_stat_realloc(void *ptr, size_t size);
1056 void *unbound_stat_malloc_log(size_t size, const char* file, int line,
1058 void *unbound_stat_calloc_log(size_t nmemb, size_t size, const char* file,
1059 int line, const char* func);
1060 void unbound_stat_free_log(void *ptr, const char* file, int line,
1062 void *unbound_stat_realloc_log(void *ptr, size_t size, const char* file,
1063 int line, const char* func);
1064 #elif defined(UNBOUND_ALLOC_LITE)
1065 # include "util/alloc.h"
1066 #endif /* UNBOUND_ALLOC_LITE and UNBOUND_ALLOC_STATS */
1068 /** default port for DNS traffic. */
1069 #define UNBOUND_DNS_PORT 53
1070 /** default port for unbound control traffic, registered port with IANA,
1071 ub-dns-control 8953/tcp unbound dns nameserver control */
1072 #define UNBOUND_CONTROL_PORT 8953
1073 /** the version of unbound-control that this software implements */
1074 #define UNBOUND_CONTROL_VERSION 1