1/* config.h.  Generated from config.h.in by configure.  */
2/* config.h.in.  Generated from configure.ac by autoheader.  */
3
4/* Directory to chroot to */
5#define CHROOT_DIR "/var/unbound"
6
7/* Pathname to the Unbound configuration file */
8#define CONFIGFILE "/var/unbound/unbound.conf"
9
10/* Define this if on macOSX10.4-darwin8 and setreuid and setregid do not work
11   */
12/* #undef DARWIN_BROKEN_SETREUID */
13
14/* Whether daemon is deprecated */
15/* #undef DEPRECATED_DAEMON */
16
17/* Define if you want to use debug lock checking (slow). */
18/* #undef ENABLE_LOCK_CHECKS */
19
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
22   internal symbols */
23/* #undef EXPORT_ALL_SYMBOLS */
24
25/* Define to 1 if you have the <arpa/inet.h> header file. */
26#define HAVE_ARPA_INET_H 1
27
28/* Whether the C compiler accepts the "format" attribute */
29#define HAVE_ATTR_FORMAT 1
30
31/* Whether the C compiler accepts the "unused" attribute */
32#define HAVE_ATTR_UNUSED 1
33
34/* Define to 1 if your system has a working `chown' function. */
35#define HAVE_CHOWN 1
36
37/* Define to 1 if you have the `chroot' function. */
38#define HAVE_CHROOT 1
39
40/* Define to 1 if you have the `ctime_r' function. */
41#define HAVE_CTIME_R 1
42
43/* Define to 1 if you have the `daemon' function. */
44#define HAVE_DAEMON 1
45
46/* Define to 1 if you have the declaration of `NID_secp384r1', and to 0 if you
47   don't. */
48#define HAVE_DECL_NID_SECP384R1 1
49
50/* Define to 1 if you have the declaration of `NID_X9_62_prime256v1', and to 0
51   if you don't. */
52#define HAVE_DECL_NID_X9_62_PRIME256V1 1
53
54/* Define to 1 if you have the declaration of `sk_SSL_COMP_pop_free', and to 0
55   if you don't. */
56#define HAVE_DECL_SK_SSL_COMP_POP_FREE 1
57
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
61
62/* Define to 1 if you have the <dlfcn.h> header file. */
63#define HAVE_DLFCN_H 1
64
65/* Define to 1 if you have the `event_base_free' function. */
66/* #undef HAVE_EVENT_BASE_FREE */
67
68/* Define to 1 if you have the `event_base_get_method' function. */
69/* #undef HAVE_EVENT_BASE_GET_METHOD */
70
71/* Define to 1 if you have the `event_base_new' function. */
72/* #undef HAVE_EVENT_BASE_NEW */
73
74/* Define to 1 if you have the `event_base_once' function. */
75/* #undef HAVE_EVENT_BASE_ONCE */
76
77/* Define to 1 if you have the <event.h> header file. */
78/* #undef HAVE_EVENT_H */
79
80/* Define to 1 if you have the `EVP_sha1' function. */
81#define HAVE_EVP_SHA1 1
82
83/* Define to 1 if you have the `EVP_sha256' function. */
84#define HAVE_EVP_SHA256 1
85
86/* Define to 1 if you have the `EVP_sha512' function. */
87#define HAVE_EVP_SHA512 1
88
89/* Define to 1 if you have the `ev_default_loop' function. */
90/* #undef HAVE_EV_DEFAULT_LOOP */
91
92/* Define to 1 if you have the `ev_loop' function. */
93/* #undef HAVE_EV_LOOP */
94
95/* Define to 1 if you have the <expat.h> header file. */
96#define HAVE_EXPAT_H 1
97
98/* Define to 1 if you have the `fcntl' function. */
99#define HAVE_FCNTL 1
100
101/* Define to 1 if you have the `FIPS_mode' function. */
102#define HAVE_FIPS_MODE 1
103
104/* Define to 1 if you have the `fork' function. */
105#define HAVE_FORK 1
106
107/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
108#define HAVE_FSEEKO 1
109
110/* Whether getaddrinfo is available */
111#define HAVE_GETADDRINFO 1
112
113/* Define to 1 if you have the <getopt.h> header file. */
114#define HAVE_GETOPT_H 1
115
116/* Define to 1 if you have the `getpwnam' function. */
117#define HAVE_GETPWNAM 1
118
119/* Define to 1 if you have the `getrlimit' function. */
120#define HAVE_GETRLIMIT 1
121
122/* Define to 1 if you have the `glob' function. */
123#define HAVE_GLOB 1
124
125/* Define to 1 if you have the <glob.h> header file. */
126#define HAVE_GLOB_H 1
127
128/* Define to 1 if you have the `gmtime_r' function. */
129#define HAVE_GMTIME_R 1
130
131/* Define to 1 if you have the <grp.h> header file. */
132#define HAVE_GRP_H 1
133
134/* If you have HMAC_CTX_init */
135#define HAVE_HMAC_CTX_INIT 1
136
137/* Define to 1 if you have the `inet_aton' function. */
138#define HAVE_INET_ATON 1
139
140/* Define to 1 if you have the `inet_ntop' function. */
141#define HAVE_INET_NTOP 1
142
143/* Define to 1 if you have the `inet_pton' function. */
144#define HAVE_INET_PTON 1
145
146/* Define to 1 if you have the `initgroups' function. */
147#define HAVE_INITGROUPS 1
148
149/* Define to 1 if you have the <inttypes.h> header file. */
150#define HAVE_INTTYPES_H 1
151
152/* if the function 'ioctlsocket' is available */
153/* #undef HAVE_IOCTLSOCKET */
154
155/* Define to 1 if you have the <iphlpapi.h> header file. */
156/* #undef HAVE_IPHLPAPI_H */
157
158/* Define to 1 if you have the `kill' function. */
159#define HAVE_KILL 1
160
161/* Define to 1 if you have the `ldns_key_EVP_unload_gost' function. */
162/* #undef HAVE_LDNS_KEY_EVP_UNLOAD_GOST */
163
164/* Define to 1 if you have the <ldns/ldns.h> header file. */
165#define HAVE_LDNS_LDNS_H 1
166
167/* Define to 1 if you have the `ldns' library (-lldns). */
168#define HAVE_LIBLDNS 1
169
170/* Define to 1 if you have the `localtime_r' function. */
171#define HAVE_LOCALTIME_R 1
172
173/* Define to 1 if you have the <login_cap.h> header file. */
174#define HAVE_LOGIN_CAP_H 1
175
176/* If have GNU libc compatible malloc */
177#define HAVE_MALLOC 1
178
179/* Define to 1 if you have the `memmove' function. */
180#define HAVE_MEMMOVE 1
181
182/* Define to 1 if you have the <memory.h> header file. */
183#define HAVE_MEMORY_H 1
184
185/* Define to 1 if you have the <netdb.h> header file. */
186#define HAVE_NETDB_H 1
187
188/* Define to 1 if you have the <netinet/in.h> header file. */
189#define HAVE_NETINET_IN_H 1
190
191/* Use libnss for crypto */
192/* #undef HAVE_NSS */
193
194/* Define to 1 if you have the `OPENSSL_config' function. */
195#define HAVE_OPENSSL_CONFIG 1
196
197/* Define to 1 if you have the <openssl/conf.h> header file. */
198#define HAVE_OPENSSL_CONF_H 1
199
200/* Define to 1 if you have the <openssl/engine.h> header file. */
201#define HAVE_OPENSSL_ENGINE_H 1
202
203/* Define to 1 if you have the <openssl/err.h> header file. */
204#define HAVE_OPENSSL_ERR_H 1
205
206/* Define to 1 if you have the <openssl/rand.h> header file. */
207#define HAVE_OPENSSL_RAND_H 1
208
209/* Define to 1 if you have the <openssl/ssl.h> header file. */
210#define HAVE_OPENSSL_SSL_H 1
211
212/* Define if you have POSIX threads libraries and header files. */
213#define HAVE_PTHREAD 1
214
215/* Define to 1 if the system has the type `pthread_rwlock_t'. */
216#define HAVE_PTHREAD_RWLOCK_T 1
217
218/* Define to 1 if the system has the type `pthread_spinlock_t'. */
219#define HAVE_PTHREAD_SPINLOCK_T 1
220
221/* Define to 1 if you have the <pwd.h> header file. */
222#define HAVE_PWD_H 1
223
224/* Define if you have Python libraries and header files. */
225/* #undef HAVE_PYTHON */
226
227/* Define to 1 if you have the `random' function. */
228#define HAVE_RANDOM 1
229
230/* Define to 1 if you have the `recvmsg' function. */
231#define HAVE_RECVMSG 1
232
233/* Define to 1 if you have the `sbrk' function. */
234#define HAVE_SBRK 1
235
236/* Define to 1 if you have the `sendmsg' function. */
237#define HAVE_SENDMSG 1
238
239/* Define to 1 if you have the `setregid' function. */
240/* #undef HAVE_SETREGID */
241
242/* Define to 1 if you have the `setresgid' function. */
243#define HAVE_SETRESGID 1
244
245/* Define to 1 if you have the `setresuid' function. */
246#define HAVE_SETRESUID 1
247
248/* Define to 1 if you have the `setreuid' function. */
249/* #undef HAVE_SETREUID */
250
251/* Define to 1 if you have the `setrlimit' function. */
252#define HAVE_SETRLIMIT 1
253
254/* Define to 1 if you have the `setsid' function. */
255#define HAVE_SETSID 1
256
257/* Define to 1 if you have the `setusercontext' function. */
258#define HAVE_SETUSERCONTEXT 1
259
260/* Define to 1 if you have the `sigprocmask' function. */
261#define HAVE_SIGPROCMASK 1
262
263/* Define to 1 if you have the `sleep' function. */
264#define HAVE_SLEEP 1
265
266/* Define to 1 if you have the `snprintf' function. */
267#define HAVE_SNPRINTF 1
268
269/* Define to 1 if you have the `socketpair' function. */
270#define HAVE_SOCKETPAIR 1
271
272/* Using Solaris threads */
273/* #undef HAVE_SOLARIS_THREADS */
274
275/* Define to 1 if you have the `srandom' function. */
276#define HAVE_SRANDOM 1
277
278/* Define if you have the SSL libraries installed. */
279#define HAVE_SSL /**/
280
281/* Define to 1 if you have the <stdarg.h> header file. */
282#define HAVE_STDARG_H 1
283
284/* Define to 1 if you have the <stdbool.h> header file. */
285#define HAVE_STDBOOL_H 1
286
287/* Define to 1 if you have the <stdint.h> header file. */
288#define HAVE_STDINT_H 1
289
290/* Define to 1 if you have the <stdlib.h> header file. */
291#define HAVE_STDLIB_H 1
292
293/* Define to 1 if you have the `strftime' function. */
294#define HAVE_STRFTIME 1
295
296/* Define to 1 if you have the <strings.h> header file. */
297#define HAVE_STRINGS_H 1
298
299/* Define to 1 if you have the <string.h> header file. */
300#define HAVE_STRING_H 1
301
302/* Define to 1 if you have the `strlcpy' function. */
303#define HAVE_STRLCPY 1
304
305/* Define to 1 if you have the `strptime' function. */
306#define HAVE_STRPTIME 1
307
308/* Define to 1 if `ipi_spec_dst' is a member of `struct in_pktinfo'. */
309/* #undef HAVE_STRUCT_IN_PKTINFO_IPI_SPEC_DST */
310
311/* Define if you have Swig libraries and header files. */
312/* #undef HAVE_SWIG */
313
314/* Define to 1 if you have the <syslog.h> header file. */
315#define HAVE_SYSLOG_H 1
316
317/* Define to 1 if you have the <sys/param.h> header file. */
318#define HAVE_SYS_PARAM_H 1
319
320/* Define to 1 if you have the <sys/resource.h> header file. */
321#define HAVE_SYS_RESOURCE_H 1
322
323/* Define to 1 if you have the <sys/socket.h> header file. */
324#define HAVE_SYS_SOCKET_H 1
325
326/* Define to 1 if you have the <sys/stat.h> header file. */
327#define HAVE_SYS_STAT_H 1
328
329/* Define to 1 if you have the <sys/types.h> header file. */
330#define HAVE_SYS_TYPES_H 1
331
332/* Define to 1 if you have the <sys/uio.h> header file. */
333#define HAVE_SYS_UIO_H 1
334
335/* Define to 1 if you have the <sys/wait.h> header file. */
336#define HAVE_SYS_WAIT_H 1
337
338/* Define to 1 if you have the <time.h> header file. */
339#define HAVE_TIME_H 1
340
341/* Define to 1 if you have the `tzset' function. */
342#define HAVE_TZSET 1
343
344/* Define to 1 if you have the <unistd.h> header file. */
345#define HAVE_UNISTD_H 1
346
347/* Define to 1 if you have the `usleep' function. */
348#define HAVE_USLEEP 1
349
350/* Define to 1 if you have the `vfork' function. */
351#define HAVE_VFORK 1
352
353/* Define to 1 if you have the <vfork.h> header file. */
354/* #undef HAVE_VFORK_H */
355
356/* Define to 1 if you have the <windows.h> header file. */
357/* #undef HAVE_WINDOWS_H */
358
359/* Using Windows threads */
360/* #undef HAVE_WINDOWS_THREADS */
361
362/* Define to 1 if you have the <winsock2.h> header file. */
363/* #undef HAVE_WINSOCK2_H */
364
365/* Define to 1 if `fork' works. */
366#define HAVE_WORKING_FORK 1
367
368/* Define to 1 if `vfork' works. */
369#define HAVE_WORKING_VFORK 1
370
371/* Define to 1 if you have the `writev' function. */
372#define HAVE_WRITEV 1
373
374/* Define to 1 if you have the <ws2tcpip.h> header file. */
375/* #undef HAVE_WS2TCPIP_H */
376
377/* Define to 1 if you have the `_beginthreadex' function. */
378/* #undef HAVE__BEGINTHREADEX */
379
380/* if lex has yylex_destroy */
381#define LEX_HAS_YYLEX_DESTROY 1
382
383/* Define to the sub-directory in which libtool stores uninstalled libraries.
384   */
385#define LT_OBJDIR ".libs/"
386
387/* Define to the maximum message length to pass to syslog. */
388#define MAXSYSLOGMSGLEN 10240
389
390/* Define if memcmp() does not compare unsigned bytes */
391/* #undef MEMCMP_IS_BROKEN */
392
393/* Define if mkdir has one argument. */
394/* #undef MKDIR_HAS_ONE_ARG */
395
396/* Define if the network stack does not fully support nonblocking io (causes
397   lower performance). */
398/* #undef NONBLOCKING_IS_BROKEN */
399
400/* Put -D_ALL_SOURCE define in config.h */
401/* #undef OMITTED__D_ALL_SOURCE */
402
403/* Put -D_BSD_SOURCE define in config.h */
404/* #undef OMITTED__D_BSD_SOURCE */
405
406/* Put -D_GNU_SOURCE define in config.h */
407/* #undef OMITTED__D_GNU_SOURCE */
408
409/* Put -D_LARGEFILE_SOURCE=1 define in config.h */
410/* #undef OMITTED__D_LARGEFILE_SOURCE_1 */
411
412/* Put -D_POSIX_C_SOURCE=200112 define in config.h */
413/* #undef OMITTED__D_POSIX_C_SOURCE_200112 */
414
415/* Put -D_XOPEN_SOURCE=600 define in config.h */
416/* #undef OMITTED__D_XOPEN_SOURCE_600 */
417
418/* Put -D_XOPEN_SOURCE_EXTENDED=1 define in config.h */
419/* #undef OMITTED__D_XOPEN_SOURCE_EXTENDED_1 */
420
421/* Put -D__EXTENSIONS__ define in config.h */
422/* #undef OMITTED__D__EXTENSIONS__ */
423
424/* Define to the address where bug reports for this package should be sent. */
425#define PACKAGE_BUGREPORT "unbound-bugs@nlnetlabs.nl"
426
427/* Define to the full name of this package. */
428#define PACKAGE_NAME "unbound"
429
430/* Define to the full name and version of this package. */
431#define PACKAGE_STRING "unbound 1.4.20"
432
433/* Define to the one symbol short name of this package. */
434#define PACKAGE_TARNAME "unbound"
435
436/* Define to the home page for this package. */
437#define PACKAGE_URL ""
438
439/* Define to the version of this package. */
440#define PACKAGE_VERSION "1.4.20"
441
442/* default pidfile location */
443#define PIDFILE "/var/unbound/unbound.pid"
444
445/* Define to necessary symbol if this constant uses a non-standard name on
446   your system. */
447/* #undef PTHREAD_CREATE_JOINABLE */
448
449/* Define as the return type of signal handlers (`int' or `void'). */
450#define RETSIGTYPE void
451
452/* default rootkey location */
453#define ROOT_ANCHOR_FILE "/var/unbound/root.key"
454
455/* default rootcert location */
456#define ROOT_CERT_FILE "/var/unbound/icannbundle.pem"
457
458/* version number for resource files */
459#define RSRC_PACKAGE_VERSION 1,4,2,0
460
461/* Directory to chdir to */
462#define RUN_DIR "/var/unbound"
463
464/* Shared data */
465#define SHARE_DIR "/var/unbound"
466
467/* Define to 1 if you have the ANSI C header files. */
468#define STDC_HEADERS 1
469
470/* use default strptime. */
471#define STRPTIME_WORKS 1
472
473/* Use win32 resources and API */
474/* #undef UB_ON_WINDOWS */
475
476/* default username */
477#define UB_USERNAME "unbound"
478
479/* use to enable lightweight alloc assertions, for debug use */
480/* #undef UNBOUND_ALLOC_LITE */
481
482/* use malloc not regions, for debug use */
483/* #undef UNBOUND_ALLOC_NONREGIONAL */
484
485/* use statistics for allocs and frees, for debug use */
486/* #undef UNBOUND_ALLOC_STATS */
487
488/* define this to enable debug checks. */
489/* #undef UNBOUND_DEBUG */
490
491/* Define this to enable ECDSA support. */
492#define USE_ECDSA 1
493
494/* Define this to enable an EVP workaround for older openssl */
495/* #undef USE_ECDSA_EVP_WORKAROUND */
496
497/* Define this to enable GOST support. */
498/* #undef USE_GOST */
499
500/* Define if you want to use internal select based events */
501#define USE_MINI_EVENT 1
502
503/* Define this to enable SHA256 and SHA512 support. */
504#define USE_SHA2 1
505
506/* Enable extensions on AIX 3, Interix.  */
507#ifndef _ALL_SOURCE
508# define _ALL_SOURCE 1
509#endif
510/* Enable GNU extensions on systems that have them.  */
511#ifndef _GNU_SOURCE
512# define _GNU_SOURCE 1
513#endif
514/* Enable threading extensions on Solaris.  */
515#ifndef _POSIX_PTHREAD_SEMANTICS
516# define _POSIX_PTHREAD_SEMANTICS 1
517#endif
518/* Enable extensions on HP NonStop.  */
519#ifndef _TANDEM_SOURCE
520# define _TANDEM_SOURCE 1
521#endif
522/* Enable general extensions on Solaris.  */
523#ifndef __EXTENSIONS__
524# define __EXTENSIONS__ 1
525#endif
526
527
528/* Whether the windows socket API is used */
529/* #undef USE_WINSOCK */
530
531/* the version of the windows API enabled */
532#define WINVER 0x0502
533
534/* Define if you want Python module. */
535/* #undef WITH_PYTHONMODULE */
536
537/* Define if you want PyUnbound. */
538/* #undef WITH_PYUNBOUND */
539
540/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
541   `char[]'. */
542#define YYTEXT_POINTER 1
543
544/* Enable large inode numbers on Mac OS X 10.5.  */
545#ifndef _DARWIN_USE_64_BIT_INODE
546# define _DARWIN_USE_64_BIT_INODE 1
547#endif
548
549/* Number of bits in a file offset, on hosts where this is settable. */
550/* #undef _FILE_OFFSET_BITS */
551
552/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
553/* #undef _LARGEFILE_SOURCE */
554
555/* Define for large files, on AIX-style hosts. */
556/* #undef _LARGE_FILES */
557
558/* Define to 1 if on MINIX. */
559/* #undef _MINIX */
560
561/* Define to 2 if the system does not provide POSIX.1 features except with
562   this defined. */
563/* #undef _POSIX_1_SOURCE */
564
565/* Define to 1 if you need to in order for `stat' and other things to work. */
566/* #undef _POSIX_SOURCE */
567
568/* Define to empty if `const' does not conform to ANSI C. */
569/* #undef const */
570
571/* Define to `int' if <sys/types.h> doesn't define. */
572/* #undef gid_t */
573
574/* in_addr_t */
575/* #undef in_addr_t */
576
577/* in_port_t */
578/* #undef in_port_t */
579
580/* Define to `__inline__' or `__inline' if that's what the C compiler
581   calls it, or to nothing if 'inline' is not supported under any name.  */
582#ifndef __cplusplus
583/* #undef inline */
584#endif
585
586/* Define to `short' if <sys/types.h> does not define. */
587/* #undef int16_t */
588
589/* Define to `int' if <sys/types.h> does not define. */
590/* #undef int32_t */
591
592/* Define to `long long' if <sys/types.h> does not define. */
593/* #undef int64_t */
594
595/* Define to `signed char' if <sys/types.h> does not define. */
596/* #undef int8_t */
597
598/* Define if replacement function should be used. */
599/* #undef malloc */
600
601/* Define to `long int' if <sys/types.h> does not define. */
602/* #undef off_t */
603
604/* Define to `int' if <sys/types.h> does not define. */
605/* #undef pid_t */
606
607/* Define to 'int' if not defined */
608/* #undef rlim_t */
609
610/* Define to `unsigned int' if <sys/types.h> does not define. */
611/* #undef size_t */
612
613/* Define to 'int' if not defined */
614/* #undef socklen_t */
615
616/* Define to `int' if <sys/types.h> does not define. */
617/* #undef ssize_t */
618
619/* Define to 'unsigned char if not defined */
620/* #undef u_char */
621
622/* Define to `int' if <sys/types.h> doesn't define. */
623/* #undef uid_t */
624
625/* Define to `unsigned short' if <sys/types.h> does not define. */
626/* #undef uint16_t */
627
628/* Define to `unsigned int' if <sys/types.h> does not define. */
629/* #undef uint32_t */
630
631/* Define to `unsigned long long' if <sys/types.h> does not define. */
632/* #undef uint64_t */
633
634/* Define to `unsigned char' if <sys/types.h> does not define. */
635/* #undef uint8_t */
636
637/* Define as `fork' if `vfork' does not work. */
638/* #undef vfork */
639
640#if defined(OMITTED__D_GNU_SOURCE) && !defined(_GNU_SOURCE)
641#define _GNU_SOURCE 1
642#endif
643
644#if defined(OMITTED__D_BSD_SOURCE) && !defined(_BSD_SOURCE)
645#define _BSD_SOURCE 1
646#endif
647
648#if defined(OMITTED__D__EXTENSIONS__) && !defined(__EXTENSIONS__)
649#define __EXTENSIONS__ 1
650#endif
651
652#if defined(OMITTED__D_POSIX_C_SOURCE_200112) && !defined(_POSIX_C_SOURCE)
653#define _POSIX_C_SOURCE 200112
654#endif
655
656#if defined(OMITTED__D_XOPEN_SOURCE_600) && !defined(_XOPEN_SOURCE)
657#define _XOPEN_SOURCE 600
658#endif
659
660#if defined(OMITTED__D_XOPEN_SOURCE_EXTENDED_1) && !defined(_XOPEN_SOURCE_EXTENDED)
661#define _XOPEN_SOURCE_EXTENDED 1
662#endif
663
664#if defined(OMITTED__D_ALL_SOURCE) && !defined(_ALL_SOURCE)
665#define _ALL_SOURCE 1
666#endif
667
668#if defined(OMITTED__D_LARGEFILE_SOURCE_1) && !defined(_LARGEFILE_SOURCE)
669#define _LARGEFILE_SOURCE 1
670#endif
671
672
673
674
675#ifndef UNBOUND_DEBUG
676#  define NDEBUG
677#endif
678
679#include <stdio.h>
680#include <string.h>
681#include <unistd.h>
682#include <assert.h>
683
684#if STDC_HEADERS
685#include <stdlib.h>
686#include <stddef.h>
687#endif
688
689#ifdef HAVE_STDINT_H
690#include <stdint.h>
691#endif
692
693#include <errno.h>
694
695#if HAVE_SYS_PARAM_H
696#include <sys/param.h>
697#endif
698
699#ifdef HAVE_SYS_SOCKET_H
700#include <sys/socket.h>
701#endif
702
703#ifdef HAVE_SYS_UIO_H
704#include <sys/uio.h>
705#endif
706
707#ifdef HAVE_NETINET_IN_H
708#include <netinet/in.h>
709#endif
710
711#ifdef HAVE_ARPA_INET_H
712#include <arpa/inet.h>
713#endif
714
715#ifdef HAVE_WINSOCK2_H
716#include <winsock2.h>
717#endif
718
719#ifdef HAVE_WS2TCPIP_H
720#include <ws2tcpip.h>
721#endif
722
723
724
725#ifdef HAVE_ATTR_FORMAT
726#  define ATTR_FORMAT(archetype, string_index, first_to_check) \
727    __attribute__ ((format (archetype, string_index, first_to_check)))
728#else /* !HAVE_ATTR_FORMAT */
729#  define ATTR_FORMAT(archetype, string_index, first_to_check) /* empty */
730#endif /* !HAVE_ATTR_FORMAT */
731
732
733#if defined(DOXYGEN)
734#  define ATTR_UNUSED(x)  x
735#elif defined(__cplusplus)
736#  define ATTR_UNUSED(x)
737#elif defined(HAVE_ATTR_UNUSED)
738#  define ATTR_UNUSED(x)  x __attribute__((unused))
739#else /* !HAVE_ATTR_UNUSED */
740#  define ATTR_UNUSED(x)  x
741#endif /* !HAVE_ATTR_UNUSED */
742
743
744#ifndef HAVE_FSEEKO
745#define fseeko fseek
746#define ftello ftell
747#endif /* HAVE_FSEEKO */
748
749
750#ifndef MAXHOSTNAMELEN
751#define MAXHOSTNAMELEN 256
752#endif
753
754
755#ifndef HAVE_SNPRINTF
756#define snprintf snprintf_unbound
757#define vsnprintf vsnprintf_unbound
758#include <stdarg.h>
759int snprintf (char *str, size_t count, const char *fmt, ...);
760int vsnprintf (char *str, size_t count, const char *fmt, va_list arg);
761#endif /* HAVE_SNPRINTF */
762
763
764#ifndef HAVE_INET_PTON
765#define inet_pton inet_pton_unbound
766int inet_pton(int af, const char* src, void* dst);
767#endif /* HAVE_INET_PTON */
768
769
770#ifndef HAVE_INET_NTOP
771#define inet_ntop inet_ntop_unbound
772const char *inet_ntop(int af, const void *src, char *dst, size_t size);
773#endif
774
775
776#ifndef HAVE_INET_ATON
777#define inet_aton inet_aton_unbound
778int inet_aton(const char *cp, struct in_addr *addr);
779#endif
780
781
782#ifndef HAVE_MEMMOVE
783#define memmove memmove_unbound
784void *memmove(void *dest, const void *src, size_t n);
785#endif
786
787
788#ifndef HAVE_STRLCPY
789#define strlcpy strlcpy_unbound
790size_t strlcpy(char *dst, const char *src, size_t siz);
791#endif
792
793
794#ifndef HAVE_GMTIME_R
795#define gmtime_r gmtime_r_unbound
796struct tm *gmtime_r(const time_t *timep, struct tm *result);
797#endif
798
799
800#ifndef HAVE_SLEEP
801#define sleep(x) Sleep((x)*1000) /* on win32 */
802#endif /* HAVE_SLEEP */
803
804
805#ifndef HAVE_USLEEP
806#define usleep(x) Sleep((x)/1000 + 1) /* on win32 */
807#endif /* HAVE_USLEEP */
808
809
810#ifndef HAVE_RANDOM
811#define random rand /* on win32, for tests only (bad random) */
812#endif /* HAVE_RANDOM */
813
814
815#ifndef HAVE_SRANDOM
816#define srandom(x) srand(x) /* on win32, for tests only (bad random) */
817#endif /* HAVE_SRANDOM */
818
819
820/* detect if we need to cast to unsigned int for FD_SET to avoid warnings */
821#ifdef HAVE_WINSOCK2_H
822#define FD_SET_T (u_int)
823#else
824#define FD_SET_T
825#endif
826
827
828#ifndef IPV6_MIN_MTU
829#define IPV6_MIN_MTU 1280
830#endif /* IPV6_MIN_MTU */
831
832
833#ifdef MEMCMP_IS_BROKEN
834#include "compat/memcmp.h"
835#define memcmp memcmp_unbound
836int memcmp(const void *x, const void *y, size_t n);
837#endif
838
839
840
841#ifndef HAVE_CTIME_R
842#define ctime_r unbound_ctime_r
843char *ctime_r(const time_t *timep, char *buf);
844#endif
845
846#if !defined(HAVE_STRPTIME) || !defined(STRPTIME_WORKS)
847#define strptime unbound_strptime
848struct tm;
849char *strptime(const char *s, const char *format, struct tm *tm);
850#endif
851
852#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))
853   /* using version of libevent that is not threadsafe. */
854#  define LIBEVENT_SIGNAL_PROBLEM 1
855#endif
856
857#ifndef CHECKED_INET6
858#  define CHECKED_INET6
859#  ifdef AF_INET6
860#    define INET6
861#  else
862#    define AF_INET6        28
863#  endif
864#endif /* CHECKED_INET6 */
865
866/* maximum nesting of included files */
867#define MAXINCLUDES 10
868#ifndef HAVE_GETADDRINFO
869struct sockaddr_storage;
870#include "compat/fake-rfc2553.h"
871#endif
872
873#ifdef UNBOUND_ALLOC_STATS
874#  define malloc(s) unbound_stat_malloc_log(s, __FILE__, __LINE__, __func__)
875#  define calloc(n,s) unbound_stat_calloc_log(n, s, __FILE__, __LINE__, __func__)
876#  define free(p) unbound_stat_free_log(p, __FILE__, __LINE__, __func__)
877#  define realloc(p,s) unbound_stat_realloc_log(p, s, __FILE__, __LINE__, __func__)
878void *unbound_stat_malloc(size_t size);
879void *unbound_stat_calloc(size_t nmemb, size_t size);
880void unbound_stat_free(void *ptr);
881void *unbound_stat_realloc(void *ptr, size_t size);
882void *unbound_stat_malloc_log(size_t size, const char* file, int line,
883	const char* func);
884void *unbound_stat_calloc_log(size_t nmemb, size_t size, const char* file,
885	int line, const char* func);
886void unbound_stat_free_log(void *ptr, const char* file, int line,
887	const char* func);
888void *unbound_stat_realloc_log(void *ptr, size_t size, const char* file,
889	int line, const char* func);
890#elif defined(UNBOUND_ALLOC_LITE)
891#  include "util/alloc.h"
892#endif /* UNBOUND_ALLOC_LITE and UNBOUND_ALLOC_STATS */
893
894/** default port for DNS traffic. */
895#define UNBOUND_DNS_PORT 53
896/** default port for unbound control traffic, registered port with IANA,
897    ub-dns-control  8953/tcp    unbound dns nameserver control */
898#define UNBOUND_CONTROL_PORT 8953
899/** the version of unbound-control that this software implements */
900#define UNBOUND_CONTROL_VERSION 1
901
902
903