summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Luke Huang <huangluke@google.com> 2019-01-09 21:06:24 +0800
committer Luke Huang <huangluke@google.com> 2019-01-10 17:30:02 +0800
commit4364cf6e1dfee18e1e3e5743be5a24b65ac519a2 (patch)
tree59eee1cba9704dc5f950d5057b1365802e5b5181
parentdc23aff2d74257f0db9225a646e57de3b5c0768c (diff)
Minor changes to the async DNS query API flag definitions.
1. Use JavaDoc style comments instead of // comments. 2. Change the flags from an enum class to a uint32_t. Test: built, flashed, booted cts test: NativeDnsAsyncTest Change-Id: I897916a22f19fec6dc70592de590f425d2fe92de
-rw-r--r--include/android/multinetwork.h24
1 files changed, 17 insertions, 7 deletions
diff --git a/include/android/multinetwork.h b/include/android/multinetwork.h
index 05d96ff2d1..d31d1f122f 100644
--- a/include/android/multinetwork.h
+++ b/include/android/multinetwork.h
@@ -112,15 +112,25 @@ int android_getaddrinfofornetwork(net_handle_t network,
#if __ANDROID_API__ >= 29
+/**
+ * Possible values of the flags argument to android_res_nsend and android_res_nquery.
+ * Values are ORed together.
+ */
enum ResNsendFlags : uint32_t {
- // Send a single request to a single resolver and fail on timeout or network errors
+ /**
+ * Send a single request to a single resolver and fail on timeout or network errors
+ */
ANDROID_RESOLV_NO_RETRY = 1 << 0,
- // Do not cache the result of the lookup. The lookup may return a result that is already
- // in the cache, unless the ANDROID_RESOLV_NO_CACHE_LOOKUP flag is also specified.
+ /**
+ * Do not cache the result of the lookup. The lookup may return a result that is already
+ * in the cache, unless the ANDROID_RESOLV_NO_CACHE_LOOKUP flag is also specified.
+ */
ANDROID_RESOLV_NO_CACHE_STORE = 1 << 1,
- // Don't lookup the request in cache, do not write back the response into the cache
+ /**
+ * Don't lookup the request in cache.
+ */
ANDROID_RESOLV_NO_CACHE_LOOKUP = 1 << 2,
};
@@ -136,8 +146,7 @@ enum ResNsendFlags : uint32_t {
* POSIX error code (see errno.h) if an immediate error occurs.
*/
int android_res_nquery(net_handle_t network,
- const char *dname, int ns_class, int ns_type,
- enum ResNsendFlags flags) __INTRODUCED_IN(29);
+ const char *dname, int ns_class, int ns_type, uint32_t flags) __INTRODUCED_IN(29);
/**
* Issue the query |msg| on the given |network|.
@@ -148,10 +157,11 @@ int android_res_nquery(net_handle_t network,
* POSIX error code (see errno.h) if an immediate error occurs.
*/
int android_res_nsend(net_handle_t network,
- const uint8_t *msg, size_t msglen, enum ResNsendFlags flags) __INTRODUCED_IN(29);
+ const uint8_t *msg, size_t msglen, uint32_t flags) __INTRODUCED_IN(29);
/**
* Read a result for the query associated with the |fd| descriptor.
+ * Closes |fd| before returning.
*
* Returns:
* < 0: negative POSIX error code (see errno.h for possible values). |rcode| is not set.