1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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)
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
54 PHP_FUNCTION(gethostbyaddr);
55 PHP_FUNCTION(gethostbyname);
56 PHP_FUNCTION(gethostbynamel);
57
58 #ifdef HAVE_GETHOSTNAME
59 PHP_FUNCTION(gethostname);
60 #endif
61
62 #if defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC && !(defined(__BEOS__) || defined(NETWARE)))
63 PHP_FUNCTION(dns_check_record);
64
65 # if defined(PHP_WIN32) || HAVE_FULL_DNS_FUNCS
66 PHP_FUNCTION(dns_get_mx);
67 PHP_FUNCTION(dns_get_record);
68 PHP_MINIT_FUNCTION(dns);
69 # endif
70
71 #endif
72
73 #ifndef INT16SZ
74 #define INT16SZ 2
75 #endif
76
77 #ifndef INT32SZ
78 #define INT32SZ 4
79 #endif
80
81 #endif