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