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