summaryrefslogtreecommitdiffstats
path: root/lib/libc/resolv/res_data.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/resolv/res_data.c')
-rw-r--r--lib/libc/resolv/res_data.c41
1 files changed, 34 insertions, 7 deletions
diff --git a/lib/libc/resolv/res_data.c b/lib/libc/resolv/res_data.c
index 204e03d..ab6d575 100644
--- a/lib/libc/resolv/res_data.c
+++ b/lib/libc/resolv/res_data.c
@@ -18,6 +18,8 @@
#if defined(LIBC_SCCS) && !defined(lint)
static const char rcsid[] = "$Id: res_data.c,v 1.1.206.2 2004/03/16 12:34:18 marka Exp $";
#endif /* LIBC_SCCS and not lint */
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
#include "port_before.h"
@@ -40,7 +42,6 @@ static const char rcsid[] = "$Id: res_data.c,v 1.1.206.2 2004/03/16 12:34:18 mar
#include <unistd.h>
#include "port_after.h"
-#undef _res
const char *_res_opcodes[] = {
"QUERY",
@@ -71,11 +72,6 @@ const char *_res_sectioncodes[] = {
#endif
#ifndef __BIND_NOSTATIC
-struct __res_state _res
-# if defined(__BIND_RES_TEXT)
- = { RES_TIMEOUT, } /* Motorola, et al. */
-# endif
- ;
/* Proto. */
@@ -107,7 +103,7 @@ res_init(void) {
if (!_res.retrans)
_res.retrans = RES_TIMEOUT;
if (!_res.retry)
- _res.retry = 4;
+ _res.retry = RES_DFLRETRY;
if (!(_res.options & RES_INIT))
_res.options = RES_DEFAULT;
@@ -181,6 +177,7 @@ res_query(const char *name, /* domain name */
return (res_nquery(&_res, name, class, type, answer, anslen));
}
+#ifndef _LIBC
void
res_send_setqhook(res_send_qhook hook) {
_res.qhook = hook;
@@ -190,6 +187,7 @@ void
res_send_setrhook(res_send_rhook hook) {
_res.rhook = hook;
}
+#endif
int
res_isourserver(const struct sockaddr_in *inp) {
@@ -206,6 +204,7 @@ res_send(const u_char *buf, int buflen, u_char *ans, int anssiz) {
return (res_nsend(&_res, buf, buflen, ans, anssiz));
}
+#ifndef _LIBC
int
res_sendsigned(const u_char *buf, int buflen, ns_tsig_key *key,
u_char *ans, int anssiz)
@@ -217,6 +216,7 @@ res_sendsigned(const u_char *buf, int buflen, ns_tsig_key *key,
return (res_nsendsigned(&_res, buf, buflen, key, ans, anssiz));
}
+#endif
void
res_close(void) {
@@ -264,6 +264,12 @@ res_querydomain(const char *name,
answer, anslen));
}
+int
+res_opt(int n0, u_char *buf, int buflen, int anslen)
+{
+ return (res_nopt(&_res, n0, buf, buflen, anslen));
+}
+
const char *
hostalias(const char *name) {
static char abuf[MAXDNAME];
@@ -288,4 +294,25 @@ local_hostname_length(const char *hostname) {
}
#endif /*ultrix*/
+/*
+ * Weak aliases for applications that use certain private entry points,
+ * and fail to include <resolv.h>.
+ */
+#undef res_init
+__weak_reference(__res_init, res_init);
+#undef p_query
+__weak_reference(__p_query, p_query);
+#undef res_mkquery
+__weak_reference(__res_mkquery, res_mkquery);
+#undef res_query
+__weak_reference(__res_query, res_query);
+#undef res_send
+__weak_reference(__res_send, res_send);
+#undef res_close
+__weak_reference(__res_close, _res_close);
+#undef res_search
+__weak_reference(__res_search, res_search);
+#undef res_querydomain
+__weak_reference(__res_querydomain, res_querydomain);
+
#endif
OpenPOWER on IntegriCloud