xref: /freebsd/lib/libc/resolv/res_data.c (revision dc36d6f9bb1753f3808552f3afd30eda9a7b206a)
1*6e778a7eSPedro F. Giffuni /*-
2*6e778a7eSPedro F. Giffuni  * SPDX-License-Identifier: ISC
3*6e778a7eSPedro F. Giffuni  *
465e96449SHajimu UMEMOTO  * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
565e96449SHajimu UMEMOTO  * Copyright (c) 1995-1999 by Internet Software Consortium.
665e96449SHajimu UMEMOTO  *
765e96449SHajimu UMEMOTO  * Permission to use, copy, modify, and distribute this software for any
865e96449SHajimu UMEMOTO  * purpose with or without fee is hereby granted, provided that the above
965e96449SHajimu UMEMOTO  * copyright notice and this permission notice appear in all copies.
1065e96449SHajimu UMEMOTO  *
1165e96449SHajimu UMEMOTO  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
1265e96449SHajimu UMEMOTO  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
1365e96449SHajimu UMEMOTO  * MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR
1465e96449SHajimu UMEMOTO  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
1565e96449SHajimu UMEMOTO  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
1665e96449SHajimu UMEMOTO  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
1765e96449SHajimu UMEMOTO  * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1865e96449SHajimu UMEMOTO  */
1965e96449SHajimu UMEMOTO 
2065e96449SHajimu UMEMOTO #include "port_before.h"
2165e96449SHajimu UMEMOTO 
2265e96449SHajimu UMEMOTO #include <sys/param.h>
2365e96449SHajimu UMEMOTO #include <sys/socket.h>
2465e96449SHajimu UMEMOTO #include <sys/time.h>
2565e96449SHajimu UMEMOTO 
2665e96449SHajimu UMEMOTO #include <netinet/in.h>
2765e96449SHajimu UMEMOTO #include <arpa/inet.h>
2865e96449SHajimu UMEMOTO #include <arpa/nameser.h>
2965e96449SHajimu UMEMOTO 
3065e96449SHajimu UMEMOTO #include <ctype.h>
3165e96449SHajimu UMEMOTO #include <netdb.h>
3265e96449SHajimu UMEMOTO #include <resolv.h>
3365e96449SHajimu UMEMOTO #include <res_update.h>
3465e96449SHajimu UMEMOTO #include <stdio.h>
3565e96449SHajimu UMEMOTO #include <stdlib.h>
3665e96449SHajimu UMEMOTO #include <string.h>
3765e96449SHajimu UMEMOTO #include <unistd.h>
3865e96449SHajimu UMEMOTO 
3965e96449SHajimu UMEMOTO #include "port_after.h"
4065e96449SHajimu UMEMOTO 
4165e96449SHajimu UMEMOTO const char *_res_opcodes[] = {
4265e96449SHajimu UMEMOTO 	"QUERY",
4365e96449SHajimu UMEMOTO 	"IQUERY",
4465e96449SHajimu UMEMOTO 	"CQUERYM",
45dde4a85dSHajimu UMEMOTO 	"CQUERYU",	/*%< experimental */
46dde4a85dSHajimu UMEMOTO 	"NOTIFY",	/*%< experimental */
4765e96449SHajimu UMEMOTO 	"UPDATE",
4865e96449SHajimu UMEMOTO 	"6",
4965e96449SHajimu UMEMOTO 	"7",
5065e96449SHajimu UMEMOTO 	"8",
5165e96449SHajimu UMEMOTO 	"9",
5265e96449SHajimu UMEMOTO 	"10",
5365e96449SHajimu UMEMOTO 	"11",
5465e96449SHajimu UMEMOTO 	"12",
5565e96449SHajimu UMEMOTO 	"13",
5665e96449SHajimu UMEMOTO 	"ZONEINIT",
5765e96449SHajimu UMEMOTO 	"ZONEREF",
5865e96449SHajimu UMEMOTO };
5965e96449SHajimu UMEMOTO 
6065e96449SHajimu UMEMOTO #ifdef BIND_UPDATE
6165e96449SHajimu UMEMOTO const char *_res_sectioncodes[] = {
6265e96449SHajimu UMEMOTO 	"ZONE",
6365e96449SHajimu UMEMOTO 	"PREREQUISITES",
6465e96449SHajimu UMEMOTO 	"UPDATE",
6565e96449SHajimu UMEMOTO 	"ADDITIONAL",
6665e96449SHajimu UMEMOTO };
6765e96449SHajimu UMEMOTO #endif
6865e96449SHajimu UMEMOTO 
6965e96449SHajimu UMEMOTO #ifndef __BIND_NOSTATIC
7065e96449SHajimu UMEMOTO 
7165e96449SHajimu UMEMOTO /* Proto. */
7265e96449SHajimu UMEMOTO 
7365e96449SHajimu UMEMOTO int  res_ourserver_p(const res_state, const struct sockaddr_in *);
7465e96449SHajimu UMEMOTO 
754cf0f1f5SEric van Gyzen __noinline int
res_init(void)7665e96449SHajimu UMEMOTO res_init(void) {
7765e96449SHajimu UMEMOTO 	extern int __res_vinit(res_state, int);
784cf0f1f5SEric van Gyzen 	res_state statp = &_res;
7965e96449SHajimu UMEMOTO 
8065e96449SHajimu UMEMOTO 	/*
8165e96449SHajimu UMEMOTO 	 * These three fields used to be statically initialized.  This made
8265e96449SHajimu UMEMOTO 	 * it hard to use this code in a shared library.  It is necessary,
8365e96449SHajimu UMEMOTO 	 * now that we're doing dynamic initialization here, that we preserve
8465e96449SHajimu UMEMOTO 	 * the old semantics: if an application modifies one of these three
8565e96449SHajimu UMEMOTO 	 * fields of _res before res_init() is called, res_init() will not
8665e96449SHajimu UMEMOTO 	 * alter them.  Of course, if an application is setting them to
8765e96449SHajimu UMEMOTO 	 * _zero_ before calling res_init(), hoping to override what used
8865e96449SHajimu UMEMOTO 	 * to be the static default, we can't detect it and unexpected results
8965e96449SHajimu UMEMOTO 	 * will follow.  Zero for any of these fields would make no sense,
9065e96449SHajimu UMEMOTO 	 * so one can safely assume that the applications were already getting
9165e96449SHajimu UMEMOTO 	 * unexpected results.
9265e96449SHajimu UMEMOTO 	 *
9365e96449SHajimu UMEMOTO 	 * _res.options is tricky since some apps were known to diddle the bits
9465e96449SHajimu UMEMOTO 	 * before res_init() was first called. We can't replicate that semantic
9565e96449SHajimu UMEMOTO 	 * with dynamic initialization (they may have turned bits off that are
9665e96449SHajimu UMEMOTO 	 * set in RES_DEFAULT).  Our solution is to declare such applications
9765e96449SHajimu UMEMOTO 	 * "broken".  They could fool us by setting RES_INIT but none do (yet).
9865e96449SHajimu UMEMOTO 	 */
994cf0f1f5SEric van Gyzen 	if (!statp->retrans)
1004cf0f1f5SEric van Gyzen 		statp->retrans = RES_TIMEOUT;
1014cf0f1f5SEric van Gyzen 	if (!statp->retry)
1024cf0f1f5SEric van Gyzen 		statp->retry = RES_DFLRETRY;
1034cf0f1f5SEric van Gyzen 	if (!(statp->options & RES_INIT))
1044cf0f1f5SEric van Gyzen 		statp->options = RES_DEFAULT;
10565e96449SHajimu UMEMOTO 
1064cf0f1f5SEric van Gyzen 	return (__res_vinit(statp, 1));
10765e96449SHajimu UMEMOTO }
10865e96449SHajimu UMEMOTO 
10965e96449SHajimu UMEMOTO void
p_query(const u_char * msg)11065e96449SHajimu UMEMOTO p_query(const u_char *msg) {
11165e96449SHajimu UMEMOTO 	fp_query(msg, stdout);
11265e96449SHajimu UMEMOTO }
11365e96449SHajimu UMEMOTO 
11465e96449SHajimu UMEMOTO void
fp_query(const u_char * msg,FILE * file)11565e96449SHajimu UMEMOTO fp_query(const u_char *msg, FILE *file) {
11665e96449SHajimu UMEMOTO 	fp_nquery(msg, PACKETSZ, file);
11765e96449SHajimu UMEMOTO }
11865e96449SHajimu UMEMOTO 
11965e96449SHajimu UMEMOTO void
fp_nquery(const u_char * msg,int len,FILE * file)12065e96449SHajimu UMEMOTO fp_nquery(const u_char *msg, int len, FILE *file) {
1214cf0f1f5SEric van Gyzen 	res_state statp = &_res;
1224cf0f1f5SEric van Gyzen 	if ((statp->options & RES_INIT) == 0U && res_init() == -1)
12365e96449SHajimu UMEMOTO 		return;
12465e96449SHajimu UMEMOTO 
1254cf0f1f5SEric van Gyzen 	res_pquery(statp, msg, len, file);
12665e96449SHajimu UMEMOTO }
12765e96449SHajimu UMEMOTO 
12865e96449SHajimu UMEMOTO int
res_mkquery(int op,const char * dname,int class,int type,const u_char * data,int datalen,const u_char * newrr_in,u_char * buf,int buflen)129dde4a85dSHajimu UMEMOTO res_mkquery(int op,			/*!< opcode of query  */
130dde4a85dSHajimu UMEMOTO 	    const char *dname,		/*!< domain name  */
131dde4a85dSHajimu UMEMOTO 	    int class, int type,	/*!< class and type of query  */
132dde4a85dSHajimu UMEMOTO 	    const u_char *data,		/*!< resource record data  */
133dde4a85dSHajimu UMEMOTO 	    int datalen,		/*!< length of data  */
134dde4a85dSHajimu UMEMOTO 	    const u_char *newrr_in,	/*!< new rr for modify or append  */
135dde4a85dSHajimu UMEMOTO 	    u_char *buf,		/*!< buffer to put query  */
136dde4a85dSHajimu UMEMOTO 	    int buflen)			/*!< size of buffer  */
13765e96449SHajimu UMEMOTO {
1384cf0f1f5SEric van Gyzen 	res_state statp = &_res;
1394cf0f1f5SEric van Gyzen 	if ((statp->options & RES_INIT) == 0U && res_init() == -1) {
1404cf0f1f5SEric van Gyzen 		RES_SET_H_ERRNO(statp, NETDB_INTERNAL);
14165e96449SHajimu UMEMOTO 		return (-1);
14265e96449SHajimu UMEMOTO 	}
1434cf0f1f5SEric van Gyzen 	return (res_nmkquery(statp, op, dname, class, type,
14465e96449SHajimu UMEMOTO 			     data, datalen,
14565e96449SHajimu UMEMOTO 			     newrr_in, buf, buflen));
14665e96449SHajimu UMEMOTO }
14765e96449SHajimu UMEMOTO 
14865e96449SHajimu UMEMOTO int
res_mkupdate(ns_updrec * rrecp_in,u_char * buf,int buflen)14965e96449SHajimu UMEMOTO res_mkupdate(ns_updrec *rrecp_in, u_char *buf, int buflen) {
1504cf0f1f5SEric van Gyzen 	res_state statp = &_res;
1514cf0f1f5SEric van Gyzen 	if ((statp->options & RES_INIT) == 0U && res_init() == -1) {
1524cf0f1f5SEric van Gyzen 		RES_SET_H_ERRNO(statp, NETDB_INTERNAL);
15365e96449SHajimu UMEMOTO 		return (-1);
15465e96449SHajimu UMEMOTO 	}
15565e96449SHajimu UMEMOTO 
1564cf0f1f5SEric van Gyzen 	return (res_nmkupdate(statp, rrecp_in, buf, buflen));
15765e96449SHajimu UMEMOTO }
15865e96449SHajimu UMEMOTO 
15965e96449SHajimu UMEMOTO int
res_query(const char * name,int class,int type,u_char * answer,int anslen)160dde4a85dSHajimu UMEMOTO res_query(const char *name,	/*!< domain name  */
161dde4a85dSHajimu UMEMOTO 	  int class, int type,	/*!< class and type of query  */
162dde4a85dSHajimu UMEMOTO 	  u_char *answer,	/*!< buffer to put answer  */
163dde4a85dSHajimu UMEMOTO 	  int anslen)		/*!< size of answer buffer  */
16465e96449SHajimu UMEMOTO {
1654cf0f1f5SEric van Gyzen 	res_state statp = &_res;
1664cf0f1f5SEric van Gyzen 	if ((statp->options & RES_INIT) == 0U && res_init() == -1) {
1674cf0f1f5SEric van Gyzen 		RES_SET_H_ERRNO(statp, NETDB_INTERNAL);
16865e96449SHajimu UMEMOTO 		return (-1);
16965e96449SHajimu UMEMOTO 	}
1704cf0f1f5SEric van Gyzen 	return (res_nquery(statp, name, class, type, answer, anslen));
17165e96449SHajimu UMEMOTO }
17265e96449SHajimu UMEMOTO 
173ab96eeabSHajimu UMEMOTO #ifndef _LIBC
17465e96449SHajimu UMEMOTO void
res_send_setqhook(res_send_qhook hook)17565e96449SHajimu UMEMOTO res_send_setqhook(res_send_qhook hook) {
17665e96449SHajimu UMEMOTO 	_res.qhook = hook;
17765e96449SHajimu UMEMOTO }
17865e96449SHajimu UMEMOTO 
17965e96449SHajimu UMEMOTO void
res_send_setrhook(res_send_rhook hook)18065e96449SHajimu UMEMOTO res_send_setrhook(res_send_rhook hook) {
18165e96449SHajimu UMEMOTO 	_res.rhook = hook;
18265e96449SHajimu UMEMOTO }
183ab96eeabSHajimu UMEMOTO #endif
18465e96449SHajimu UMEMOTO 
18565e96449SHajimu UMEMOTO int
res_isourserver(const struct sockaddr_in * inp)18665e96449SHajimu UMEMOTO res_isourserver(const struct sockaddr_in *inp) {
18765e96449SHajimu UMEMOTO 	return (res_ourserver_p(&_res, inp));
18865e96449SHajimu UMEMOTO }
18965e96449SHajimu UMEMOTO 
19065e96449SHajimu UMEMOTO int
res_send(const u_char * buf,int buflen,u_char * ans,int anssiz)19165e96449SHajimu UMEMOTO res_send(const u_char *buf, int buflen, u_char *ans, int anssiz) {
1924cf0f1f5SEric van Gyzen 	res_state statp = &_res;
1934cf0f1f5SEric van Gyzen 	if ((statp->options & RES_INIT) == 0U && res_init() == -1) {
19465e96449SHajimu UMEMOTO 		/* errno should have been set by res_init() in this case. */
19565e96449SHajimu UMEMOTO 		return (-1);
19665e96449SHajimu UMEMOTO 	}
19765e96449SHajimu UMEMOTO 
1984cf0f1f5SEric van Gyzen 	return (res_nsend(statp, buf, buflen, ans, anssiz));
19965e96449SHajimu UMEMOTO }
20065e96449SHajimu UMEMOTO 
201ab96eeabSHajimu UMEMOTO #ifndef _LIBC
20265e96449SHajimu UMEMOTO int
res_sendsigned(const u_char * buf,int buflen,ns_tsig_key * key,u_char * ans,int anssiz)20365e96449SHajimu UMEMOTO res_sendsigned(const u_char *buf, int buflen, ns_tsig_key *key,
20465e96449SHajimu UMEMOTO 	       u_char *ans, int anssiz)
20565e96449SHajimu UMEMOTO {
2064cf0f1f5SEric van Gyzen 	res_state statp = &_res;
2074cf0f1f5SEric van Gyzen 	if ((statp->options & RES_INIT) == 0U && res_init() == -1) {
20865e96449SHajimu UMEMOTO 		/* errno should have been set by res_init() in this case. */
20965e96449SHajimu UMEMOTO 		return (-1);
21065e96449SHajimu UMEMOTO 	}
21165e96449SHajimu UMEMOTO 
2124cf0f1f5SEric van Gyzen 	return (res_nsendsigned(statp, buf, buflen, key, ans, anssiz));
21365e96449SHajimu UMEMOTO }
214ab96eeabSHajimu UMEMOTO #endif
21565e96449SHajimu UMEMOTO 
21665e96449SHajimu UMEMOTO void
res_close(void)21765e96449SHajimu UMEMOTO res_close(void) {
21865e96449SHajimu UMEMOTO 	res_nclose(&_res);
21965e96449SHajimu UMEMOTO }
22065e96449SHajimu UMEMOTO 
22165e96449SHajimu UMEMOTO int
res_update(ns_updrec * rrecp_in)22265e96449SHajimu UMEMOTO res_update(ns_updrec *rrecp_in) {
2234cf0f1f5SEric van Gyzen 	res_state statp = &_res;
2244cf0f1f5SEric van Gyzen 	if ((statp->options & RES_INIT) == 0U && res_init() == -1) {
2254cf0f1f5SEric van Gyzen 		RES_SET_H_ERRNO(statp, NETDB_INTERNAL);
22665e96449SHajimu UMEMOTO 		return (-1);
22765e96449SHajimu UMEMOTO 	}
22865e96449SHajimu UMEMOTO 
2294cf0f1f5SEric van Gyzen 	return (res_nupdate(statp, rrecp_in, NULL));
23065e96449SHajimu UMEMOTO }
23165e96449SHajimu UMEMOTO 
23265e96449SHajimu UMEMOTO int
res_search(const char * name,int class,int type,u_char * answer,int anslen)233dde4a85dSHajimu UMEMOTO res_search(const char *name,	/*!< domain name  */
234dde4a85dSHajimu UMEMOTO 	   int class, int type,	/*!< class and type of query  */
235dde4a85dSHajimu UMEMOTO 	   u_char *answer,	/*!< buffer to put answer  */
236dde4a85dSHajimu UMEMOTO 	   int anslen)		/*!< size of answer  */
23765e96449SHajimu UMEMOTO {
2384cf0f1f5SEric van Gyzen 	res_state statp = &_res;
2394cf0f1f5SEric van Gyzen 	if ((statp->options & RES_INIT) == 0U && res_init() == -1) {
2404cf0f1f5SEric van Gyzen 		RES_SET_H_ERRNO(statp, NETDB_INTERNAL);
24165e96449SHajimu UMEMOTO 		return (-1);
24265e96449SHajimu UMEMOTO 	}
24365e96449SHajimu UMEMOTO 
2444cf0f1f5SEric van Gyzen 	return (res_nsearch(statp, name, class, type, answer, anslen));
24565e96449SHajimu UMEMOTO }
24665e96449SHajimu UMEMOTO 
24765e96449SHajimu UMEMOTO int
res_querydomain(const char * name,const char * domain,int class,int type,u_char * answer,int anslen)24865e96449SHajimu UMEMOTO res_querydomain(const char *name,
24965e96449SHajimu UMEMOTO 		const char *domain,
250dde4a85dSHajimu UMEMOTO 		int class, int type,	/*!< class and type of query  */
251dde4a85dSHajimu UMEMOTO 		u_char *answer,		/*!< buffer to put answer  */
252dde4a85dSHajimu UMEMOTO 		int anslen)		/*!< size of answer  */
25365e96449SHajimu UMEMOTO {
2544cf0f1f5SEric van Gyzen 	res_state statp = &_res;
2554cf0f1f5SEric van Gyzen 	if ((statp->options & RES_INIT) == 0U && res_init() == -1) {
2564cf0f1f5SEric van Gyzen 		RES_SET_H_ERRNO(statp, NETDB_INTERNAL);
25765e96449SHajimu UMEMOTO 		return (-1);
25865e96449SHajimu UMEMOTO 	}
25965e96449SHajimu UMEMOTO 
2604cf0f1f5SEric van Gyzen 	return (res_nquerydomain(statp, name, domain,
26165e96449SHajimu UMEMOTO 				 class, type,
26265e96449SHajimu UMEMOTO 				 answer, anslen));
26365e96449SHajimu UMEMOTO }
26465e96449SHajimu UMEMOTO 
265046c3635SPedro F. Giffuni u_int
res_randomid(void)266046c3635SPedro F. Giffuni res_randomid(void) {
2674cf0f1f5SEric van Gyzen 	res_state statp = &_res;
2684cf0f1f5SEric van Gyzen 	if ((statp->options & RES_INIT) == 0U && res_init() == -1) {
2694cf0f1f5SEric van Gyzen 		RES_SET_H_ERRNO(statp, NETDB_INTERNAL);
270046c3635SPedro F. Giffuni 		return (-1);
271046c3635SPedro F. Giffuni 	}
272046c3635SPedro F. Giffuni 
2734cf0f1f5SEric van Gyzen 	return (res_nrandomid(statp));
274046c3635SPedro F. Giffuni }
275046c3635SPedro F. Giffuni 
276ab96eeabSHajimu UMEMOTO int
res_opt(int n0,u_char * buf,int buflen,int anslen)277ab96eeabSHajimu UMEMOTO res_opt(int n0, u_char *buf, int buflen, int anslen)
278ab96eeabSHajimu UMEMOTO {
279ab96eeabSHajimu UMEMOTO 	return (res_nopt(&_res, n0, buf, buflen, anslen));
280ab96eeabSHajimu UMEMOTO }
281ab96eeabSHajimu UMEMOTO 
28265e96449SHajimu UMEMOTO const char *
hostalias(const char * name)28365e96449SHajimu UMEMOTO hostalias(const char *name) {
28465e96449SHajimu UMEMOTO 	static char abuf[MAXDNAME];
28565e96449SHajimu UMEMOTO 
28665e96449SHajimu UMEMOTO 	return (res_hostalias(&_res, name, abuf, sizeof abuf));
28765e96449SHajimu UMEMOTO }
28865e96449SHajimu UMEMOTO 
28965e96449SHajimu UMEMOTO #ifdef ultrix
29065e96449SHajimu UMEMOTO int
local_hostname_length(const char * hostname)29165e96449SHajimu UMEMOTO local_hostname_length(const char *hostname) {
29265e96449SHajimu UMEMOTO 	int len_host, len_domain;
2934cf0f1f5SEric van Gyzen 	res_state statp;
29465e96449SHajimu UMEMOTO 
2954cf0f1f5SEric van Gyzen 	statp = &_res;
2964cf0f1f5SEric van Gyzen 	if (!*statp->defdname)
29765e96449SHajimu UMEMOTO 		res_init();
29865e96449SHajimu UMEMOTO 	len_host = strlen(hostname);
2994cf0f1f5SEric van Gyzen 	len_domain = strlen(statp->defdname);
30065e96449SHajimu UMEMOTO 	if (len_host > len_domain &&
3014cf0f1f5SEric van Gyzen 	    !strcasecmp(hostname + len_host - len_domain, statp->defdname) &&
30265e96449SHajimu UMEMOTO 	    hostname[len_host - len_domain - 1] == '.')
30365e96449SHajimu UMEMOTO 		return (len_host - len_domain - 1);
30465e96449SHajimu UMEMOTO 	return (0);
30565e96449SHajimu UMEMOTO }
30665e96449SHajimu UMEMOTO #endif /*ultrix*/
30765e96449SHajimu UMEMOTO 
308ab96eeabSHajimu UMEMOTO /*
309ab96eeabSHajimu UMEMOTO  * Weak aliases for applications that use certain private entry points,
310ab96eeabSHajimu UMEMOTO  * and fail to include <resolv.h>.
311ab96eeabSHajimu UMEMOTO  */
312ab96eeabSHajimu UMEMOTO #undef res_init
313ab96eeabSHajimu UMEMOTO __weak_reference(__res_init, res_init);
314ab96eeabSHajimu UMEMOTO #undef p_query
315ab96eeabSHajimu UMEMOTO __weak_reference(__p_query, p_query);
316ab96eeabSHajimu UMEMOTO #undef res_mkquery
317ab96eeabSHajimu UMEMOTO __weak_reference(__res_mkquery, res_mkquery);
318ab96eeabSHajimu UMEMOTO #undef res_query
319ab96eeabSHajimu UMEMOTO __weak_reference(__res_query, res_query);
320ab96eeabSHajimu UMEMOTO #undef res_send
321ab96eeabSHajimu UMEMOTO __weak_reference(__res_send, res_send);
322ab96eeabSHajimu UMEMOTO #undef res_close
323ab96eeabSHajimu UMEMOTO __weak_reference(__res_close, _res_close);
324ab96eeabSHajimu UMEMOTO #undef res_search
325ab96eeabSHajimu UMEMOTO __weak_reference(__res_search, res_search);
326ab96eeabSHajimu UMEMOTO #undef res_querydomain
327ab96eeabSHajimu UMEMOTO __weak_reference(__res_querydomain, res_querydomain);
328ab96eeabSHajimu UMEMOTO 
32965e96449SHajimu UMEMOTO #endif
330dde4a85dSHajimu UMEMOTO 
331dde4a85dSHajimu UMEMOTO /*! \file */
332