1/*
2 +----------------------------------------------------------------------+
3 | PHP Version 5 |
4 +----------------------------------------------------------------------+
5 | Copyright (c) 1997-2015 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
21/* $Id$ */
22
23#ifndef PHP_DNS_H
24#define PHP_DNS_H
25
26#if defined(HAVE_DNS_SEARCH)
27#define php_dns_search(res, dname, class, type, answer, anslen) \
28 ((int)dns_search(res, dname, class, type, answer, anslen, (struct sockaddr *)&from, &fromsize))
29#define php_dns_free_handle(res) \
30 dns_free(res)
31
32#elif defined(HAVE_RES_NSEARCH)
33#define php_dns_search(res, dname, class, type, answer, anslen) \
34 res_nsearch(res, dname, class, type, answer, anslen);
35#define php_dns_free_handle(res) \
36 res_nclose(res); \
37 php_dns_free_res(*res)
38
39#elif defined(HAVE_RES_SEARCH)
40#define php_dns_search(res, dname, class, type, answer, anslen) \
41 res_search(dname, class, type, answer, anslen)
42#define php_dns_free_handle(res) /* noop */
43
44#endif
45
46#if defined(HAVE_DNS_SEARCH) || defined(HAVE_RES_NSEARCH) || defined(HAVE_RES_SEARCH)
47#define HAVE_DNS_SEARCH_FUNC 1
48#endif
49
50#if HAVE_DNS_SEARCH_FUNC && HAVE_DN_EXPAND && HAVE_DN_SKIPNAME
51#define HAVE_FULL_DNS_FUNCS 1
52#endif
53
54PHP_FUNCTION(gethostbyaddr);
55PHP_FUNCTION(gethostbyname);
56PHP_FUNCTION(gethostbynamel);
57
58#ifdef HAVE_GETHOSTNAME
59PHP_FUNCTION(gethostname);
60#endif
61
62#if defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !(defined(__BEOS__) || defined(NETWARE)))
63PHP_FUNCTION(dns_check_record);
64
65# if defined(PHP_WIN32) || HAVE_FULL_DNS_FUNCS
66PHP_FUNCTION(dns_get_mx);
67PHP_FUNCTION(dns_get_record);
68PHP_MINIT_FUNCTION(dns);
69# endif
70
71#endif /* defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !(defined(__BEOS__) || defined(NETWARE))) */
72
73#ifndef INT16SZ
74#define INT16SZ 2
75#endif
76
77#ifndef INT32SZ
78#define INT32SZ 4
79#endif
80
81#endif /* PHP_DNS_H */
82