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.