xref: /freebsd/contrib/unbound/config.h.in (revision 7a7741af18d6c8a804cc643cb7ecda9d730c6aa6)
1/* config.h.in.  Generated from configure.ac by autoheader.  */
2
3/* apply the fallthrough attribute. */
4#undef ATTR_FALLTHROUGH
5
6/* apply the noreturn attribute to a function that exits the program */
7#undef ATTR_NORETURN
8
9/* apply the weak attribute to a symbol */
10#undef ATTR_WEAK
11
12/* Directory to chroot to */
13#undef CHROOT_DIR
14
15/* Define this to enable client subnet option. */
16#undef CLIENT_SUBNET
17
18/* Do sha512 definitions in config.h */
19#undef COMPAT_SHA512
20
21/* Command line arguments used with configure */
22#undef CONFCMDLINE
23
24/* Pathname to the Unbound configuration file */
25#undef CONFIGFILE
26
27/* Define this if on macOSX10.4-darwin8 and setreuid and setregid do not work
28   */
29#undef DARWIN_BROKEN_SETREUID
30
31/* Whether daemon is deprecated */
32#undef DEPRECATED_DAEMON
33
34/* Deprecate RSA 1024 bit length, makes that an unsupported key */
35#undef DEPRECATE_RSA_1024
36
37/* Define this to enable kernel based UDP source port randomization. */
38#undef DISABLE_EXPLICIT_PORT_RANDOMISATION
39
40/* default dnstap socket path */
41#undef DNSTAP_SOCKET_PATH
42
43/* Define if you want to use debug lock checking (slow). */
44#undef ENABLE_LOCK_CHECKS
45
46/* Define this if you enabled-allsymbols from libunbound to link binaries to
47   it for smaller install size, but the libunbound export table is polluted by
48   internal symbols */
49#undef EXPORT_ALL_SYMBOLS
50
51/* Define to 1 if you have the `accept4' function. */
52#undef HAVE_ACCEPT4
53
54/* Define to 1 if you have the `arc4random' function. */
55#undef HAVE_ARC4RANDOM
56
57/* Define to 1 if you have the `arc4random_uniform' function. */
58#undef HAVE_ARC4RANDOM_UNIFORM
59
60/* Define to 1 if you have the <arpa/inet.h> header file. */
61#undef HAVE_ARPA_INET_H
62
63/* Whether the C compiler accepts the "fallthrough" attribute */
64#undef HAVE_ATTR_FALLTHROUGH
65
66/* Whether the C compiler accepts the "format" attribute */
67#undef HAVE_ATTR_FORMAT
68
69/* Whether the C compiler accepts the "noreturn" attribute */
70#undef HAVE_ATTR_NORETURN
71
72/* Whether the C compiler accepts the "unused" attribute */
73#undef HAVE_ATTR_UNUSED
74
75/* Whether the C compiler accepts the "weak" attribute */
76#undef HAVE_ATTR_WEAK
77
78/* If we have be64toh */
79#undef HAVE_BE64TOH
80
81/* Define to 1 if you have the `BIO_set_callback_ex' function. */
82#undef HAVE_BIO_SET_CALLBACK_EX
83
84/* Define to 1 if you have the <bsd/stdlib.h> header file. */
85#undef HAVE_BSD_STDLIB_H
86
87/* Define to 1 if you have the <bsd/string.h> header file. */
88#undef HAVE_BSD_STRING_H
89
90/* Define to 1 if you have the `chown' function. */
91#undef HAVE_CHOWN
92
93/* Define to 1 if you have the `chroot' function. */
94#undef HAVE_CHROOT
95
96/* Define to 1 if you have the `CRYPTO_cleanup_all_ex_data' function. */
97#undef HAVE_CRYPTO_CLEANUP_ALL_EX_DATA
98
99/* Define to 1 if you have the `CRYPTO_THREADID_set_callback' function. */
100#undef HAVE_CRYPTO_THREADID_SET_CALLBACK
101
102/* Define to 1 if you have the `ctime_r' function. */
103#undef HAVE_CTIME_R
104
105/* Define to 1 if you have the `daemon' function. */
106#undef HAVE_DAEMON
107
108/* Define to 1 if you have the declaration of `arc4random', and to 0 if you
109   don't. */
110#undef HAVE_DECL_ARC4RANDOM
111
112/* Define to 1 if you have the declaration of `arc4random_uniform', and to 0
113   if you don't. */
114#undef HAVE_DECL_ARC4RANDOM_UNIFORM
115
116/* Define to 1 if you have the declaration of `evsignal_assign', and to 0 if
117   you don't. */
118#undef HAVE_DECL_EVSIGNAL_ASSIGN
119
120/* Define to 1 if you have the declaration of `inet_ntop', and to 0 if you
121   don't. */
122#undef HAVE_DECL_INET_NTOP
123
124/* Define to 1 if you have the declaration of `inet_pton', and to 0 if you
125   don't. */
126#undef HAVE_DECL_INET_PTON
127
128/* Define to 1 if you have the declaration of `nghttp2_session_server_new',
129   and to 0 if you don't. */
130#undef HAVE_DECL_NGHTTP2_SESSION_SERVER_NEW
131
132/* Define to 1 if you have the declaration of `NID_ED25519', and to 0 if you
133   don't. */
134#undef HAVE_DECL_NID_ED25519
135
136/* Define to 1 if you have the declaration of `NID_ED448', and to 0 if you
137   don't. */
138#undef HAVE_DECL_NID_ED448
139
140/* Define to 1 if you have the declaration of `NID_secp384r1', and to 0 if you
141   don't. */
142#undef HAVE_DECL_NID_SECP384R1
143
144/* Define to 1 if you have the declaration of `NID_X9_62_prime256v1', and to 0
145   if you don't. */
146#undef HAVE_DECL_NID_X9_62_PRIME256V1
147
148/* Define to 1 if you have the declaration of `reallocarray', and to 0 if you
149   don't. */
150#undef HAVE_DECL_REALLOCARRAY
151
152/* Define to 1 if you have the declaration of `redisConnect', and to 0 if you
153   don't. */
154#undef HAVE_DECL_REDISCONNECT
155
156/* Define to 1 if you have the declaration of `sk_SSL_COMP_pop_free', and to 0
157   if you don't. */
158#undef HAVE_DECL_SK_SSL_COMP_POP_FREE
159
160/* Define to 1 if you have the declaration of
161   `SSL_COMP_get_compression_methods', and to 0 if you don't. */
162#undef HAVE_DECL_SSL_COMP_GET_COMPRESSION_METHODS
163
164/* Define to 1 if you have the declaration of `SSL_CTX_set_ecdh_auto', and to
165   0 if you don't. */
166#undef HAVE_DECL_SSL_CTX_SET_ECDH_AUTO
167
168/* Define to 1 if you have the declaration of `strlcat', and to 0 if you
169   don't. */
170#undef HAVE_DECL_STRLCAT
171
172/* Define to 1 if you have the declaration of `strlcpy', and to 0 if you
173   don't. */
174#undef HAVE_DECL_STRLCPY
175
176/* Define to 1 if you have the declaration of `XML_StopParser', and to 0 if
177   you don't. */
178#undef HAVE_DECL_XML_STOPPARSER
179
180/* Define to 1 if you have the <dlfcn.h> header file. */
181#undef HAVE_DLFCN_H
182
183/* Define to 1 if you have the `DSA_SIG_set0' function. */
184#undef HAVE_DSA_SIG_SET0
185
186/* Define to 1 if you have the <endian.h> header file. */
187#undef HAVE_ENDIAN_H
188
189/* Define to 1 if you have the `endprotoent' function. */
190#undef HAVE_ENDPROTOENT
191
192/* Define to 1 if you have the `endpwent' function. */
193#undef HAVE_ENDPWENT
194
195/* Define to 1 if you have the `endservent' function. */
196#undef HAVE_ENDSERVENT
197
198/* Define to 1 if you have the `ENGINE_cleanup' function. */
199#undef HAVE_ENGINE_CLEANUP
200
201/* Define to 1 if you have the `ERR_free_strings' function. */
202#undef HAVE_ERR_FREE_STRINGS
203
204/* Define to 1 if you have the `ERR_load_crypto_strings' function. */
205#undef HAVE_ERR_LOAD_CRYPTO_STRINGS
206
207/* Define to 1 if you have the `event_assign' function. */
208#undef HAVE_EVENT_ASSIGN
209
210/* Define to 1 if you have the `event_base_free' function. */
211#undef HAVE_EVENT_BASE_FREE
212
213/* Define to 1 if you have the `event_base_get_method' function. */
214#undef HAVE_EVENT_BASE_GET_METHOD
215
216/* Define to 1 if you have the `event_base_new' function. */
217#undef HAVE_EVENT_BASE_NEW
218
219/* Define to 1 if you have the `event_base_once' function. */
220#undef HAVE_EVENT_BASE_ONCE
221
222/* Define to 1 if you have the <event.h> header file. */
223#undef HAVE_EVENT_H
224
225/* Define to 1 if you have the `EVP_aes_256_cbc' function. */
226#undef HAVE_EVP_AES_256_CBC
227
228/* Define to 1 if you have the `EVP_cleanup' function. */
229#undef HAVE_EVP_CLEANUP
230
231/* Define to 1 if you have the `EVP_default_properties_is_fips_enabled'
232   function. */
233#undef HAVE_EVP_DEFAULT_PROPERTIES_IS_FIPS_ENABLED
234
235/* Define to 1 if you have the `EVP_DigestVerify' function. */
236#undef HAVE_EVP_DIGESTVERIFY
237
238/* Define to 1 if you have the `EVP_dss1' function. */
239#undef HAVE_EVP_DSS1
240
241/* Define to 1 if you have the `EVP_EncryptInit_ex' function. */
242#undef HAVE_EVP_ENCRYPTINIT_EX
243
244/* Define to 1 if you have the `EVP_MAC_CTX_set_params' function. */
245#undef HAVE_EVP_MAC_CTX_SET_PARAMS
246
247/* Define to 1 if you have the `EVP_MD_CTX_new' function. */
248#undef HAVE_EVP_MD_CTX_NEW
249
250/* Define to 1 if you have the `EVP_sha1' function. */
251#undef HAVE_EVP_SHA1
252
253/* Define to 1 if you have the `EVP_sha256' function. */
254#undef HAVE_EVP_SHA256
255
256/* Define to 1 if you have the `EVP_sha512' function. */
257#undef HAVE_EVP_SHA512
258
259/* Define to 1 if you have the `ev_default_loop' function. */
260#undef HAVE_EV_DEFAULT_LOOP
261
262/* Define to 1 if you have the `ev_loop' function. */
263#undef HAVE_EV_LOOP
264
265/* Define to 1 if you have the <expat.h> header file. */
266#undef HAVE_EXPAT_H
267
268/* Define to 1 if you have the `explicit_bzero' function. */
269#undef HAVE_EXPLICIT_BZERO
270
271/* Define to 1 if you have the `fcntl' function. */
272#undef HAVE_FCNTL
273
274/* Define to 1 if you have the `FIPS_mode' function. */
275#undef HAVE_FIPS_MODE
276
277/* Define to 1 if you have the `fork' function. */
278#undef HAVE_FORK
279
280/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
281#undef HAVE_FSEEKO
282
283/* Define to 1 if you have the `fsync' function. */
284#undef HAVE_FSYNC
285
286/* Whether getaddrinfo is available */
287#undef HAVE_GETADDRINFO
288
289/* Define to 1 if you have the `getauxval' function. */
290#undef HAVE_GETAUXVAL
291
292/* Define to 1 if you have the `getentropy' function. */
293#undef HAVE_GETENTROPY
294
295/* Define to 1 if you have the `getifaddrs' function. */
296#undef HAVE_GETIFADDRS
297
298/* Define to 1 if you have the <getopt.h> header file. */
299#undef HAVE_GETOPT_H
300
301/* Define to 1 if you have the `getpwnam' function. */
302#undef HAVE_GETPWNAM
303
304/* Define to 1 if you have the `getrlimit' function. */
305#undef HAVE_GETRLIMIT
306
307/* Define to 1 if you have the `gettid' function. */
308#undef HAVE_GETTID
309
310/* Define to 1 if you have the `glob' function. */
311#undef HAVE_GLOB
312
313/* Define to 1 if you have the <glob.h> header file. */
314#undef HAVE_GLOB_H
315
316/* Define to 1 if you have the `gmtime_r' function. */
317#undef HAVE_GMTIME_R
318
319/* Define to 1 if you have the <grp.h> header file. */
320#undef HAVE_GRP_H
321
322/* Define to 1 if you have the <hiredis/hiredis.h> header file. */
323#undef HAVE_HIREDIS_HIREDIS_H
324
325/* Define to 1 if you have the `HMAC_Init_ex' function. */
326#undef HAVE_HMAC_INIT_EX
327
328/* If we have htobe64 */
329#undef HAVE_HTOBE64
330
331/* Define to 1 if you have the <ifaddrs.h> header file. */
332#undef HAVE_IFADDRS_H
333
334/* Define to 1 if you have the `if_nametoindex' function. */
335#undef HAVE_IF_NAMETOINDEX
336
337/* Define to 1 if you have the `inet_aton' function. */
338#undef HAVE_INET_ATON
339
340/* Define to 1 if you have the `inet_ntop' function. */
341#undef HAVE_INET_NTOP
342
343/* Define to 1 if you have the `inet_pton' function. */
344#undef HAVE_INET_PTON
345
346/* Define to 1 if you have the `initgroups' function. */
347#undef HAVE_INITGROUPS
348
349/* Define to 1 if you have the <inttypes.h> header file. */
350#undef HAVE_INTTYPES_H
351
352/* if the function 'ioctlsocket' is available */
353#undef HAVE_IOCTLSOCKET
354
355/* Define to 1 if you have the <iphlpapi.h> header file. */
356#undef HAVE_IPHLPAPI_H
357
358/* Define to 1 if you have the `isblank' function. */
359#undef HAVE_ISBLANK
360
361/* Define to 1 if you have the `kill' function. */
362#undef HAVE_KILL
363
364/* Use portable libbsd functions */
365#undef HAVE_LIBBSD
366
367/* Define to 1 if you have the <libkern/OSByteOrder.h> header file. */
368#undef HAVE_LIBKERN_OSBYTEORDER_H
369
370/* Define if we have LibreSSL */
371#undef HAVE_LIBRESSL
372
373/* Define to 1 if you have the <linux/net_tstamp.h> header file. */
374#undef HAVE_LINUX_NET_TSTAMP_H
375
376/* Define to 1 if you have the `localtime_r' function. */
377#undef HAVE_LOCALTIME_R
378
379/* Define to 1 if you have the <login_cap.h> header file. */
380#undef HAVE_LOGIN_CAP_H
381
382/* If have GNU libc compatible malloc */
383#undef HAVE_MALLOC
384
385/* Define to 1 if you have the `memmove' function. */
386#undef HAVE_MEMMOVE
387
388/* Define to 1 if you have the <minix/config.h> header file. */
389#undef HAVE_MINIX_CONFIG_H
390
391/* Define to 1 if you have the <netdb.h> header file. */
392#undef HAVE_NETDB_H
393
394/* Define to 1 if you have the <netinet/in.h> header file. */
395#undef HAVE_NETINET_IN_H
396
397/* Define to 1 if you have the <netinet/tcp.h> header file. */
398#undef HAVE_NETINET_TCP_H
399
400/* Define to 1 if you have the <netioapi.h> header file. */
401#undef HAVE_NETIOAPI_H
402
403/* Use libnettle for crypto */
404#undef HAVE_NETTLE
405
406/* Define to 1 if you have the <nettle/dsa-compat.h> header file. */
407#undef HAVE_NETTLE_DSA_COMPAT_H
408
409/* Define to 1 if you have the <nettle/eddsa.h> header file. */
410#undef HAVE_NETTLE_EDDSA_H
411
412/* Define to 1 if you have the <net/if.h> header file. */
413#undef HAVE_NET_IF_H
414
415/* Define to 1 if you have the <net/pfvar.h> header file. */
416#undef HAVE_NET_PFVAR_H
417
418/* Define this to use nghttp2 client. */
419#undef HAVE_NGHTTP2
420
421/* Define to 1 if you have the <nghttp2/nghttp2.h> header file. */
422#undef HAVE_NGHTTP2_NGHTTP2_H
423
424/* Use libnss for crypto */
425#undef HAVE_NSS
426
427/* Define to 1 if you have the `OpenSSL_add_all_digests' function. */
428#undef HAVE_OPENSSL_ADD_ALL_DIGESTS
429
430/* Define to 1 if you have the <openssl/bn.h> header file. */
431#undef HAVE_OPENSSL_BN_H
432
433/* Define to 1 if you have the `OPENSSL_config' function. */
434#undef HAVE_OPENSSL_CONFIG
435
436/* Define to 1 if you have the <openssl/conf.h> header file. */
437#undef HAVE_OPENSSL_CONF_H
438
439/* Define to 1 if you have the <openssl/core_names.h> header file. */
440#undef HAVE_OPENSSL_CORE_NAMES_H
441
442/* Define to 1 if you have the <openssl/dh.h> header file. */
443#undef HAVE_OPENSSL_DH_H
444
445/* Define to 1 if you have the <openssl/dsa.h> header file. */
446#undef HAVE_OPENSSL_DSA_H
447
448/* Define to 1 if you have the <openssl/engine.h> header file. */
449#undef HAVE_OPENSSL_ENGINE_H
450
451/* Define to 1 if you have the <openssl/err.h> header file. */
452#undef HAVE_OPENSSL_ERR_H
453
454/* Define to 1 if you have the `OPENSSL_init_crypto' function. */
455#undef HAVE_OPENSSL_INIT_CRYPTO
456
457/* Define to 1 if you have the `OPENSSL_init_ssl' function. */
458#undef HAVE_OPENSSL_INIT_SSL
459
460/* Define to 1 if you have the <openssl/param_build.h> header file. */
461#undef HAVE_OPENSSL_PARAM_BUILD_H
462
463/* Define to 1 if you have the <openssl/rand.h> header file. */
464#undef HAVE_OPENSSL_RAND_H
465
466/* Define to 1 if you have the <openssl/rsa.h> header file. */
467#undef HAVE_OPENSSL_RSA_H
468
469/* Define to 1 if you have the <openssl/ssl.h> header file. */
470#undef HAVE_OPENSSL_SSL_H
471
472/* Define to 1 if you have the `OSSL_PARAM_BLD_new' function. */
473#undef HAVE_OSSL_PARAM_BLD_NEW
474
475/* Define to 1 if you have the `poll' function. */
476#undef HAVE_POLL
477
478/* Define to 1 if you have the <poll.h> header file. */
479#undef HAVE_POLL_H
480
481/* Define if you have POSIX threads libraries and header files. */
482#undef HAVE_PTHREAD
483
484/* Have PTHREAD_PRIO_INHERIT. */
485#undef HAVE_PTHREAD_PRIO_INHERIT
486
487/* Define to 1 if the system has the type `pthread_rwlock_t'. */
488#undef HAVE_PTHREAD_RWLOCK_T
489
490/* Define to 1 if the system has the type `pthread_spinlock_t'. */
491#undef HAVE_PTHREAD_SPINLOCK_T
492
493/* Define to 1 if you have the <pwd.h> header file. */
494#undef HAVE_PWD_H
495
496/* Define if you have Python libraries and header files. */
497#undef HAVE_PYTHON
498
499/* Define to 1 if you have the `random' function. */
500#undef HAVE_RANDOM
501
502/* Define to 1 if you have the `RAND_cleanup' function. */
503#undef HAVE_RAND_CLEANUP
504
505/* If we have reallocarray(3) */
506#undef HAVE_REALLOCARRAY
507
508/* Define to 1 if you have the `recvmsg' function. */
509#undef HAVE_RECVMSG
510
511/* Define to 1 if you have the `sendmsg' function. */
512#undef HAVE_SENDMSG
513
514/* Define to 1 if you have the `setregid' function. */
515#undef HAVE_SETREGID
516
517/* Define to 1 if you have the `setresgid' function. */
518#undef HAVE_SETRESGID
519
520/* Define to 1 if you have the `setresuid' function. */
521#undef HAVE_SETRESUID
522
523/* Define to 1 if you have the `setreuid' function. */
524#undef HAVE_SETREUID
525
526/* Define to 1 if you have the `setrlimit' function. */
527#undef HAVE_SETRLIMIT
528
529/* Define to 1 if you have the `setsid' function. */
530#undef HAVE_SETSID
531
532/* Define to 1 if you have the `setusercontext' function. */
533#undef HAVE_SETUSERCONTEXT
534
535/* Define to 1 if you have the `SHA512_Update' function. */
536#undef HAVE_SHA512_UPDATE
537
538/* Define to 1 if you have the `shmget' function. */
539#undef HAVE_SHMGET
540
541/* Define to 1 if you have the `sigprocmask' function. */
542#undef HAVE_SIGPROCMASK
543
544/* Define to 1 if you have the `sleep' function. */
545#undef HAVE_SLEEP
546
547/* Define to 1 if you have the `snprintf' function. */
548#undef HAVE_SNPRINTF
549
550/* Define to 1 if you have the `socketpair' function. */
551#undef HAVE_SOCKETPAIR
552
553/* Using Solaris threads */
554#undef HAVE_SOLARIS_THREADS
555
556/* Define to 1 if you have the `srandom' function. */
557#undef HAVE_SRANDOM
558
559/* Define if you have the SSL libraries installed. */
560#undef HAVE_SSL
561
562/* Define to 1 if you have the `SSL_CTX_set_alpn_protos' function. */
563#undef HAVE_SSL_CTX_SET_ALPN_PROTOS
564
565/* Define to 1 if you have the `SSL_CTX_set_alpn_select_cb' function. */
566#undef HAVE_SSL_CTX_SET_ALPN_SELECT_CB
567
568/* Define to 1 if you have the `SSL_CTX_set_ciphersuites' function. */
569#undef HAVE_SSL_CTX_SET_CIPHERSUITES
570
571/* Define to 1 if you have the `SSL_CTX_set_security_level' function. */
572#undef HAVE_SSL_CTX_SET_SECURITY_LEVEL
573
574/* Define to 1 if you have the `SSL_CTX_set_tlsext_ticket_key_evp_cb'
575   function. */
576#undef HAVE_SSL_CTX_SET_TLSEXT_TICKET_KEY_EVP_CB
577
578/* Define to 1 if you have the `SSL_CTX_set_tmp_ecdh' function. */
579#undef HAVE_SSL_CTX_SET_TMP_ECDH
580
581/* Define to 1 if you have the `SSL_get0_alpn_selected' function. */
582#undef HAVE_SSL_GET0_ALPN_SELECTED
583
584/* Define to 1 if you have the `SSL_get0_peername' function. */
585#undef HAVE_SSL_GET0_PEERNAME
586
587/* Define to 1 if you have the `SSL_get1_peer_certificate' function. */
588#undef HAVE_SSL_GET1_PEER_CERTIFICATE
589
590/* Define to 1 if you have the `SSL_set1_host' function. */
591#undef HAVE_SSL_SET1_HOST
592
593/* Define to 1 if you have the <stdarg.h> header file. */
594#undef HAVE_STDARG_H
595
596/* Define to 1 if you have the <stdbool.h> header file. */
597#undef HAVE_STDBOOL_H
598
599/* Define to 1 if you have the <stdint.h> header file. */
600#undef HAVE_STDINT_H
601
602/* Define to 1 if you have the <stdio.h> header file. */
603#undef HAVE_STDIO_H
604
605/* Define to 1 if you have the <stdlib.h> header file. */
606#undef HAVE_STDLIB_H
607
608/* Define to 1 if you have the `strftime' function. */
609#undef HAVE_STRFTIME
610
611/* Define to 1 if you have the <strings.h> header file. */
612#undef HAVE_STRINGS_H
613
614/* Define to 1 if you have the <string.h> header file. */
615#undef HAVE_STRING_H
616
617/* Define to 1 if you have the `strlcat' function. */
618#undef HAVE_STRLCAT
619
620/* Define to 1 if you have the `strlcpy' function. */
621#undef HAVE_STRLCPY
622
623/* Define to 1 if you have the `strptime' function. */
624#undef HAVE_STRPTIME
625
626/* Define to 1 if you have the `strsep' function. */
627#undef HAVE_STRSEP
628
629/* Define to 1 if `ipi_spec_dst' is a member of `struct in_pktinfo'. */
630#undef HAVE_STRUCT_IN_PKTINFO_IPI_SPEC_DST
631
632/* Define to 1 if `sun_len' is a member of `struct sockaddr_un'. */
633#undef HAVE_STRUCT_SOCKADDR_UN_SUN_LEN
634
635/* Define if you have Swig libraries and header files. */
636#undef HAVE_SWIG
637
638/* Define to 1 if you have the <syslog.h> header file. */
639#undef HAVE_SYSLOG_H
640
641/* Define to 1 if systemd should be used */
642#undef HAVE_SYSTEMD
643
644/* Define to 1 if you have the <sys/endian.h> header file. */
645#undef HAVE_SYS_ENDIAN_H
646
647/* Define to 1 if you have the <sys/ipc.h> header file. */
648#undef HAVE_SYS_IPC_H
649
650/* Define to 1 if you have the <sys/param.h> header file. */
651#undef HAVE_SYS_PARAM_H
652
653/* Define to 1 if you have the <sys/resource.h> header file. */
654#undef HAVE_SYS_RESOURCE_H
655
656/* Define to 1 if you have the <sys/select.h> header file. */
657#undef HAVE_SYS_SELECT_H
658
659/* Define to 1 if you have the <sys/sha2.h> header file. */
660#undef HAVE_SYS_SHA2_H
661
662/* Define to 1 if you have the <sys/shm.h> header file. */
663#undef HAVE_SYS_SHM_H
664
665/* Define to 1 if you have the <sys/socket.h> header file. */
666#undef HAVE_SYS_SOCKET_H
667
668/* Define to 1 if you have the <sys/stat.h> header file. */
669#undef HAVE_SYS_STAT_H
670
671/* Define to 1 if you have the <sys/sysctl.h> header file. */
672#undef HAVE_SYS_SYSCTL_H
673
674/* Define to 1 if you have the <sys/types.h> header file. */
675#undef HAVE_SYS_TYPES_H
676
677/* Define to 1 if you have the <sys/uio.h> header file. */
678#undef HAVE_SYS_UIO_H
679
680/* Define to 1 if you have the <sys/un.h> header file. */
681#undef HAVE_SYS_UN_H
682
683/* Define to 1 if you have the <sys/wait.h> header file. */
684#undef HAVE_SYS_WAIT_H
685
686/* Define to 1 if you have the <TargetConditionals.h> header file. */
687#undef HAVE_TARGETCONDITIONALS_H
688
689/* Define to 1 if you have the <time.h> header file. */
690#undef HAVE_TIME_H
691
692/* Define to 1 if you have the `tzset' function. */
693#undef HAVE_TZSET
694
695/* Define to 1 if you have the <unistd.h> header file. */
696#undef HAVE_UNISTD_H
697
698/* Define to 1 if you have the `usleep' function. */
699#undef HAVE_USLEEP
700
701/* Define to 1 if you have the `vfork' function. */
702#undef HAVE_VFORK
703
704/* Define to 1 if you have the <vfork.h> header file. */
705#undef HAVE_VFORK_H
706
707/* Define to 1 if you have the <wchar.h> header file. */
708#undef HAVE_WCHAR_H
709
710/* Define to 1 if you have the <windows.h> header file. */
711#undef HAVE_WINDOWS_H
712
713/* Using Windows threads */
714#undef HAVE_WINDOWS_THREADS
715
716/* Define to 1 if you have the <winsock2.h> header file. */
717#undef HAVE_WINSOCK2_H
718
719/* Define to 1 if `fork' works. */
720#undef HAVE_WORKING_FORK
721
722/* Define to 1 if `vfork' works. */
723#undef HAVE_WORKING_VFORK
724
725/* Define to 1 if you have the `writev' function. */
726#undef HAVE_WRITEV
727
728/* Define to 1 if you have the <ws2tcpip.h> header file. */
729#undef HAVE_WS2TCPIP_H
730
731/* Define to 1 if you have the `X509_VERIFY_PARAM_set1_host' function. */
732#undef HAVE_X509_VERIFY_PARAM_SET1_HOST
733
734/* Define to 1 if you have the `_beginthreadex' function. */
735#undef HAVE__BEGINTHREADEX
736
737/* If HMAC_Init_ex() returns void */
738#undef HMAC_INIT_EX_RETURNS_VOID
739
740/* if lex has yylex_destroy */
741#undef LEX_HAS_YYLEX_DESTROY
742
743/* Define to the sub-directory where libtool stores uninstalled libraries. */
744#undef LT_OBJDIR
745
746/* Define to the maximum message length to pass to syslog. */
747#undef MAXSYSLOGMSGLEN
748
749/* Define if memcmp() does not compare unsigned bytes */
750#undef MEMCMP_IS_BROKEN
751
752/* Define if mkdir has one argument. */
753#undef MKDIR_HAS_ONE_ARG
754
755/* Define if the network stack does not fully support nonblocking io (causes
756   lower performance). */
757#undef NONBLOCKING_IS_BROKEN
758
759/* Put -D_ALL_SOURCE define in config.h */
760#undef OMITTED__D_ALL_SOURCE
761
762/* Put -D_BSD_SOURCE define in config.h */
763#undef OMITTED__D_BSD_SOURCE
764
765/* Put -D_DEFAULT_SOURCE define in config.h */
766#undef OMITTED__D_DEFAULT_SOURCE
767
768/* Put -D_GNU_SOURCE define in config.h */
769#undef OMITTED__D_GNU_SOURCE
770
771/* Put -D_LARGEFILE_SOURCE=1 define in config.h */
772#undef OMITTED__D_LARGEFILE_SOURCE_1
773
774/* Put -D_POSIX_C_SOURCE=200112 define in config.h */
775#undef OMITTED__D_POSIX_C_SOURCE_200112
776
777/* Put -D_XOPEN_SOURCE=600 define in config.h */
778#undef OMITTED__D_XOPEN_SOURCE_600
779
780/* Put -D_XOPEN_SOURCE_EXTENDED=1 define in config.h */
781#undef OMITTED__D_XOPEN_SOURCE_EXTENDED_1
782
783/* Put -D__EXTENSIONS__ define in config.h */
784#undef OMITTED__D__EXTENSIONS__
785
786/* Define to the address where bug reports for this package should be sent. */
787#undef PACKAGE_BUGREPORT
788
789/* Define to the full name of this package. */
790#undef PACKAGE_NAME
791
792/* Define to the full name and version of this package. */
793#undef PACKAGE_STRING
794
795/* Define to the one symbol short name of this package. */
796#undef PACKAGE_TARNAME
797
798/* Define to the home page for this package. */
799#undef PACKAGE_URL
800
801/* Define to the version of this package. */
802#undef PACKAGE_VERSION
803
804/* default pidfile location */
805#undef PIDFILE
806
807/* Define to necessary symbol if this constant uses a non-standard name on
808   your system. */
809#undef PTHREAD_CREATE_JOINABLE
810
811/* Return type of signal handlers, but autoconf 2.70 says 'your code may
812   safely assume C89 semantics that RETSIGTYPE is void.' */
813#undef RETSIGTYPE
814
815/* if REUSEPORT is enabled by default */
816#undef REUSEPORT_DEFAULT
817
818/* default rootkey location */
819#undef ROOT_ANCHOR_FILE
820
821/* default rootcert location */
822#undef ROOT_CERT_FILE
823
824/* version number for resource files */
825#undef RSRC_PACKAGE_VERSION
826
827/* Directory to chdir to */
828#undef RUN_DIR
829
830/* Shared data */
831#undef SHARE_DIR
832
833/* The size of `pthread_t', as computed by sizeof. */
834#undef SIZEOF_PTHREAD_T
835
836/* The size of `size_t', as computed by sizeof. */
837#undef SIZEOF_SIZE_T
838
839/* The size of `time_t', as computed by sizeof. */
840#undef SIZEOF_TIME_T
841
842/* The size of `unsigned long', as computed by sizeof. */
843#undef SIZEOF_UNSIGNED_LONG
844
845/* define if (v)snprintf does not return length needed, (but length used) */
846#undef SNPRINTF_RET_BROKEN
847
848/* Define to 1 if libsodium supports sodium_set_misuse_handler */
849#undef SODIUM_MISUSE_HANDLER
850
851/* Define to 1 if all of the C90 standard headers exist (not just the ones
852   required in a freestanding environment). This macro is provided for
853   backward compatibility; new code need not use it. */
854#undef STDC_HEADERS
855
856/* use default strptime. */
857#undef STRPTIME_WORKS
858
859/* Use win32 resources and API */
860#undef UB_ON_WINDOWS
861
862/* the SYSLOG_FACILITY to use, default LOG_DAEMON */
863#undef UB_SYSLOG_FACILITY
864
865/* default username */
866#undef UB_USERNAME
867
868/* use to enable lightweight alloc assertions, for debug use */
869#undef UNBOUND_ALLOC_LITE
870
871/* use malloc not regions, for debug use */
872#undef UNBOUND_ALLOC_NONREGIONAL
873
874/* use statistics for allocs and frees, for debug use */
875#undef UNBOUND_ALLOC_STATS
876
877/* define this to enable debug checks. */
878#undef UNBOUND_DEBUG
879
880/* Define to 1 to use cachedb support */
881#undef USE_CACHEDB
882
883/* Define to 1 to enable dnscrypt support */
884#undef USE_DNSCRYPT
885
886/* Define to 1 to enable dnscrypt with xchacha20 support */
887#undef USE_DNSCRYPT_XCHACHA20
888
889/* Define to 1 to enable dnstap support */
890#undef USE_DNSTAP
891
892/* Define this to enable DSA support. */
893#undef USE_DSA
894
895/* Define this to enable ECDSA support. */
896#undef USE_ECDSA
897
898/* Define this to enable an EVP workaround for older openssl */
899#undef USE_ECDSA_EVP_WORKAROUND
900
901/* Define this to enable ED25519 support. */
902#undef USE_ED25519
903
904/* Define this to enable ED448 support. */
905#undef USE_ED448
906
907/* Define this to enable GOST support. */
908#undef USE_GOST
909
910/* Define to 1 to use ipsecmod support. */
911#undef USE_IPSECMOD
912
913/* Define to 1 to use ipset support */
914#undef USE_IPSET
915
916/* Define if you enable libevent */
917#undef USE_LIBEVENT
918
919/* Define this to enable use of /proc/sys/net/ipv4/ip_local_port_range as a
920   default outgoing port range. This is only for the libunbound on Linux and
921   does not affect unbound resolving daemon itself. This may severely limit
922   the number of available outgoing ports and thus decrease randomness. Define
923   this only when the target system restricts (e.g. some of SELinux enabled
924   distributions) the use of non-ephemeral ports. */
925#undef USE_LINUX_IP_LOCAL_PORT_RANGE
926
927/* Define if you want to use internal select based events */
928#undef USE_MINI_EVENT
929
930/* Define this to enable client TCP Fast Open. */
931#undef USE_MSG_FASTOPEN
932
933/* Define this to enable client TCP Fast Open. */
934#undef USE_OSX_MSG_FASTOPEN
935
936/* Define this to use hiredis client. */
937#undef USE_REDIS
938
939/* Define this to enable SHA1 support. */
940#undef USE_SHA1
941
942/* Define this to enable SHA256 and SHA512 support. */
943#undef USE_SHA2
944
945/* Enable extensions on AIX 3, Interix.  */
946#ifndef _ALL_SOURCE
947# undef _ALL_SOURCE
948#endif
949/* Enable general extensions on macOS.  */
950#ifndef _DARWIN_C_SOURCE
951# undef _DARWIN_C_SOURCE
952#endif
953/* Enable general extensions on Solaris.  */
954#ifndef __EXTENSIONS__
955# undef __EXTENSIONS__
956#endif
957/* Enable GNU extensions on systems that have them.  */
958#ifndef _GNU_SOURCE
959# undef _GNU_SOURCE
960#endif
961/* Enable X/Open compliant socket functions that do not require linking
962   with -lxnet on HP-UX 11.11.  */
963#ifndef _HPUX_ALT_XOPEN_SOCKET_API
964# undef _HPUX_ALT_XOPEN_SOCKET_API
965#endif
966/* Identify the host operating system as Minix.
967   This macro does not affect the system headers' behavior.
968   A future release of Autoconf may stop defining this macro.  */
969#ifndef _MINIX
970# undef _MINIX
971#endif
972/* Enable general extensions on NetBSD.
973   Enable NetBSD compatibility extensions on Minix.  */
974#ifndef _NETBSD_SOURCE
975# undef _NETBSD_SOURCE
976#endif
977/* Enable OpenBSD compatibility extensions on NetBSD.
978   Oddly enough, this does nothing on OpenBSD.  */
979#ifndef _OPENBSD_SOURCE
980# undef _OPENBSD_SOURCE
981#endif
982/* Define to 1 if needed for POSIX-compatible behavior.  */
983#ifndef _POSIX_SOURCE
984# undef _POSIX_SOURCE
985#endif
986/* Define to 2 if needed for POSIX-compatible behavior.  */
987#ifndef _POSIX_1_SOURCE
988# undef _POSIX_1_SOURCE
989#endif
990/* Enable POSIX-compatible threading on Solaris.  */
991#ifndef _POSIX_PTHREAD_SEMANTICS
992# undef _POSIX_PTHREAD_SEMANTICS
993#endif
994/* Enable extensions specified by ISO/IEC TS 18661-5:2014.  */
995#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__
996# undef __STDC_WANT_IEC_60559_ATTRIBS_EXT__
997#endif
998/* Enable extensions specified by ISO/IEC TS 18661-1:2014.  */
999#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
1000# undef __STDC_WANT_IEC_60559_BFP_EXT__
1001#endif
1002/* Enable extensions specified by ISO/IEC TS 18661-2:2015.  */
1003#ifndef __STDC_WANT_IEC_60559_DFP_EXT__
1004# undef __STDC_WANT_IEC_60559_DFP_EXT__
1005#endif
1006/* Enable extensions specified by ISO/IEC TS 18661-4:2015.  */
1007#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__
1008# undef __STDC_WANT_IEC_60559_FUNCS_EXT__
1009#endif
1010/* Enable extensions specified by ISO/IEC TS 18661-3:2015.  */
1011#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__
1012# undef __STDC_WANT_IEC_60559_TYPES_EXT__
1013#endif
1014/* Enable extensions specified by ISO/IEC TR 24731-2:2010.  */
1015#ifndef __STDC_WANT_LIB_EXT2__
1016# undef __STDC_WANT_LIB_EXT2__
1017#endif
1018/* Enable extensions specified by ISO/IEC 24747:2009.  */
1019#ifndef __STDC_WANT_MATH_SPEC_FUNCS__
1020# undef __STDC_WANT_MATH_SPEC_FUNCS__
1021#endif
1022/* Enable extensions on HP NonStop.  */
1023#ifndef _TANDEM_SOURCE
1024# undef _TANDEM_SOURCE
1025#endif
1026/* Enable X/Open extensions.  Define to 500 only if necessary
1027   to make mbstate_t available.  */
1028#ifndef _XOPEN_SOURCE
1029# undef _XOPEN_SOURCE
1030#endif
1031
1032
1033/* Define this to enable server TCP Fast Open. */
1034#undef USE_TCP_FASTOPEN
1035
1036/* Whether the windows socket API is used */
1037#undef USE_WINSOCK
1038
1039/* the version of the windows API enabled */
1040#undef WINVER
1041
1042/* Define if you want dynlib module. */
1043#undef WITH_DYNLIBMODULE
1044
1045/* Define if you want Python module. */
1046#undef WITH_PYTHONMODULE
1047
1048/* Define if you want PyUnbound. */
1049#undef WITH_PYUNBOUND
1050
1051/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
1052   `char[]'. */
1053#undef YYTEXT_POINTER
1054
1055/* Number of bits in a file offset, on hosts where this is settable. */
1056#undef _FILE_OFFSET_BITS
1057
1058/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
1059#undef _LARGEFILE_SOURCE
1060
1061/* Define for large files, on AIX-style hosts. */
1062#undef _LARGE_FILES
1063
1064/* Enable for compile on Minix */
1065#undef _NETBSD_SOURCE
1066
1067/* defined to use gcc ansi snprintf and sscanf that understands %lld when
1068   compiled for windows. */
1069#undef __USE_MINGW_ANSI_STDIO
1070
1071/* Define to empty if `const' does not conform to ANSI C. */
1072#undef const
1073
1074/* Define to `int' if <sys/types.h> doesn't define. */
1075#undef gid_t
1076
1077/* in_addr_t */
1078#undef in_addr_t
1079
1080/* in_port_t */
1081#undef in_port_t
1082
1083/* Define to `__inline__' or `__inline' if that's what the C compiler
1084   calls it, or to nothing if 'inline' is not supported under any name.  */
1085#ifndef __cplusplus
1086#undef inline
1087#endif
1088
1089/* Define to `short' if <sys/types.h> does not define. */
1090#undef int16_t
1091
1092/* Define to `int' if <sys/types.h> does not define. */
1093#undef int32_t
1094
1095/* Define to `long long' if <sys/types.h> does not define. */
1096#undef int64_t
1097
1098/* Define to `signed char' if <sys/types.h> does not define. */
1099#undef int8_t
1100
1101/* Define if replacement function should be used. */
1102#undef malloc
1103
1104/* Define to `long int' if <sys/types.h> does not define. */
1105#undef off_t
1106
1107/* Define as a signed integer type capable of holding a process identifier. */
1108#undef pid_t
1109
1110/* Define to 'int' if not defined */
1111#undef rlim_t
1112
1113/* Define to `unsigned int' if <sys/types.h> does not define. */
1114#undef size_t
1115
1116/* Define to 'int' if not defined */
1117#undef socklen_t
1118
1119/* Define to `int' if <sys/types.h> does not define. */
1120#undef ssize_t
1121
1122/* Define to 'unsigned char if not defined */
1123#undef u_char
1124
1125/* Define to `int' if <sys/types.h> doesn't define. */
1126#undef uid_t
1127
1128/* Define to `unsigned short' if <sys/types.h> does not define. */
1129#undef uint16_t
1130
1131/* Define to `unsigned int' if <sys/types.h> does not define. */
1132#undef uint32_t
1133
1134/* Define to `unsigned long long' if <sys/types.h> does not define. */
1135#undef uint64_t
1136
1137/* Define to `unsigned char' if <sys/types.h> does not define. */
1138#undef uint8_t
1139
1140/* Define as `fork' if `vfork' does not work. */
1141#undef vfork
1142
1143#if defined(OMITTED__D_GNU_SOURCE) && !defined(_GNU_SOURCE)
1144#define _GNU_SOURCE 1
1145#endif
1146
1147#if defined(OMITTED__D_BSD_SOURCE) && !defined(_BSD_SOURCE)
1148#define _BSD_SOURCE 1
1149#endif
1150
1151#if defined(OMITTED__D_DEFAULT_SOURCE) && !defined(_DEFAULT_SOURCE)
1152#define _DEFAULT_SOURCE 1
1153#endif
1154
1155#if defined(OMITTED__D__EXTENSIONS__) && !defined(__EXTENSIONS__)
1156#define __EXTENSIONS__ 1
1157#endif
1158
1159#if defined(OMITTED__D_POSIX_C_SOURCE_200112) && !defined(_POSIX_C_SOURCE)
1160#define _POSIX_C_SOURCE 200112
1161#endif
1162
1163#if defined(OMITTED__D_XOPEN_SOURCE_600) && !defined(_XOPEN_SOURCE)
1164#define _XOPEN_SOURCE 600
1165#endif
1166
1167#if defined(OMITTED__D_XOPEN_SOURCE_EXTENDED_1) && !defined(_XOPEN_SOURCE_EXTENDED)
1168#define _XOPEN_SOURCE_EXTENDED 1
1169#endif
1170
1171#if defined(OMITTED__D_ALL_SOURCE) && !defined(_ALL_SOURCE)
1172#define _ALL_SOURCE 1
1173#endif
1174
1175#if defined(OMITTED__D_LARGEFILE_SOURCE_1) && !defined(_LARGEFILE_SOURCE)
1176#define _LARGEFILE_SOURCE 1
1177#endif
1178
1179
1180
1181
1182#ifndef _OPENBSD_SOURCE
1183#define _OPENBSD_SOURCE 1
1184#endif
1185
1186#ifndef UNBOUND_DEBUG
1187# ifndef NDEBUG
1188#  define NDEBUG
1189# endif
1190#endif
1191
1192/** Use small-ldns codebase */
1193#define USE_SLDNS 1
1194#ifdef HAVE_SSL
1195#  define LDNS_BUILD_CONFIG_HAVE_SSL 1
1196#endif
1197
1198#include <stdio.h>
1199#include <string.h>
1200#include <unistd.h>
1201#include <assert.h>
1202
1203#if STDC_HEADERS
1204#include <stdlib.h>
1205#include <stddef.h>
1206#endif
1207
1208#ifdef HAVE_STDARG_H
1209#include <stdarg.h>
1210#endif
1211
1212#ifdef HAVE_STDINT_H
1213#include <stdint.h>
1214#endif
1215
1216#include <errno.h>
1217
1218#if HAVE_SYS_PARAM_H
1219#include <sys/param.h>
1220#endif
1221
1222#ifdef HAVE_SYS_SOCKET_H
1223#include <sys/socket.h>
1224#endif
1225
1226#ifdef HAVE_SYS_UIO_H
1227#include <sys/uio.h>
1228#endif
1229
1230#ifdef HAVE_NETINET_IN_H
1231#include <netinet/in.h>
1232#endif
1233
1234#ifdef HAVE_NETINET_TCP_H
1235#include <netinet/tcp.h>
1236#endif
1237
1238#ifdef HAVE_ARPA_INET_H
1239#include <arpa/inet.h>
1240#endif
1241
1242#ifdef HAVE_WINSOCK2_H
1243#include <winsock2.h>
1244#endif
1245
1246#ifdef HAVE_WS2TCPIP_H
1247#include <ws2tcpip.h>
1248#endif
1249
1250#if !defined(USE_WINSOCK) || !defined(HAVE_SNPRINTF) || defined(SNPRINTF_RET_BROKEN) || defined(__USE_MINGW_ANSI_STDIO)
1251#define ARG_LL "%ll"
1252#else
1253#define ARG_LL "%I64"
1254#endif
1255
1256#ifndef AF_LOCAL
1257#define AF_LOCAL AF_UNIX
1258#endif
1259
1260
1261
1262#ifdef HAVE_ATTR_FORMAT
1263#  define ATTR_FORMAT(archetype, string_index, first_to_check) \
1264    __attribute__ ((format (archetype, string_index, first_to_check)))
1265#else /* !HAVE_ATTR_FORMAT */
1266#  define ATTR_FORMAT(archetype, string_index, first_to_check) /* empty */
1267#endif /* !HAVE_ATTR_FORMAT */
1268
1269
1270#if defined(DOXYGEN)
1271#  define ATTR_UNUSED(x)  x
1272#elif defined(__cplusplus)
1273#  define ATTR_UNUSED(x)
1274#elif defined(HAVE_ATTR_UNUSED)
1275#  define ATTR_UNUSED(x)  x __attribute__((unused))
1276#else /* !HAVE_ATTR_UNUSED */
1277#  define ATTR_UNUSED(x)  x
1278#endif /* !HAVE_ATTR_UNUSED */
1279
1280
1281#ifndef HAVE_FSEEKO
1282#define fseeko fseek
1283#define ftello ftell
1284#endif /* HAVE_FSEEKO */
1285
1286
1287#ifndef MAXHOSTNAMELEN
1288#define MAXHOSTNAMELEN 256
1289#endif
1290
1291#if !defined(HAVE_SNPRINTF) || defined(SNPRINTF_RET_BROKEN)
1292#define snprintf snprintf_unbound
1293#define vsnprintf vsnprintf_unbound
1294#include <stdarg.h>
1295int snprintf (char *str, size_t count, const char *fmt, ...);
1296int vsnprintf (char *str, size_t count, const char *fmt, va_list arg);
1297#endif /* HAVE_SNPRINTF or SNPRINTF_RET_BROKEN */
1298
1299#ifndef HAVE_INET_PTON
1300#define inet_pton inet_pton_unbound
1301int inet_pton(int af, const char* src, void* dst);
1302#endif /* HAVE_INET_PTON */
1303
1304
1305#ifndef HAVE_INET_NTOP
1306#define inet_ntop inet_ntop_unbound
1307const char *inet_ntop(int af, const void *src, char *dst, size_t size);
1308#endif
1309
1310
1311#ifndef HAVE_INET_ATON
1312#define inet_aton inet_aton_unbound
1313int inet_aton(const char *cp, struct in_addr *addr);
1314#endif
1315
1316
1317#ifndef HAVE_MEMMOVE
1318#define memmove memmove_unbound
1319void *memmove(void *dest, const void *src, size_t n);
1320#endif
1321
1322
1323#ifndef HAVE_STRLCAT
1324#define strlcat strlcat_unbound
1325size_t strlcat(char *dst, const char *src, size_t siz);
1326#endif
1327
1328
1329#ifndef HAVE_STRLCPY
1330#define strlcpy strlcpy_unbound
1331size_t strlcpy(char *dst, const char *src, size_t siz);
1332#endif
1333
1334
1335#ifndef HAVE_GMTIME_R
1336#define gmtime_r gmtime_r_unbound
1337struct tm *gmtime_r(const time_t *timep, struct tm *result);
1338#endif
1339
1340
1341#ifndef HAVE_REALLOCARRAY
1342#define reallocarray reallocarrayunbound
1343void* reallocarray(void *ptr, size_t nmemb, size_t size);
1344#endif
1345
1346
1347#if !defined(HAVE_SLEEP) || defined(HAVE_WINDOWS_H)
1348#define sleep(x) Sleep((x)*1000) /* on win32 */
1349#endif /* HAVE_SLEEP */
1350
1351
1352#ifndef HAVE_USLEEP
1353#define usleep(x) Sleep((x)/1000 + 1) /* on win32 */
1354#endif /* HAVE_USLEEP */
1355
1356
1357#ifndef HAVE_RANDOM
1358#define random rand /* on win32, for tests only (bad random) */
1359#endif /* HAVE_RANDOM */
1360
1361
1362#ifndef HAVE_SRANDOM
1363#define srandom(x) srand(x) /* on win32, for tests only (bad random) */
1364#endif /* HAVE_SRANDOM */
1365
1366
1367/* detect if we need to cast to unsigned int for FD_SET to avoid warnings */
1368#ifdef HAVE_WINSOCK2_H
1369#define FD_SET_T (u_int)
1370#else
1371#define FD_SET_T
1372#endif
1373
1374
1375#ifndef IPV6_MIN_MTU
1376#define IPV6_MIN_MTU 1280
1377#endif /* IPV6_MIN_MTU */
1378
1379
1380#ifdef MEMCMP_IS_BROKEN
1381#include "compat/memcmp.h"
1382#define memcmp memcmp_unbound
1383int memcmp(const void *x, const void *y, size_t n);
1384#endif
1385
1386
1387
1388#ifndef HAVE_CTIME_R
1389#define ctime_r unbound_ctime_r
1390char *ctime_r(const time_t *timep, char *buf);
1391#endif
1392
1393#ifndef HAVE_STRSEP
1394#define strsep unbound_strsep
1395char *strsep(char **stringp, const char *delim);
1396#endif
1397
1398#ifndef HAVE_ISBLANK
1399#define isblank unbound_isblank
1400int isblank(int c);
1401#endif
1402
1403#ifndef HAVE_EXPLICIT_BZERO
1404#define explicit_bzero unbound_explicit_bzero
1405void explicit_bzero(void* buf, size_t len);
1406#endif
1407
1408#if defined(HAVE_INET_NTOP) && !HAVE_DECL_INET_NTOP
1409const char *inet_ntop(int af, const void *src, char *dst, size_t size);
1410#endif
1411
1412#if defined(HAVE_INET_PTON) && !HAVE_DECL_INET_PTON
1413int inet_pton(int af, const char* src, void* dst);
1414#endif
1415
1416#if !defined(HAVE_STRPTIME) || !defined(STRPTIME_WORKS)
1417#define strptime unbound_strptime
1418struct tm;
1419char *strptime(const char *s, const char *format, struct tm *tm);
1420#endif
1421
1422#if !HAVE_DECL_REALLOCARRAY
1423void *reallocarray(void *ptr, size_t nmemb, size_t size);
1424#endif
1425
1426#ifdef HAVE_LIBBSD
1427#include <bsd/string.h>
1428#include <bsd/stdlib.h>
1429#endif
1430
1431#ifdef HAVE_LIBRESSL
1432#  if !HAVE_DECL_STRLCPY
1433size_t strlcpy(char *dst, const char *src, size_t siz);
1434#  endif
1435#  if !HAVE_DECL_STRLCAT
1436size_t strlcat(char *dst, const char *src, size_t siz);
1437#  endif
1438#  if !HAVE_DECL_ARC4RANDOM && defined(HAVE_ARC4RANDOM)
1439uint32_t arc4random(void);
1440#  endif
1441#  if !HAVE_DECL_ARC4RANDOM_UNIFORM && defined(HAVE_ARC4RANDOM_UNIFORM)
1442uint32_t arc4random_uniform(uint32_t upper_bound);
1443#  endif
1444#endif /* HAVE_LIBRESSL */
1445#ifndef HAVE_ARC4RANDOM
1446int getentropy(void* buf, size_t len);
1447uint32_t arc4random(void);
1448void arc4random_buf(void* buf, size_t n);
1449void _ARC4_LOCK(void);
1450void _ARC4_UNLOCK(void);
1451void _ARC4_LOCK_DESTROY(void);
1452#endif
1453#ifndef HAVE_ARC4RANDOM_UNIFORM
1454uint32_t arc4random_uniform(uint32_t upper_bound);
1455#endif
1456#ifdef COMPAT_SHA512
1457#ifndef SHA512_DIGEST_LENGTH
1458#define SHA512_BLOCK_LENGTH		128
1459#define SHA512_DIGEST_LENGTH		64
1460#define SHA512_DIGEST_STRING_LENGTH	(SHA512_DIGEST_LENGTH * 2 + 1)
1461typedef struct _SHA512_CTX {
1462	uint64_t	state[8];
1463	uint64_t	bitcount[2];
1464	uint8_t	buffer[SHA512_BLOCK_LENGTH];
1465} SHA512_CTX;
1466#endif /* SHA512_DIGEST_LENGTH */
1467void SHA512_Init(SHA512_CTX*);
1468void SHA512_Update(SHA512_CTX*, void*, size_t);
1469void SHA512_Final(uint8_t[SHA512_DIGEST_LENGTH], SHA512_CTX*);
1470unsigned char *SHA512(void* data, unsigned int data_len, unsigned char *digest);
1471#endif /* COMPAT_SHA512 */
1472
1473
1474
1475#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))
1476   /* using version of libevent that is not threadsafe. */
1477#  define LIBEVENT_SIGNAL_PROBLEM 1
1478#endif
1479
1480#ifndef CHECKED_INET6
1481#  define CHECKED_INET6
1482#  ifdef AF_INET6
1483#    define INET6
1484#  else
1485#    define AF_INET6        28
1486#  endif
1487#endif /* CHECKED_INET6 */
1488
1489#ifndef HAVE_GETADDRINFO
1490struct sockaddr_storage;
1491#include "compat/fake-rfc2553.h"
1492#endif
1493
1494#ifdef UNBOUND_ALLOC_STATS
1495#  define malloc(s) unbound_stat_malloc_log(s, __FILE__, __LINE__, __func__)
1496#  define calloc(n,s) unbound_stat_calloc_log(n, s, __FILE__, __LINE__, __func__)
1497#  define free(p) unbound_stat_free_log(p, __FILE__, __LINE__, __func__)
1498#  define realloc(p,s) unbound_stat_realloc_log(p, s, __FILE__, __LINE__, __func__)
1499#  define strdup(s) unbound_stat_strdup_log(s, __FILE__, __LINE__, __func__)
1500void *unbound_stat_malloc(size_t size);
1501void *unbound_stat_calloc(size_t nmemb, size_t size);
1502void unbound_stat_free(void *ptr);
1503void *unbound_stat_realloc(void *ptr, size_t size);
1504void *unbound_stat_malloc_log(size_t size, const char* file, int line,
1505	const char* func);
1506void *unbound_stat_calloc_log(size_t nmemb, size_t size, const char* file,
1507	int line, const char* func);
1508void unbound_stat_free_log(void *ptr, const char* file, int line,
1509	const char* func);
1510void *unbound_stat_realloc_log(void *ptr, size_t size, const char* file,
1511	int line, const char* func);
1512char *unbound_stat_strdup_log(const char *s, const char* file, int line,
1513	const char* func);
1514#elif defined(UNBOUND_ALLOC_LITE)
1515#  include "util/alloc.h"
1516#endif /* UNBOUND_ALLOC_LITE and UNBOUND_ALLOC_STATS */
1517
1518/** default port for DNS traffic. */
1519#define UNBOUND_DNS_PORT 53
1520/** default port for DNS over TLS traffic. */
1521#define UNBOUND_DNS_OVER_TLS_PORT 853
1522/** default port for DNS over HTTPS traffic. */
1523#define UNBOUND_DNS_OVER_HTTPS_PORT 443
1524/** default port for unbound control traffic, registered port with IANA,
1525    ub-dns-control  8953/tcp    unbound dns nameserver control */
1526#define UNBOUND_CONTROL_PORT 8953
1527/** the version of unbound-control that this software implements */
1528#define UNBOUND_CONTROL_VERSION 1
1529
1530
1531