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

Commit 69e70cf7 authored by Remi NGUYEN VAN's avatar Remi NGUYEN VAN
Browse files

Add NDK API for getprocdns, setprocdns

The API allows callers to control the default network that is used for
DNS hostname resolution.

Test: atest CtsNetTestCases
      Tests in change I00143cafcd3eb1d71e8d5c7ea9c839a99dc6f4ce
Bug: 171540887
Merged-In: I70d8113ae49cd1e0910a6dbc5929b6a157c44f42
Change-Id: I66ad7d2389307fb2991fd5ce09b7d3985719106d
parent c0d9f8a2
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -102,6 +102,28 @@ int android_setprocnetwork(net_handle_t network) __INTRODUCED_IN(23);
 */
int android_getprocnetwork(net_handle_t *network) __INTRODUCED_IN(31);

/**
 * Binds domain name resolutions performed by this process to |network|.
 * android_setprocnetwork takes precedence over this setting.
 *
 * To clear a previous process binding, invoke with NETWORK_UNSPECIFIED.
 * On success 0 is returned. On error -1 is returned, and errno is set.
 *
 * Available since API level 31.
 */
int android_setprocdns(net_handle_t network) __INTRODUCED_IN(31);

/**
 * Gets the |network| to which domain name resolutions are bound on the
 * current process.
 *
 * Returns 0 on success, or -1 setting errno to EINVAL if a null pointer is
 * passed in.
 *
 * Available since API level 31.
 */
int android_getprocdns(net_handle_t *network) __INTRODUCED_IN(31);


/**
 * Perform hostname resolution via the DNS servers associated with |network|.