Viet-Trung Luu | 96b05c1 | 2016-01-11 11:26:36 -0800 | [diff] [blame] | 1 | #include <resolv.h> |
| 2 | #include <netdb.h> |
| 3 | #include "libc.h" |
| 4 | |
George Kulakowski | 17e3b04 | 2016-02-18 15:59:50 -0800 | [diff] [blame] | 5 | int __res_mkquery(int, |
| 6 | const char*, |
| 7 | int, |
| 8 | int, |
| 9 | const unsigned char*, |
| 10 | int, |
| 11 | const unsigned char*, |
| 12 | unsigned char*, |
| 13 | int); |
| 14 | int __res_send(const unsigned char*, int, unsigned char*, int); |
Viet-Trung Luu | 96b05c1 | 2016-01-11 11:26:36 -0800 | [diff] [blame] | 15 | |
George Kulakowski | 17e3b04 | 2016-02-18 15:59:50 -0800 | [diff] [blame] | 16 | int __res_query(const char* name, |
| 17 | int class, |
| 18 | int type, |
| 19 | unsigned char* dest, |
| 20 | int len) { |
| 21 | unsigned char q[280]; |
| 22 | int ql = __res_mkquery(0, name, class, type, 0, 0, 0, q, sizeof q); |
| 23 | if (ql < 0) |
| 24 | return ql; |
| 25 | return __res_send(q, ql, dest, len); |
Viet-Trung Luu | 96b05c1 | 2016-01-11 11:26:36 -0800 | [diff] [blame] | 26 | } |
| 27 | |
| 28 | weak_alias(__res_query, res_query); |
| 29 | weak_alias(__res_query, res_search); |