php_dns.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP Version 5 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997-2016 The PHP Group |
  6. +----------------------------------------------------------------------+
  7. | This source file is subject to version 3.01 of the PHP license, |
  8. | that is bundled with this package in the file LICENSE, and is |
  9. | available through the world-wide-web at the following url: |
  10. | http://www.php.net/license/3_01.txt |
  11. | If you did not receive a copy of the PHP license and are unable to |
  12. | obtain it through the world-wide-web, please send a note to |
  13. | license@php.net so we can mail you a copy immediately. |
  14. +----------------------------------------------------------------------+
  15. | Authors: The typical suspects |
  16. | Marcus Boerger <helly@php.net> |
  17. | Pollita <pollita@php.net> |
  18. +----------------------------------------------------------------------+
  19. */
  20. /* $Id$ */
  21. #ifndef PHP_DNS_H
  22. #define PHP_DNS_H
  23. #if defined(HAVE_DNS_SEARCH)
  24. #define php_dns_search(res, dname, class, type, answer, anslen) \
  25. ((int)dns_search(res, dname, class, type, answer, anslen, (struct sockaddr *)&from, &fromsize))
  26. #define php_dns_free_handle(res) \
  27. dns_free(res)
  28. #elif defined(HAVE_RES_NSEARCH)
  29. #define php_dns_search(res, dname, class, type, answer, anslen) \
  30. res_nsearch(res, dname, class, type, answer, anslen);
  31. #define php_dns_free_handle(res) \
  32. res_nclose(res); \
  33. php_dns_free_res(*res)
  34. #elif defined(HAVE_RES_SEARCH)
  35. #define php_dns_search(res, dname, class, type, answer, anslen) \
  36. res_search(dname, class, type, answer, anslen)
  37. #define php_dns_free_handle(res) /* noop */
  38. #endif
  39. #if defined(HAVE_DNS_SEARCH) || defined(HAVE_RES_NSEARCH) || defined(HAVE_RES_SEARCH)
  40. #define HAVE_DNS_SEARCH_FUNC 1
  41. #endif
  42. #if HAVE_DNS_SEARCH_FUNC && HAVE_DN_EXPAND && HAVE_DN_SKIPNAME
  43. #define HAVE_FULL_DNS_FUNCS 1
  44. #endif
  45. PHP_FUNCTION(gethostbyaddr);
  46. PHP_FUNCTION(gethostbyname);
  47. PHP_FUNCTION(gethostbynamel);
  48. #ifdef HAVE_GETHOSTNAME
  49. PHP_FUNCTION(gethostname);
  50. #endif
  51. #if defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !(defined(__BEOS__) || defined(NETWARE)))
  52. PHP_FUNCTION(dns_check_record);
  53. # if defined(PHP_WIN32) || HAVE_FULL_DNS_FUNCS
  54. PHP_FUNCTION(dns_get_mx);
  55. PHP_FUNCTION(dns_get_record);
  56. PHP_MINIT_FUNCTION(dns);
  57. # endif
  58. #endif /* defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !(defined(__BEOS__) || defined(NETWARE))) */
  59. #ifndef INT16SZ
  60. #define INT16SZ 2
  61. #endif
  62. #ifndef INT32SZ
  63. #define INT32SZ 4
  64. #endif
  65. #endif /* PHP_DNS_H */