Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4364cf6e authored by Luke Huang's avatar Luke Huang
Browse files

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
parent dc23aff2
Loading
Loading
Loading
Loading
+17 −7
Original line number Diff line number Diff line
@@ -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.