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 /* Pathname to the Unbound configuration file */
8 #define CONFIGFILE "/var/unbound/unbound.conf"
10 /* Define this if on macOSX10.4-darwin8 and setreuid and setregid do not work
12 /* #undef DARWIN_BROKEN_SETREUID */
14 /* Whether daemon is deprecated */
15 /* #undef DEPRECATED_DAEMON */
17 /* Define if you want to use debug lock checking (slow). */
18 /* #undef ENABLE_LOCK_CHECKS */
20 /* Define this if you enabled-allsymbols from libunbound to link binaries to
21 it for smaller install size, but the libunbound export table is polluted by
23 /* #undef EXPORT_ALL_SYMBOLS */
25 /* Define to 1 if you have the <arpa/inet.h> header file. */
26 #define HAVE_ARPA_INET_H 1
28 /* Whether the C compiler accepts the "format" attribute */
29 #define HAVE_ATTR_FORMAT 1
31 /* Whether the C compiler accepts the "unused" attribute */
32 #define HAVE_ATTR_UNUSED 1
34 /* Define to 1 if your system has a working `chown' function. */
37 /* Define to 1 if you have the `chroot' function. */
40 /* Define to 1 if you have the `ctime_r' function. */
41 #define HAVE_CTIME_R 1
43 /* Define to 1 if you have the `daemon' function. */
46 /* Define to 1 if you have the declaration of `NID_secp384r1', and to 0 if you
48 #define HAVE_DECL_NID_SECP384R1 1
50 /* Define to 1 if you have the declaration of `NID_X9_62_prime256v1', and to 0
52 #define HAVE_DECL_NID_X9_62_PRIME256V1 1
54 /* Define to 1 if you have the declaration of `sk_SSL_COMP_pop_free', and to 0
56 #define HAVE_DECL_SK_SSL_COMP_POP_FREE 1
58 /* Define to 1 if you have the declaration of
59 `SSL_COMP_get_compression_methods', and to 0 if you don't. */
60 #define HAVE_DECL_SSL_COMP_GET_COMPRESSION_METHODS 1
62 /* Define to 1 if you have the <dlfcn.h> header file. */
63 #define HAVE_DLFCN_H 1
65 /* Define to 1 if you have the `endprotoent' function. */
66 #define HAVE_ENDPROTOENT 1
68 /* Define to 1 if you have the `endservent' function. */
69 #define HAVE_ENDSERVENT 1
71 /* Define to 1 if you have the `event_base_free' function. */
72 /* #undef HAVE_EVENT_BASE_FREE */
74 /* Define to 1 if you have the `event_base_get_method' function. */
75 /* #undef HAVE_EVENT_BASE_GET_METHOD */
77 /* Define to 1 if you have the `event_base_new' function. */
78 /* #undef HAVE_EVENT_BASE_NEW */
80 /* Define to 1 if you have the `event_base_once' function. */
81 /* #undef HAVE_EVENT_BASE_ONCE */
83 /* Define to 1 if you have the <event.h> header file. */
84 /* #undef HAVE_EVENT_H */
86 /* Define to 1 if you have the `EVP_sha1' function. */
87 #define HAVE_EVP_SHA1 1
89 /* Define to 1 if you have the `EVP_sha256' function. */
90 #define HAVE_EVP_SHA256 1
92 /* Define to 1 if you have the `EVP_sha512' function. */
93 #define HAVE_EVP_SHA512 1
95 /* Define to 1 if you have the `ev_default_loop' function. */
96 /* #undef HAVE_EV_DEFAULT_LOOP */
98 /* Define to 1 if you have the `ev_loop' function. */
99 /* #undef HAVE_EV_LOOP */
101 /* Define to 1 if you have the <expat.h> header file. */
102 #define HAVE_EXPAT_H 1
104 /* Define to 1 if you have the `fcntl' function. */
107 /* Define to 1 if you have the `FIPS_mode' function. */
108 #define HAVE_FIPS_MODE 1
110 /* Define to 1 if you have the `fork' function. */
113 /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
114 #define HAVE_FSEEKO 1
116 /* Whether getaddrinfo is available */
117 #define HAVE_GETADDRINFO 1
119 /* Define to 1 if you have the <getopt.h> header file. */
120 #define HAVE_GETOPT_H 1
122 /* Define to 1 if you have the `getpwnam' function. */
123 #define HAVE_GETPWNAM 1
125 /* Define to 1 if you have the `getrlimit' function. */
126 #define HAVE_GETRLIMIT 1
128 /* Define to 1 if you have the `glob' function. */
131 /* Define to 1 if you have the <glob.h> header file. */
132 #define HAVE_GLOB_H 1
134 /* Define to 1 if you have the `gmtime_r' function. */
135 #define HAVE_GMTIME_R 1
137 /* Define to 1 if you have the <grp.h> header file. */
140 /* If you have HMAC_CTX_init */
141 #define HAVE_HMAC_CTX_INIT 1
143 /* Define to 1 if you have the `inet_aton' function. */
144 #define HAVE_INET_ATON 1
146 /* Define to 1 if you have the `inet_ntop' function. */
147 #define HAVE_INET_NTOP 1
149 /* Define to 1 if you have the `inet_pton' function. */
150 #define HAVE_INET_PTON 1
152 /* Define to 1 if you have the `initgroups' function. */
153 #define HAVE_INITGROUPS 1
155 /* Define to 1 if you have the <inttypes.h> header file. */
156 #define HAVE_INTTYPES_H 1
158 /* if the function 'ioctlsocket' is available */
159 /* #undef HAVE_IOCTLSOCKET */
161 /* Define to 1 if you have the <iphlpapi.h> header file. */
162 /* #undef HAVE_IPHLPAPI_H */
164 /* Define to 1 if you have the `kill' function. */
167 /* Define to 1 if you have the `localtime_r' function. */
168 #define HAVE_LOCALTIME_R 1
170 /* Define to 1 if you have the <login_cap.h> header file. */
171 #define HAVE_LOGIN_CAP_H 1
173 /* If have GNU libc compatible malloc */
174 #define HAVE_MALLOC 1
176 /* Define to 1 if you have the `memmove' function. */
177 #define HAVE_MEMMOVE 1
179 /* Define to 1 if you have the <memory.h> header file. */
180 #define HAVE_MEMORY_H 1
182 /* Define to 1 if you have the <netdb.h> header file. */
183 #define HAVE_NETDB_H 1
185 /* Define to 1 if you have the <netinet/in.h> header file. */
186 #define HAVE_NETINET_IN_H 1
188 /* Use libnss for crypto */
189 /* #undef HAVE_NSS */
191 /* Define to 1 if you have the `OPENSSL_config' function. */
192 #define HAVE_OPENSSL_CONFIG 1
194 /* Define to 1 if you have the <openssl/conf.h> header file. */
195 #define HAVE_OPENSSL_CONF_H 1
197 /* Define to 1 if you have the <openssl/engine.h> header file. */
198 #define HAVE_OPENSSL_ENGINE_H 1
200 /* Define to 1 if you have the <openssl/err.h> header file. */
201 #define HAVE_OPENSSL_ERR_H 1
203 /* Define to 1 if you have the <openssl/rand.h> header file. */
204 #define HAVE_OPENSSL_RAND_H 1
206 /* Define to 1 if you have the <openssl/ssl.h> header file. */
207 #define HAVE_OPENSSL_SSL_H 1
209 /* Define if you have POSIX threads libraries and header files. */
210 #define HAVE_PTHREAD 1
212 /* Have PTHREAD_PRIO_INHERIT. */
213 #define HAVE_PTHREAD_PRIO_INHERIT 1
215 /* Define to 1 if the system has the type `pthread_rwlock_t'. */
216 #define HAVE_PTHREAD_RWLOCK_T 1
218 /* Define to 1 if the system has the type `pthread_spinlock_t'. */
219 #define HAVE_PTHREAD_SPINLOCK_T 1
221 /* Define to 1 if you have the <pwd.h> header file. */
224 /* Define if you have Python libraries and header files. */
225 /* #undef HAVE_PYTHON */
227 /* Define to 1 if you have the `random' function. */
228 #define HAVE_RANDOM 1
230 /* Define to 1 if you have the `recvmsg' function. */
231 #define HAVE_RECVMSG 1
233 /* Define to 1 if you have the `sbrk' function. */
234 /* #undef HAVE_SBRK */
236 /* Define to 1 if you have the `sendmsg' function. */
237 #define HAVE_SENDMSG 1
239 /* Define to 1 if you have the `setregid' function. */
240 /* #undef HAVE_SETREGID */
242 /* Define to 1 if you have the `setresgid' function. */
243 #define HAVE_SETRESGID 1
245 /* Define to 1 if you have the `setresuid' function. */
246 #define HAVE_SETRESUID 1
248 /* Define to 1 if you have the `setreuid' function. */
249 /* #undef HAVE_SETREUID */
251 /* Define to 1 if you have the `setrlimit' function. */
252 #define HAVE_SETRLIMIT 1
254 /* Define to 1 if you have the `setsid' function. */
255 #define HAVE_SETSID 1
257 /* Define to 1 if you have the `setusercontext' function. */
258 #define HAVE_SETUSERCONTEXT 1
260 /* Define to 1 if you have the `sigprocmask' function. */
261 #define HAVE_SIGPROCMASK 1
263 /* Define to 1 if you have the `sleep' function. */
266 /* Define to 1 if you have the `snprintf' function. */
267 #define HAVE_SNPRINTF 1
269 /* Define to 1 if you have the `socketpair' function. */
270 #define HAVE_SOCKETPAIR 1
272 /* Using Solaris threads */
273 /* #undef HAVE_SOLARIS_THREADS */
275 /* Define to 1 if you have the `srandom' function. */
276 #define HAVE_SRANDOM 1
278 /* Define if you have the SSL libraries installed. */
279 #define HAVE_SSL /**/
281 /* Define to 1 if you have the <stdarg.h> header file. */
282 #define HAVE_STDARG_H 1
284 /* Define to 1 if you have the <stdbool.h> header file. */
285 #define HAVE_STDBOOL_H 1
287 /* Define to 1 if you have the <stdint.h> header file. */
288 #define HAVE_STDINT_H 1
290 /* Define to 1 if you have the <stdlib.h> header file. */
291 #define HAVE_STDLIB_H 1
293 /* Define to 1 if you have the `strftime' function. */
294 #define HAVE_STRFTIME 1
296 /* Define to 1 if you have the <strings.h> header file. */
297 #define HAVE_STRINGS_H 1
299 /* Define to 1 if you have the <string.h> header file. */
300 #define HAVE_STRING_H 1
302 /* Define to 1 if you have the `strlcat' function. */
303 #define HAVE_STRLCAT 1
305 /* Define to 1 if you have the `strlcpy' function. */
306 #define HAVE_STRLCPY 1
308 /* Define to 1 if you have the `strptime' function. */
309 #define HAVE_STRPTIME 1
311 /* Define to 1 if `ipi_spec_dst' is a member of `struct in_pktinfo'. */
312 /* #undef HAVE_STRUCT_IN_PKTINFO_IPI_SPEC_DST */
314 /* Define if you have Swig libraries and header files. */
315 /* #undef HAVE_SWIG */
317 /* Define to 1 if you have the <syslog.h> header file. */
318 #define HAVE_SYSLOG_H 1
320 /* Define to 1 if you have the <sys/param.h> header file. */
321 #define HAVE_SYS_PARAM_H 1
323 /* Define to 1 if you have the <sys/resource.h> header file. */
324 #define HAVE_SYS_RESOURCE_H 1
326 /* Define to 1 if you have the <sys/socket.h> header file. */
327 #define HAVE_SYS_SOCKET_H 1
329 /* Define to 1 if you have the <sys/stat.h> header file. */
330 #define HAVE_SYS_STAT_H 1
332 /* Define to 1 if you have the <sys/types.h> header file. */
333 #define HAVE_SYS_TYPES_H 1
335 /* Define to 1 if you have the <sys/uio.h> header file. */
336 #define HAVE_SYS_UIO_H 1
338 /* Define to 1 if you have the <sys/wait.h> header file. */
339 #define HAVE_SYS_WAIT_H 1
341 /* Define to 1 if you have the <time.h> header file. */
342 #define HAVE_TIME_H 1
344 /* Define to 1 if you have the `tzset' function. */
347 /* Define to 1 if you have the <unistd.h> header file. */
348 #define HAVE_UNISTD_H 1
350 /* Define to 1 if you have the `usleep' function. */
351 #define HAVE_USLEEP 1
353 /* Define to 1 if you have the `vfork' function. */
356 /* Define to 1 if you have the <vfork.h> header file. */
357 /* #undef HAVE_VFORK_H */
359 /* Define to 1 if you have the <windows.h> header file. */
360 /* #undef HAVE_WINDOWS_H */
362 /* Using Windows threads */
363 /* #undef HAVE_WINDOWS_THREADS */
365 /* Define to 1 if you have the <winsock2.h> header file. */
366 /* #undef HAVE_WINSOCK2_H */
368 /* Define to 1 if `fork' works. */
369 #define HAVE_WORKING_FORK 1
371 /* Define to 1 if `vfork' works. */
372 #define HAVE_WORKING_VFORK 1
374 /* Define to 1 if you have the `writev' function. */
375 #define HAVE_WRITEV 1
377 /* Define to 1 if you have the <ws2tcpip.h> header file. */
378 /* #undef HAVE_WS2TCPIP_H */
380 /* Define to 1 if you have the `_beginthreadex' function. */
381 /* #undef HAVE__BEGINTHREADEX */
383 /* if lex has yylex_destroy */
384 #define LEX_HAS_YYLEX_DESTROY 1
386 /* Define to the sub-directory in which libtool stores uninstalled libraries.
388 #define LT_OBJDIR ".libs/"
390 /* Define to the maximum message length to pass to syslog. */
391 #define MAXSYSLOGMSGLEN 10240
393 /* Define if memcmp() does not compare unsigned bytes */
394 /* #undef MEMCMP_IS_BROKEN */
396 /* Define if mkdir has one argument. */
397 /* #undef MKDIR_HAS_ONE_ARG */
399 /* Define if the network stack does not fully support nonblocking io (causes
400 lower performance). */
401 /* #undef NONBLOCKING_IS_BROKEN */
403 /* Put -D_ALL_SOURCE define in config.h */
404 /* #undef OMITTED__D_ALL_SOURCE */
406 /* Put -D_BSD_SOURCE define in config.h */
407 /* #undef OMITTED__D_BSD_SOURCE */
409 /* Put -D_GNU_SOURCE define in config.h */
410 /* #undef OMITTED__D_GNU_SOURCE */
412 /* Put -D_LARGEFILE_SOURCE=1 define in config.h */
413 /* #undef OMITTED__D_LARGEFILE_SOURCE_1 */
415 /* Put -D_POSIX_C_SOURCE=200112 define in config.h */
416 /* #undef OMITTED__D_POSIX_C_SOURCE_200112 */
418 /* Put -D_XOPEN_SOURCE=600 define in config.h */
419 /* #undef OMITTED__D_XOPEN_SOURCE_600 */
421 /* Put -D_XOPEN_SOURCE_EXTENDED=1 define in config.h */
422 /* #undef OMITTED__D_XOPEN_SOURCE_EXTENDED_1 */
424 /* Put -D__EXTENSIONS__ define in config.h */
425 /* #undef OMITTED__D__EXTENSIONS__ */
427 /* Define to the address where bug reports for this package should be sent. */
428 #define PACKAGE_BUGREPORT "unbound-bugs@nlnetlabs.nl"
430 /* Define to the full name of this package. */
431 #define PACKAGE_NAME "unbound"
433 /* Define to the full name and version of this package. */
434 #define PACKAGE_STRING "unbound 1.4.22"
436 /* Define to the one symbol short name of this package. */
437 #define PACKAGE_TARNAME "unbound"
439 /* Define to the home page for this package. */
440 #define PACKAGE_URL ""
442 /* Define to the version of this package. */
443 #define PACKAGE_VERSION "1.4.22"
445 /* default pidfile location */
446 #define PIDFILE "/var/unbound/unbound.pid"
448 /* Define to necessary symbol if this constant uses a non-standard name on
450 /* #undef PTHREAD_CREATE_JOINABLE */
452 /* Define as the return type of signal handlers (`int' or `void'). */
453 #define RETSIGTYPE void
455 /* default rootkey location */
456 #define ROOT_ANCHOR_FILE "/var/unbound/root.key"
458 /* default rootcert location */
459 #define ROOT_CERT_FILE "/var/unbound/icannbundle.pem"
461 /* version number for resource files */
462 #define RSRC_PACKAGE_VERSION 1,4,22,0
464 /* Directory to chdir to */
465 #define RUN_DIR "/var/unbound"
468 #define SHARE_DIR "/var/unbound"
470 /* The size of `time_t', as computed by sizeof. */
471 #define SIZEOF_TIME_T 8
473 /* Define to 1 if you have the ANSI C header files. */
474 #define STDC_HEADERS 1
476 /* use default strptime. */
477 #define STRPTIME_WORKS 1
479 /* Use win32 resources and API */
480 /* #undef UB_ON_WINDOWS */
482 /* default username */
483 #define UB_USERNAME "unbound"
485 /* use to enable lightweight alloc assertions, for debug use */
486 /* #undef UNBOUND_ALLOC_LITE */
488 /* use malloc not regions, for debug use */
489 /* #undef UNBOUND_ALLOC_NONREGIONAL */
491 /* use statistics for allocs and frees, for debug use */
492 /* #undef UNBOUND_ALLOC_STATS */
494 /* define this to enable debug checks. */
495 /* #undef UNBOUND_DEBUG */
497 /* Define this to enable ECDSA support. */
500 /* Define this to enable an EVP workaround for older openssl */
501 /* #undef USE_ECDSA_EVP_WORKAROUND */
503 /* Define this to enable GOST support. */
504 /* #undef USE_GOST */
506 /* Define if you want to use internal select based events */
507 #define USE_MINI_EVENT 1
509 /* Define this to enable SHA256 and SHA512 support. */
512 /* Enable extensions on AIX 3, Interix. */
514 # define _ALL_SOURCE 1
516 /* Enable GNU extensions on systems that have them. */
518 # define _GNU_SOURCE 1
520 /* Enable threading extensions on Solaris. */
521 #ifndef _POSIX_PTHREAD_SEMANTICS
522 # define _POSIX_PTHREAD_SEMANTICS 1
524 /* Enable extensions on HP NonStop. */
525 #ifndef _TANDEM_SOURCE
526 # define _TANDEM_SOURCE 1
528 /* Enable general extensions on Solaris. */
529 #ifndef __EXTENSIONS__
530 # define __EXTENSIONS__ 1
534 /* Whether the windows socket API is used */
535 /* #undef USE_WINSOCK */
537 /* the version of the windows API enabled */
538 #define WINVER 0x0502
540 /* Define if you want Python module. */
541 /* #undef WITH_PYTHONMODULE */
543 /* Define if you want PyUnbound. */
544 /* #undef WITH_PYUNBOUND */
546 /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
548 #define YYTEXT_POINTER 1
550 /* Enable large inode numbers on Mac OS X 10.5. */
551 #ifndef _DARWIN_USE_64_BIT_INODE
552 # define _DARWIN_USE_64_BIT_INODE 1
555 /* Number of bits in a file offset, on hosts where this is settable. */
556 /* #undef _FILE_OFFSET_BITS */
558 /* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
559 /* #undef _LARGEFILE_SOURCE */
561 /* Define for large files, on AIX-style hosts. */
562 /* #undef _LARGE_FILES */
564 /* Define to 1 if on MINIX. */
567 /* Enable for compile on Minix */
568 /* #undef _NETBSD_SOURCE */
570 /* Define to 2 if the system does not provide POSIX.1 features except with
572 /* #undef _POSIX_1_SOURCE */
574 /* Define to 1 if you need to in order for `stat' and other things to work. */
575 /* #undef _POSIX_SOURCE */
577 /* Define to empty if `const' does not conform to ANSI C. */
580 /* Define to `int' if <sys/types.h> doesn't define. */
584 /* #undef in_addr_t */
587 /* #undef in_port_t */
589 /* Define to `__inline__' or `__inline' if that's what the C compiler
590 calls it, or to nothing if 'inline' is not supported under any name. */
595 /* Define to `short' if <sys/types.h> does not define. */
598 /* Define to `int' if <sys/types.h> does not define. */
601 /* Define to `long long' if <sys/types.h> does not define. */
604 /* Define to `signed char' if <sys/types.h> does not define. */
607 /* Define if replacement function should be used. */
610 /* Define to `long int' if <sys/types.h> does not define. */
613 /* Define to `int' if <sys/types.h> does not define. */
616 /* Define to 'int' if not defined */
619 /* Define to `unsigned int' if <sys/types.h> does not define. */
622 /* Define to 'int' if not defined */
623 /* #undef socklen_t */
625 /* Define to `int' if <sys/types.h> does not define. */
628 /* Define to 'unsigned char if not defined */
631 /* Define to `int' if <sys/types.h> doesn't define. */
634 /* Define to `unsigned short' if <sys/types.h> does not define. */
635 /* #undef uint16_t */
637 /* Define to `unsigned int' if <sys/types.h> does not define. */
638 /* #undef uint32_t */
640 /* Define to `unsigned long long' if <sys/types.h> does not define. */
641 /* #undef uint64_t */
643 /* Define to `unsigned char' if <sys/types.h> does not define. */
646 /* Define as `fork' if `vfork' does not work. */
649 #if defined(OMITTED__D_GNU_SOURCE) && !defined(_GNU_SOURCE)
650 #define _GNU_SOURCE 1
653 #if defined(OMITTED__D_BSD_SOURCE) && !defined(_BSD_SOURCE)
654 #define _BSD_SOURCE 1
657 #if defined(OMITTED__D__EXTENSIONS__) && !defined(__EXTENSIONS__)
658 #define __EXTENSIONS__ 1
661 #if defined(OMITTED__D_POSIX_C_SOURCE_200112) && !defined(_POSIX_C_SOURCE)
662 #define _POSIX_C_SOURCE 200112
665 #if defined(OMITTED__D_XOPEN_SOURCE_600) && !defined(_XOPEN_SOURCE)
666 #define _XOPEN_SOURCE 600
669 #if defined(OMITTED__D_XOPEN_SOURCE_EXTENDED_1) && !defined(_XOPEN_SOURCE_EXTENDED)
670 #define _XOPEN_SOURCE_EXTENDED 1
673 #if defined(OMITTED__D_ALL_SOURCE) && !defined(_ALL_SOURCE)
674 #define _ALL_SOURCE 1
677 #if defined(OMITTED__D_LARGEFILE_SOURCE_1) && !defined(_LARGEFILE_SOURCE)
678 #define _LARGEFILE_SOURCE 1
684 #ifndef UNBOUND_DEBUG
688 /** Use small-ldns codebase */
691 # define LDNS_BUILD_CONFIG_HAVE_SSL 1
715 #include <sys/param.h>
718 #ifdef HAVE_SYS_SOCKET_H
719 #include <sys/socket.h>
722 #ifdef HAVE_SYS_UIO_H
726 #ifdef HAVE_NETINET_IN_H
727 #include <netinet/in.h>
730 #ifdef HAVE_ARPA_INET_H
731 #include <arpa/inet.h>
734 #ifdef HAVE_WINSOCK2_H
735 #include <winsock2.h>
738 #ifdef HAVE_WS2TCPIP_H
739 #include <ws2tcpip.h>
745 #define ARG_LL "%I64"
750 #ifdef HAVE_ATTR_FORMAT
751 # define ATTR_FORMAT(archetype, string_index, first_to_check) \
752 __attribute__ ((format (archetype, string_index, first_to_check)))
753 #else /* !HAVE_ATTR_FORMAT */
754 # define ATTR_FORMAT(archetype, string_index, first_to_check) /* empty */
755 #endif /* !HAVE_ATTR_FORMAT */
759 # define ATTR_UNUSED(x) x
760 #elif defined(__cplusplus)
761 # define ATTR_UNUSED(x)
762 #elif defined(HAVE_ATTR_UNUSED)
763 # define ATTR_UNUSED(x) x __attribute__((unused))
764 #else /* !HAVE_ATTR_UNUSED */
765 # define ATTR_UNUSED(x) x
766 #endif /* !HAVE_ATTR_UNUSED */
772 #endif /* HAVE_FSEEKO */
775 #ifndef MAXHOSTNAMELEN
776 #define MAXHOSTNAMELEN 256
780 #ifndef HAVE_SNPRINTF
781 #define snprintf snprintf_unbound
782 #define vsnprintf vsnprintf_unbound
784 int snprintf (char *str, size_t count, const char *fmt, ...);
785 int vsnprintf (char *str, size_t count, const char *fmt, va_list arg);
786 #endif /* HAVE_SNPRINTF */
789 #ifndef HAVE_INET_PTON
790 #define inet_pton inet_pton_unbound
791 int inet_pton(int af, const char* src, void* dst);
792 #endif /* HAVE_INET_PTON */
795 #ifndef HAVE_INET_NTOP
796 #define inet_ntop inet_ntop_unbound
797 const char *inet_ntop(int af, const void *src, char *dst, size_t size);
801 #ifndef HAVE_INET_ATON
802 #define inet_aton inet_aton_unbound
803 int inet_aton(const char *cp, struct in_addr *addr);
808 #define memmove memmove_unbound
809 void *memmove(void *dest, const void *src, size_t n);
814 #define strlcat strlcat_unbound
815 size_t strlcat(char *dst, const char *src, size_t siz);
820 #define strlcpy strlcpy_unbound
821 size_t strlcpy(char *dst, const char *src, size_t siz);
825 #ifndef HAVE_GMTIME_R
826 #define gmtime_r gmtime_r_unbound
827 struct tm *gmtime_r(const time_t *timep, struct tm *result);
831 #if !defined(HAVE_SLEEP) || defined(HAVE_WINDOWS_H)
832 #define sleep(x) Sleep((x)*1000) /* on win32 */
833 #endif /* HAVE_SLEEP */
837 #define usleep(x) Sleep((x)/1000 + 1) /* on win32 */
838 #endif /* HAVE_USLEEP */
842 #define random rand /* on win32, for tests only (bad random) */
843 #endif /* HAVE_RANDOM */
847 #define srandom(x) srand(x) /* on win32, for tests only (bad random) */
848 #endif /* HAVE_SRANDOM */
851 /* detect if we need to cast to unsigned int for FD_SET to avoid warnings */
852 #ifdef HAVE_WINSOCK2_H
853 #define FD_SET_T (u_int)
860 #define IPV6_MIN_MTU 1280
861 #endif /* IPV6_MIN_MTU */
864 #ifdef MEMCMP_IS_BROKEN
865 #include "compat/memcmp.h"
866 #define memcmp memcmp_unbound
867 int memcmp(const void *x, const void *y, size_t n);
873 #define ctime_r unbound_ctime_r
874 char *ctime_r(const time_t *timep, char *buf);
877 #if !defined(HAVE_STRPTIME) || !defined(STRPTIME_WORKS)
878 #define strptime unbound_strptime
880 char *strptime(const char *s, const char *format, struct tm *tm);
883 #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))
884 /* using version of libevent that is not threadsafe. */
885 # define LIBEVENT_SIGNAL_PROBLEM 1
888 #ifndef CHECKED_INET6
889 # define CHECKED_INET6
895 #endif /* CHECKED_INET6 */
897 #ifndef HAVE_GETADDRINFO
898 struct sockaddr_storage;
899 #include "compat/fake-rfc2553.h"
902 #ifdef UNBOUND_ALLOC_STATS
903 # define malloc(s) unbound_stat_malloc_log(s, __FILE__, __LINE__, __func__)
904 # define calloc(n,s) unbound_stat_calloc_log(n, s, __FILE__, __LINE__, __func__)
905 # define free(p) unbound_stat_free_log(p, __FILE__, __LINE__, __func__)
906 # define realloc(p,s) unbound_stat_realloc_log(p, s, __FILE__, __LINE__, __func__)
907 void *unbound_stat_malloc(size_t size);
908 void *unbound_stat_calloc(size_t nmemb, size_t size);
909 void unbound_stat_free(void *ptr);
910 void *unbound_stat_realloc(void *ptr, size_t size);
911 void *unbound_stat_malloc_log(size_t size, const char* file, int line,
913 void *unbound_stat_calloc_log(size_t nmemb, size_t size, const char* file,
914 int line, const char* func);
915 void unbound_stat_free_log(void *ptr, const char* file, int line,
917 void *unbound_stat_realloc_log(void *ptr, size_t size, const char* file,
918 int line, const char* func);
919 #elif defined(UNBOUND_ALLOC_LITE)
920 # include "util/alloc.h"
921 #endif /* UNBOUND_ALLOC_LITE and UNBOUND_ALLOC_STATS */
923 /** default port for DNS traffic. */
924 #define UNBOUND_DNS_PORT 53
925 /** default port for unbound control traffic, registered port with IANA,
926 ub-dns-control 8953/tcp unbound dns nameserver control */
927 #define UNBOUND_CONTROL_PORT 8953
928 /** the version of unbound-control that this software implements */
929 #define UNBOUND_CONTROL_VERSION 1