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