Back to index

php5  5.3.10
php_dns.h
Go to the documentation of this file.
00001 /* 
00002    +----------------------------------------------------------------------+
00003    | PHP Version 5                                                        |
00004    +----------------------------------------------------------------------+
00005    | Copyright (c) 1997-2012 The PHP Group                                |
00006    +----------------------------------------------------------------------+
00007    | This source file is subject to version 3.01 of the PHP license,      |
00008    | that is bundled with this package in the file LICENSE, and is        |
00009    | available through the world-wide-web at the following url:           |
00010    | http://www.php.net/license/3_01.txt                                  |
00011    | If you did not receive a copy of the PHP license and are unable to   |
00012    | obtain it through the world-wide-web, please send a note to          |
00013    | license@php.net so we can mail you a copy immediately.               |
00014    +----------------------------------------------------------------------+
00015    | Authors: The typical suspects                                        |
00016    |          Marcus Boerger <helly@php.net>                              |
00017    |          Pollita <pollita@php.net>                                   |
00018    +----------------------------------------------------------------------+
00019 */
00020 
00021 /* $Id: php_dns.h 321634 2012-01-01 13:15:04Z felipe $ */
00022 
00023 #ifndef PHP_DNS_H
00024 #define PHP_DNS_H
00025 
00026 #if defined(HAVE_DNS_SEARCH)
00027 #define php_dns_search(res, dname, class, type, answer, anslen) \
00028        ((int)dns_search(res, dname, class, type, answer, anslen, (struct sockaddr *)&from, &fromsize))
00029 #define php_dns_free_handle(res) \
00030               dns_free(res)
00031 
00032 #elif defined(HAVE_RES_NSEARCH)
00033 #define php_dns_search(res, dname, class, type, answer, anslen) \
00034                      res_nsearch(res, dname, class, type, answer, anslen);
00035 #define php_dns_free_handle(res) \
00036                      res_nclose(res); \
00037                      php_dns_free_res(*res)
00038 
00039 #elif defined(HAVE_RES_SEARCH)
00040 #define php_dns_search(res, dname, class, type, answer, anslen) \
00041                      res_search(dname, class, type, answer, anslen)
00042 #define php_dns_free_handle(res) /* noop */
00043 
00044 #endif
00045 
00046 #if defined(HAVE_DNS_SEARCH) || defined(HAVE_RES_NSEARCH) || defined(HAVE_RES_SEARCH)
00047 #define HAVE_DNS_SEARCH_FUNC 1
00048 #endif
00049 
00050 #if HAVE_DNS_SEARCH_FUNC && HAVE_DN_EXPAND && HAVE_DN_SKIPNAME
00051 #define HAVE_FULL_DNS_FUNCS 1
00052 #endif
00053 
00054 PHP_FUNCTION(gethostbyaddr);
00055 PHP_FUNCTION(gethostbyname);
00056 PHP_FUNCTION(gethostbynamel);
00057 
00058 #ifdef HAVE_GETHOSTNAME
00059 PHP_FUNCTION(gethostname);
00060 #endif
00061 
00062 #if defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !(defined(__BEOS__) || defined(NETWARE)))
00063 PHP_FUNCTION(dns_check_record);
00064 
00065 # if defined(PHP_WIN32) || HAVE_FULL_DNS_FUNCS
00066 PHP_FUNCTION(dns_get_mx);
00067 PHP_FUNCTION(dns_get_record);
00068 PHP_MINIT_FUNCTION(dns);
00069 # endif
00070 
00071 #endif /* defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !(defined(__BEOS__) || defined(NETWARE))) */
00072 
00073 #ifndef INT16SZ
00074 #define INT16SZ             2
00075 #endif
00076 
00077 #ifndef INT32SZ
00078 #define INT32SZ             4
00079 #endif
00080 
00081 #endif /* PHP_DNS_H */