resolv: dead code removal
- hostalias() and res_hostalias(): these were no-ops
- res_opt(), res_querydomain(), p_option(), p_query(),
res_isourserver(), res_nisourserver(): had no callers
- res_ourserver_p(): made local to res_data.cpp
- res_send_setqhook(): unused, DnsProxyListener sets the qhook directly
in android_net_context, which is then copied to res_state by
res_setnetcontext(). We can further simplify it later on.
Test: atest netd_integration_test
Change-Id: I70f72202e5b940986cac67dc99ab9461af882187
diff --git a/resolv/getaddrinfo.cpp b/resolv/getaddrinfo.cpp
index 8f287d0..f66f59e 100644
--- a/resolv/getaddrinfo.cpp
+++ b/resolv/getaddrinfo.cpp
@@ -1560,7 +1560,7 @@
return EAI_FAMILY;
}
- res = __res_get_state();
+ res = res_get_state();
if (res == NULL) {
free(buf);
free(buf2);
@@ -1574,7 +1574,7 @@
*/
res_setnetcontext(res, netcontext);
if (res_searchN(name, &q, res) < 0) {
- __res_put_state(res);
+ res_put_state(res);
free(buf);
free(buf2);
return EAI_NODATA; // TODO: Decode error from h_errno like we do below
@@ -1591,7 +1591,7 @@
free(buf);
free(buf2);
if (sentinel.ai_next == NULL) {
- __res_put_state(res);
+ res_put_state(res);
switch (h_errno) {
case HOST_NOT_FOUND:
return EAI_NODATA;
@@ -1604,7 +1604,7 @@
_rfc6724_sort(&sentinel, netcontext->app_mark, netcontext->uid);
- __res_put_state(res);
+ res_put_state(res);
*rv = sentinel.ai_next;
return 0;
@@ -1828,16 +1828,6 @@
trailing_dot = 0;
if (cp > name && *--cp == '.') trailing_dot++;
- // fprintf(stderr, "res_searchN() name = '%s'\n", name);
-
- /*
- * if there aren't any dots, it could be a user-level alias
- */
- if (!dots && (cp = __hostalias(name)) != NULL) {
- ret = res_queryN(cp, target, res);
- return ret;
- }
-
/*
* If there are dots in the name already, let's just give it a try
* 'as is'. The threshold can be set with the "ndots" option.
diff --git a/resolv/gethnamaddr.cpp b/resolv/gethnamaddr.cpp
index 3fd6324..5cdcd1d 100644
--- a/resolv/gethnamaddr.cpp
+++ b/resolv/gethnamaddr.cpp
@@ -482,7 +482,7 @@
/* The prototype of gethostbyname_r is from glibc, not that in netbsd. */
int gethostbyname_r(const char* name, struct hostent* hp, char* buf, size_t buflen,
struct hostent** result, int* errorp) {
- res_state res = __res_get_state();
+ res_state res = res_get_state();
if (res == NULL) {
*result = NULL;
*errorp = NETDB_INTERNAL;
@@ -495,7 +495,7 @@
*result = gethostbyname_internal(name, AF_INET6, res, hp, buf, buflen, errorp,
&NETCONTEXT_UNSET);
if (*result) {
- __res_put_state(res);
+ res_put_state(res);
return 0;
}
}
@@ -507,7 +507,7 @@
/* The prototype of gethostbyname2_r is from glibc, not that in netbsd. */
int gethostbyname2_r(const char* name, int af, struct hostent* hp, char* buf, size_t buflen,
struct hostent** result, int* errorp) {
- res_state res = __res_get_state();
+ res_state res = res_get_state();
if (res == NULL) {
*result = NULL;
*errorp = NETDB_INTERNAL;
@@ -520,9 +520,7 @@
static struct hostent* gethostbyname_internal_real(const char* name, int af, res_state res,
struct hostent* hp, char* buf, size_t buflen,
int* he) {
- const char* cp;
struct getnamaddr info;
- char hbuf[MAXHOSTNAMELEN];
size_t size;
_DIAGASSERT(name != NULL);
@@ -545,18 +543,11 @@
hp->h_length = (int) size;
/*
- * if there aren't any dots, it could be a user-level alias.
- * this is also done in res_nquery() since we are not the only
- * function that looks up host names.
- */
- if (!strchr(name, '.') && (cp = res_hostalias(res, name, hbuf, sizeof(hbuf)))) name = cp;
-
- /*
* disallow names consisting only of digits/dots, unless
* they end in a dot.
*/
- if (isdigit((u_char) name[0]))
- for (cp = name;; ++cp) {
+ if (isdigit((u_char) name[0])) {
+ for (const char* cp = name;; ++cp) {
if (!*cp) {
if (*--cp == '.') break;
/*
@@ -568,8 +559,9 @@
}
if (!isdigit((u_char) *cp) && *cp != '.') break;
}
- if ((isxdigit((u_char) name[0]) && strchr(name, ':') != NULL) || name[0] == ':')
- for (cp = name;; ++cp) {
+ }
+ if ((isxdigit((u_char) name[0]) && strchr(name, ':') != NULL) || name[0] == ':') {
+ for (const char* cp = name;; ++cp) {
if (!*cp) {
if (*--cp == '.') break;
/*
@@ -581,6 +573,7 @@
}
if (!isxdigit((u_char) *cp) && *cp != ':' && *cp != '.') break;
}
+ }
*he = NETDB_INTERNAL;
info.hp = hp;
@@ -700,7 +693,7 @@
struct hostent* netbsd_gethostent_r(FILE* hf, struct hostent* hent, char* buf, size_t buflen,
int* he) {
- const size_t line_buf_size = sizeof(__res_get_static()->hostbuf);
+ const size_t line_buf_size = sizeof(res_get_static()->hostbuf);
char *name;
char *cp, **q;
int af, len;
@@ -718,7 +711,7 @@
if (!aliases) goto nospc;
/* Allocate a new space to read file lines like upstream does.
- * To keep reentrancy we cannot use __res_get_static()->hostbuf here,
+ * To keep reentrancy we cannot use res_get_static()->hostbuf here,
* as the buffer may be used to store content for a previous hostent
* returned by non-reentrant functions like gethostbyname().
*/
@@ -747,7 +740,7 @@
} else {
if (inet_pton(AF_INET, p, &host_addr) <= 0) continue;
- res_state res = __res_get_state();
+ res_state res = res_get_state();
if (res == NULL) goto nospc;
if (res->options & RES_USE_INET6) {
map_v4v6_address(buf, buf);
@@ -757,7 +750,7 @@
af = AF_INET;
len = NS_INADDRSZ;
}
- __res_put_state(res);
+ res_put_state(res);
}
/* if this is not something we're looking for, skip it. */
@@ -906,7 +899,7 @@
*info->he = NETDB_INTERNAL;
return false;
}
- res = __res_get_state();
+ res = res_get_state();
if (res == NULL) {
free(buf);
return false;
@@ -915,12 +908,12 @@
if (n < 0) {
free(buf);
debugprintf("res_nsearch failed (%d)\n", res, n);
- __res_put_state(res);
+ res_put_state(res);
return false;
}
hp = getanswer(buf, n, name, type, res, info->hp, info->buf, info->buflen, info->he);
free(buf);
- __res_put_state(res);
+ res_put_state(res);
if (hp == NULL) {
return false;
}
@@ -971,7 +964,7 @@
*info->he = NETDB_INTERNAL;
return false;
}
- res = __res_get_state();
+ res = res_get_state();
if (res == NULL) {
free(buf);
return false;
@@ -981,13 +974,13 @@
if (n < 0) {
free(buf);
debugprintf("res_nquery failed (%d)\n", res, n);
- __res_put_state(res);
+ res_put_state(res);
return false;
}
hp = getanswer(buf, n, qbuf, T_PTR, res, info->hp, info->buf, info->buflen, info->he);
free(buf);
if (hp == NULL) {
- __res_put_state(res);
+ res_put_state(res);
return false;
}
@@ -1004,7 +997,7 @@
hp->h_length = NS_IN6ADDRSZ;
}
- __res_put_state(res);
+ res_put_state(res);
*info->he = NETDB_SUCCESS;
return true;
@@ -1020,7 +1013,7 @@
struct hostent* gethostbyname(const char* name) {
struct hostent* result = NULL;
- struct res_static* rs = __res_get_static(); // For thread-safety.
+ struct res_static* rs = res_get_static(); // For thread-safety.
gethostbyname_r(name, &rs->host, rs->hostbuf, sizeof(rs->hostbuf), &result, &h_errno);
return result;
@@ -1028,7 +1021,7 @@
struct hostent* gethostbyname2(const char* name, int af) {
struct hostent* result = NULL;
- struct res_static* rs = __res_get_static(); // For thread-safety.
+ struct res_static* rs = res_get_static(); // For thread-safety.
gethostbyname2_r(name, af, &rs->host, rs->hostbuf, sizeof(rs->hostbuf), &result, &h_errno);
return result;
@@ -1058,12 +1051,12 @@
struct hostent* android_gethostbynamefornetcontext(const char* name, int af,
const struct android_net_context* netcontext) {
struct hostent* hp;
- res_state res = __res_get_state();
+ res_state res = res_get_state();
if (res == NULL) return NULL;
- struct res_static* rs = __res_get_static(); // For thread-safety.
+ struct res_static* rs = res_get_static(); // For thread-safety.
hp = gethostbyname_internal(name, af, res, &rs->host, rs->hostbuf, sizeof(rs->hostbuf),
&h_errno, netcontext);
- __res_put_state(res);
+ res_put_state(res);
return hp;
}
@@ -1084,7 +1077,7 @@
static struct hostent* android_gethostbyaddrfornetcontext_proxy(
const void* addr, socklen_t len, int af, const struct android_net_context* netcontext) {
- struct res_static* rs = __res_get_static(); // For thread-safety.
+ struct res_static* rs = res_get_static(); // For thread-safety.
return android_gethostbyaddrfornetcontext_proxy_internal(
addr, len, af, &rs->host, rs->hostbuf, sizeof(rs->hostbuf), &h_errno, netcontext);
}
diff --git a/resolv/res_cache.cpp b/resolv/res_cache.cpp
index b298b39..55a521d 100644
--- a/resolv/res_cache.cpp
+++ b/resolv/res_cache.cpp
@@ -1359,7 +1359,7 @@
fp = fopen("/data/reslog.txt", "w+e");
if (fp != NULL) {
- statep = __res_get_state();
+ statep = res_get_state();
res_pquery(statep, answer, answerlen, fp);
diff --git a/resolv/res_data.cpp b/resolv/res_data.cpp
index 80aa908..477d2a9 100644
--- a/resolv/res_data.cpp
+++ b/resolv/res_data.cpp
@@ -32,7 +32,6 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include "res_private.h" // res_ourserver_p()
#include "resolv_private.h"
extern const char* const _res_opcodes[] = {
@@ -48,7 +47,6 @@
int res_init(void) {
int rv;
- extern int __res_vinit(res_state, int);
/*
* These three fields used to be statically initialized. This made
@@ -79,23 +77,10 @@
*/
if (!_nres.id) _nres.id = res_randomid();
- rv = __res_vinit(&_nres, 1);
+ rv = res_vinit(&_nres, 1);
return rv;
}
-static void fp_nquery(const u_char* msg, int len, FILE* file) {
- if (res_need_init() && res_init() == -1) return;
- res_pquery(&_nres, msg, len, file);
-}
-
-static void fp_query(const u_char* msg, FILE* file) {
- fp_nquery(msg, PACKETSZ, file);
-}
-
-void p_query(const u_char* msg) {
- fp_query(msg, stdout);
-}
-
int res_mkquery(int op, // opcode of query
const char* dname, // domain name
int cl, int type, // class and type of query
@@ -124,18 +109,6 @@
return res_nquery(&_nres, name, cl, type, answer, anslen);
}
-void res_send_setqhook(res_send_qhook hook) {
- _nres.qhook = hook;
-}
-
-void res_send_setrhook(res_send_rhook hook) {
- _nres.rhook = hook;
-}
-
-int res_isourserver(const struct sockaddr_in* inp) {
- return res_ourserver_p(&_nres, (const struct sockaddr*) (const void*) inp);
-}
-
int res_send(const u_char* buf, int buflen, u_char* ans, int anssiz) {
if (res_need_init() && res_init() == -1) {
/* errno should have been set by res_init() in this case. */
@@ -145,10 +118,6 @@
return res_nsend(&_nres, buf, buflen, ans, anssiz);
}
-void res_close(void) {
- res_nclose(&_nres);
-}
-
int res_search(const char* name, // domain name
int cl, int type, // class and type of query
u_char* answer, // buffer to put answer
@@ -161,24 +130,3 @@
return res_nsearch(&_nres, name, cl, type, answer, anslen);
}
-
-int res_querydomain(const char* name, const char* domain,
- int cl, int type, // class and type of query
- u_char* answer, // buffer to put answer
- int anslen) // size of answer
-{
- if (res_need_init() && res_init() == -1) {
- RES_SET_H_ERRNO(&_nres, NETDB_INTERNAL);
- return -1;
- }
-
- return res_nquerydomain(&_nres, name, domain, cl, type, answer, anslen);
-}
-
-int res_opt(int a, u_char* b, int c, int d) {
- return res_nopt(&_nres, a, b, c, d);
-}
-
-const char* hostalias(const char* /*name*/) {
- return NULL;
-}
diff --git a/resolv/res_debug.cpp b/resolv/res_debug.cpp
index 6a00d0c..094a354 100644
--- a/resolv/res_debug.cpp
+++ b/resolv/res_debug.cpp
@@ -507,68 +507,6 @@
}
/*
- * Return a mnemonic for an option
- */
-const char* p_option(u_long option) {
- static char nbuf[40];
-
- switch (option) {
- case RES_INIT:
- return "init";
- case RES_DEBUG:
- return "debug";
- case RES_AAONLY:
- return "aaonly(unimpl)";
- case RES_USEVC:
- return "usevc";
- case RES_PRIMARY:
- return "primry(unimpl)";
- case RES_IGNTC:
- return "igntc";
- case RES_RECURSE:
- return "recurs";
- case RES_DEFNAMES:
- return "defnam";
- case RES_STAYOPEN:
- return "styopn";
- case RES_DNSRCH:
- return "dnsrch";
- case RES_INSECURE1:
- return "insecure1";
- case RES_INSECURE2:
- return "insecure2";
- case RES_NOALIASES:
- return "noaliases";
- case RES_USE_INET6:
- return "inet6";
-#ifdef RES_USE_EDNS0 /* KAME extension */
- case RES_USE_EDNS0:
- return "edns0";
-#endif
-#ifdef RES_USE_DNAME
- case RES_USE_DNAME:
- return "dname";
-#endif
-#ifdef RES_USE_DNSSEC
- case RES_USE_DNSSEC:
- return "dnssec";
-#endif
-#ifdef RES_NOTLDQUERY
- case RES_NOTLDQUERY:
- return "no-tld-query";
-#endif
-#ifdef RES_NO_NIBBLE2
- case RES_NO_NIBBLE2:
- return "no-nibble2";
-#endif
- /* XXX nonreentrant */
- default:
- snprintf(nbuf, sizeof(nbuf), "?0x%lx?", (u_long) option);
- return (nbuf);
- }
-}
-
-/*
* Return a mnemonic for a time to live.
*/
const char* p_time(u_int32_t value) {
diff --git a/resolv/res_init.cpp b/resolv/res_init.cpp
index 651fc1b..808f44c 100644
--- a/resolv/res_init.cpp
+++ b/resolv/res_init.cpp
@@ -127,13 +127,11 @@
* Return 0 if completes successfully, -1 on error
*/
int res_ninit(res_state statp) {
- extern int __res_vinit(res_state, int);
-
- return (__res_vinit(statp, 0));
+ return res_vinit(statp, 0);
}
/* This function has to be reachable by res_data.c but not publicly. */
-int __res_vinit(res_state statp, int preinit) {
+int res_vinit(res_state statp, int preinit) {
char *cp, **pp;
char buf[BUFSIZ];
int nserv = 0; /* number of nameserver records read from file */
diff --git a/resolv/res_private.h b/resolv/res_private.h
index 2f48768..0fb9b5c 100644
--- a/resolv/res_private.h
+++ b/resolv/res_private.h
@@ -18,6 +18,4 @@
char nsuffix2[64];
};
-extern int res_ourserver_p(const res_state statp, const struct sockaddr* sa);
-
#endif // _RES_PRIVATE_H_
diff --git a/resolv/res_query.cpp b/resolv/res_query.cpp
index 2a0ce82..c0fe8b9 100644
--- a/resolv/res_query.cpp
+++ b/resolv/res_query.cpp
@@ -197,7 +197,6 @@
{
const char *cp, *const *domain;
HEADER* hp = (HEADER*) (void*) answer;
- char tmp[NS_MAXDNAME];
u_int dots;
int trailing_dot, ret, saved_herrno;
int got_nodata = 0, got_servfail = 0, root_on_list = 0;
@@ -212,10 +211,6 @@
trailing_dot = 0;
if (cp > name && *--cp == '.') trailing_dot++;
- /* If there aren't any dots, it could be a user-level alias. */
- if (!dots && (cp = res_hostalias(statp, name, tmp, sizeof tmp)) != NULL)
- return res_nquery(statp, cp, cl, type, answer, anslen);
-
/*
* If there are enough dots in the name, let's just give it a
* try 'as is'. The threshold can be set with the "ndots" option.
@@ -372,8 +367,3 @@
}
return res_nquery(statp, longname, cl, type, answer, anslen);
}
-
-const char* res_hostalias(const res_state /*statp*/, const char* /*name*/, char* /*dst*/,
- size_t /*siz*/) {
- return NULL;
-}
diff --git a/resolv/res_send.cpp b/resolv/res_send.cpp
index 30304f2..34a6e18 100644
--- a/resolv/res_send.cpp
+++ b/resolv/res_send.cpp
@@ -266,8 +266,6 @@
}
/* BIONIC-END */
-/* Public. */
-
/* int
* res_isourserver(ina)
* looks up "ina" in _res.ns_addr_list[]
@@ -277,9 +275,9 @@
* author:
* paul vixie, 29may94
*/
-int res_ourserver_p(const res_state statp, const struct sockaddr* sa) {
- const struct sockaddr_in *inp, *srv;
- const struct sockaddr_in6 *in6p, *srv6;
+static int res_ourserver_p(const res_state statp, const sockaddr* sa) {
+ const sockaddr_in *inp, *srv;
+ const sockaddr_in6 *in6p, *srv6;
int ns;
switch (sa->sa_family) {
@@ -290,7 +288,7 @@
if (srv->sin_family == inp->sin_family && srv->sin_port == inp->sin_port &&
(srv->sin_addr.s_addr == INADDR_ANY ||
srv->sin_addr.s_addr == inp->sin_addr.s_addr))
- return (1);
+ return 1;
}
break;
case AF_INET6:
@@ -304,13 +302,13 @@
#endif
(IN6_IS_ADDR_UNSPECIFIED(&srv6->sin6_addr) ||
IN6_ARE_ADDR_EQUAL(&srv6->sin6_addr, &in6p->sin6_addr)))
- return (1);
+ return 1;
}
break;
default:
break;
}
- return (0);
+ return 0;
}
/* int
diff --git a/resolv/res_state.cpp b/resolv/res_state.cpp
index ca8d424..738637b 100644
--- a/resolv/res_state.cpp
+++ b/resolv/res_state.cpp
@@ -49,7 +49,7 @@
struct res_static _rstatic[1];
} _res_thread;
-static _res_thread* _res_thread_alloc(void) {
+static _res_thread* res_thread_alloc(void) {
_res_thread* rt = (_res_thread*) calloc(1, sizeof(*rt));
if (rt) {
@@ -59,7 +59,7 @@
return rt;
}
-static void _res_static_done(struct res_static* rs) {
+static void res_static_done(struct res_static* rs) {
/* fortunately, there is nothing to do here, since the
* points in h_addr_ptrs and host_aliases should all
* point to 'hostbuf'
@@ -71,12 +71,12 @@
free(rs->servent.s_aliases);
}
-static void _res_thread_free(void* _rt) {
+static void res_thread_free(void* _rt) {
_res_thread* rt = (_res_thread*) _rt;
LOG(VERBOSE) << __func__ << ": rt=" << rt << " for thread=" << gettid();
- _res_static_done(rt->_rstatic);
+ res_static_done(rt->_rstatic);
res_ndestroy(rt->_nres);
free(rt);
}
@@ -84,10 +84,10 @@
static pthread_key_t _res_key;
__attribute__((constructor)) static void __res_key_init() {
- pthread_key_create(&_res_key, _res_thread_free);
+ pthread_key_create(&_res_key, res_thread_free);
}
-static _res_thread* _res_thread_get(void) {
+static _res_thread* res_thread_get(void) {
_res_thread* rt = (_res_thread*) pthread_getspecific(_res_key);
if (rt != NULL) {
return rt;
@@ -95,7 +95,7 @@
/* It is the first time this function is called in this thread,
* we need to create a new thread-specific DNS resolver state. */
- rt = _res_thread_alloc();
+ rt = res_thread_alloc();
if (rt == NULL) {
return NULL;
}
@@ -110,7 +110,7 @@
/* This should not happen */
LOG(VERBOSE) << __func__ << ": tid=" << gettid() << " rt=" << rt
<< ", res_ninit() returned < 0";
- _res_thread_free(rt);
+ res_thread_free(rt);
pthread_setspecific(_res_key, NULL);
return NULL;
}
@@ -119,41 +119,25 @@
struct __res_state _nres;
-#if 0
-struct resolv_cache*
-__get_res_cache(void)
-{
- _res_thread* rt = _res_thread_get();
-
- if (!rt)
- return NULL;
-
- if (!rt->_cache) {
- rt->_cache = _resolv_cache_create();
- }
- return rt->_cache;
-}
-#endif
-
int* __get_h_errno(void) {
- _res_thread* rt = _res_thread_get();
+ _res_thread* rt = res_thread_get();
static int panic = NETDB_INTERNAL;
return rt ? &rt->_h_errno : &panic;
}
-res_state __res_get_state(void) {
- _res_thread* rt = _res_thread_get();
+res_state res_get_state(void) {
+ _res_thread* rt = res_thread_get();
return rt ? rt->_nres : NULL;
}
-void __res_put_state(res_state res __unused) {
+void res_put_state(res_state res __unused) {
/* nothing to do */
}
-struct res_static* __res_get_static(void) {
- _res_thread* rt = _res_thread_get();
+res_static* res_get_static(void) {
+ _res_thread* rt = res_thread_get();
return rt ? rt->_rstatic : NULL;
}
diff --git a/resolv/resolv_private.h b/resolv/resolv_private.h
index b633920..8c37dd2 100644
--- a/resolv/resolv_private.h
+++ b/resolv/resolv_private.h
@@ -217,7 +217,6 @@
#define RES_DNSRCH 0x00000200 /* search up local domain tree */
#define RES_INSECURE1 0x00000400 /* type 1 security disabled */
#define RES_INSECURE2 0x00000800 /* type 2 security disabled */
-#define RES_NOALIASES 0x00001000 /* shuts off HOSTALIASES feature */
#define RES_USE_INET6 0x00002000 /* use/map IPv6 in gethostbyname() */
#define RES_ROTATE 0x00004000 /* rotate ns list after each query */
#define RES_NOCHECKNAME 0x00008000 /* do not check names for sanity. */
@@ -255,80 +254,17 @@
/* 0x00010000 */
/* Things involving an internal (static) resolver context. */
-struct __res_state* __res_get_state(void);
-void __res_put_state(struct __res_state*);
+struct __res_state* res_get_state(void);
+void res_put_state(struct __res_state*);
-#define fp_nquery __fp_nquery
-#define fp_query __fp_query
-#define hostalias __hostalias
-#define p_query __p_query
-#define res_close __res_close
-#define res_opt __res_opt
-#define res_isourserver __res_isourserver
-#define res_querydomain __res_querydomain
-#define res_send __res_send
-#define res_sendsigned __res_sendsigned
-
-const char* hostalias(const char*);
-void p_query(const u_char*);
void res_close(void);
int res_init(void);
-int res_opt(int, u_char*, int, int);
-int res_isourserver(const struct sockaddr_in*);
int res_mkquery(int, const char*, int, int, const u_char*, int, const u_char*, u_char*, int);
int res_query(const char*, int, int, u_char*, int);
-int res_querydomain(const char*, const char*, int, int, u_char*, int);
int res_search(const char*, int, int, u_char*, int);
int res_send(const u_char*, int, u_char*, int);
int res_sendsigned(const u_char*, int, ns_tsig_key*, u_char*, int);
-#define dn_count_labels __dn_count_labels
-#define dn_skipname __dn_skipname
-#define fp_resstat __fp_resstat
-#define loc_aton __loc_aton
-#define loc_ntoa __loc_ntoa
-#define p_cdname __p_cdname
-#define p_cdnname __p_cdnname
-#define p_class __p_class
-#define p_fqname __p_fqname
-#define p_fqnname __p_fqnname
-#define p_option __p_option
-#define p_secstodate __p_secstodate
-#define p_section __p_section
-#define p_time __p_time
-#define p_rcode __p_rcode
-#define p_sockun __p_sockun
-#define putlong __putlong
-#define putshort __putshort
-#define res_dnok __res_dnok
-#define res_findzonecut __res_findzonecut
-#define res_findzonecut2 __res_findzonecut2
-#define res_hnok __res_hnok
-#define res_hostalias __res_hostalias
-#define res_mailok __res_mailok
-#define res_nameinquery __res_nameinquery
-#define res_nclose __res_nclose
-#define res_ninit __res_ninit
-#define res_nmkquery __res_nmkquery
-#define res_pquery __res_pquery
-#define res_nquery __res_nquery
-#define res_nquerydomain __res_nquerydomain
-#define res_nsearch __res_nsearch
-#define res_nsend __res_nsend
-#define res_nsendsigned __res_nsendsigned
-#define res_nisourserver __res_nisourserver
-#define res_ownok __res_ownok
-#define res_queriesmatch __res_queriesmatch
-#define res_nopt __res_nopt
-#define res_ndestroy __res_ndestroy
-#define res_setservers __res_setservers
-#define res_getservers __res_getservers
-#define res_buildprotolist __res_buildprotolist
-#define res_ourserver_p __res_ourserver_p
-#define res_send_setqhook __res_send_setqhook
-#define res_send_setrhook __res_send_setrhook
-#define res_servicename __res_servicename
-#define res_servicenumber __res_servicenumber
int res_hnok(const char*);
int res_ownok(const char*);
int res_mailok(const char*);
@@ -347,7 +283,6 @@
const u_char* p_cdname(const u_char*, const u_char*, FILE*);
const u_char* p_fqnname(const u_char*, const u_char*, int, char*, int);
const u_char* p_fqname(const u_char*, const u_char*, FILE*);
-const char* p_option(u_long);
char* p_secstodate(u_long);
int dn_count_labels(const char*);
int res_nameinquery(const char*, int, int, const u_char*, const u_char*);
@@ -355,10 +290,8 @@
const char* p_section(int, int);
/* Things involving a resolver context. */
int res_ninit(res_state);
-int res_nisourserver(const res_state, const struct sockaddr_in*);
void fp_resstat(const res_state, FILE*);
void res_pquery(const res_state, const u_char*, int, FILE*);
-const char* res_hostalias(const res_state, const char*, char*, size_t);
int res_nquery(res_state, const char*, int, int, u_char*, int);
int res_nsearch(res_state, const char*, int, int, u_char*, int);
int res_nquerydomain(res_state, const char*, const char*, int, int, u_char*, int);
@@ -371,11 +304,7 @@
union res_sockaddr_union*, int);
void res_nclose(res_state);
int res_nopt(res_state, int, u_char*, int, int);
-void res_send_setqhook(res_send_qhook);
-void res_send_setrhook(res_send_rhook);
-int __res_vinit(res_state, int);
-const char* res_servicename(uint16_t, const char*);
-void res_buildprotolist(void);
+int res_vinit(res_state, int);
void res_ndestroy(res_state);
void res_setservers(res_state, const union res_sockaddr_union*, int);
int res_getservers(res_state, union res_sockaddr_union*, int);
@@ -385,13 +314,4 @@
u_int res_randomid(void);
-// Symbols that are supposed to be in resolv.h, but that we aren't exporting.
-int ns_parserr2(ns_msg*, ns_sect, int, ns_rr2*);
-int ns_name_pton2(const char*, u_char*, size_t, size_t*);
-int ns_name_unpack2(const u_char*, const u_char*, const u_char*, u_char*, size_t, size_t*);
-int ns_name_eq(ns_nname_ct, size_t, ns_nname_ct, size_t);
-int ns_name_owned(ns_namemap_ct, int, ns_namemap_ct, int);
-int ns_name_map(ns_nname_ct, size_t, ns_namemap_t, int);
-int ns_name_labels(ns_nname_ct, size_t);
-
#endif /* !_RESOLV_PRIVATE_H_ */
diff --git a/resolv/resolv_static.h b/resolv/resolv_static.h
index 8990e2d..87bdce2 100644
--- a/resolv/resolv_static.h
+++ b/resolv/resolv_static.h
@@ -28,6 +28,6 @@
struct hostent host;
};
-extern struct res_static* __res_get_static(void);
+res_static* res_get_static(void);
#endif // _RESOLV_STATIC_H_