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
This commit is contained in:
Mattias Falk
2011-08-23 14:34:14 +02:00
committed by Robert Greenwalt
parent 8db7a4cb20
commit c63e59039d
13 changed files with 670 additions and 346 deletions

View File

@@ -60,6 +60,21 @@ extern void _resolv_flush_cache_for_default_iface();
/* flush the cache associated with a certain interface */
extern void _resolv_flush_cache_for_iface(const char* ifname);
/* set a pid to use the name servers of the specified interface */
extern void _resolv_set_iface_for_pid(const char* ifname, int pid);
/* clear pid from being associated with an interface */
extern void _resolv_clear_iface_for_pid(int pid);
/** Gets the name of the interface to which the pid is attached.
* On error, -1 is returned.
* If no interface is found, 0 is returned and buff is set to empty ('\0').
* If an interface is found, the name is copied to buff and the length of the name is returned.
* Arguments: pid The pid to find an interface for
* buff A buffer to copy the result to
* buffLen Length of buff. An interface is at most IF_NAMESIZE in length */
extern int _resolv_get_pids_associated_interface(int pid, char* buff, int buffLen);
#endif /* _BIONIC_RESOLV_IFACE_FUNCTIONS_DECLARED */
__END_DECLS