aboutsummaryrefslogtreecommitdiffstats
path: root/libc/private/resolv_cache.h
diff options
context:
space:
mode:
authorMattias Falk <mattias.falk@sonyericsson.com>2011-08-23 14:34:14 +0200
committerRobert Greenwalt <rgreenwalt@google.com>2013-02-07 09:40:16 -0800
commitc63e59039d28c352e3053bb81319e960c392dbd4 (patch)
treef19b68ec83b6e17201473b1ff197d9525e75a664 /libc/private/resolv_cache.h
parent8db7a4cb20a7e90feb981736c1618f91a27bfff8 (diff)
downloadandroid_bionic-c63e59039d28c352e3053bb81319e960c392dbd4.tar.gz
android_bionic-c63e59039d28c352e3053bb81319e960c392dbd4.tar.bz2
android_bionic-c63e59039d28c352e3053bb81319e960c392dbd4.zip
dns cache per interface iteration 2
name server addresses are read from the dns cache associated wih the interface on which the request shall be done. processes which has requested to issue dns request using specific interface are now proxied to netd. added methods to attach/detach a process to a specific dns cache/interface. added getaddrinfoforinface method which takes an interface as an argument. bug:4815099 bug:5465296 Change-Id: I7a8fe1980cdf99d4d296ddc5c6411f0c72162263
Diffstat (limited to 'libc/private/resolv_cache.h')
-rw-r--r--libc/private/resolv_cache.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/libc/private/resolv_cache.h b/libc/private/resolv_cache.h
index 1dcc53fa1..4f32fb75f 100644
--- a/libc/private/resolv_cache.h
+++ b/libc/private/resolv_cache.h
@@ -28,13 +28,13 @@
#ifndef _RESOLV_CACHE_H_
#define _RESOLV_CACHE_H_
+struct __res_state;
struct resolv_cache; /* forward */
-/* gets the cache for the default interface. Might be NULL*/
-extern struct resolv_cache* __get_res_cache(void);
-
-/* get the cache for a specified interface. Can be NULL*/
-extern struct resolv_cache* __get_res_cache_for_iface(const char* ifname);
+/* gets the cache for an interface. Set ifname argument to NULL or
+ * empty buffer ('\0') to get cache for default interface.
+ * returned cache might be NULL*/
+extern struct resolv_cache* __get_res_cache(const char* ifname);
/* this gets called everytime we detect some changes in the DNS configuration
* and will flush the cache */
@@ -67,8 +67,14 @@ extern struct in_addr* _resolv_get_addr_of_default_iface();
/* gets the address associated with the specified interface */
extern struct in_addr* _resolv_get_addr_of_iface(const char* ifname);
-/* Get name of default interface */
-extern char* _resolv_get_default_iface();
+/* Copy the name of the default interface to provided buffer.
+ * Return length of buffer on success on failure -1 is returned */
+extern int _resolv_get_default_iface(char* buff, int buffLen);
+
+/* sets the name server addresses to the provided res_state structure. The
+ * name servers are retrieved from the cache which is associated
+ * with the interface to which the res_state structure is associated */
+extern int _resolv_populate_res_for_iface(struct __res_state* statp);
typedef enum {
RESOLV_CACHE_UNSUPPORTED, /* the cache can't handle that kind of queries */