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