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