* The value NETWORK_UNSPECIFIED indicates no specific network.
*
* For some functions (documented below), a previous binding may be cleared
* by an invocation with NETWORK_UNSPECIFIED.
*
* Depending on the context it may indicate an error. It is expressly
* not used to indicate some notion of the "current default network".
*/
NETWORK_UNSPECIFIED::net_handle_t(0)
/**
* Possible values of the flags argument to android_res_nsend and android_res_nquery.
* Values are ORed together.
*/
ResNsendFlagsBits::enumu32{
/**
* Send a single request to a single resolver and fail on timeout or network errors
*/
RESOLV_NO_RETRY=0,
/**
* Don't lookup this request in the cache, and don't cache the result of the lookup.
* This flag implies {@link #ANDROID_RESOLV_NO_CACHE_LOOKUP}.
*/
RESOLV_NO_CACHE_STORE=1,
/**
* Don't lookup the request in cache.
*/
RESOLV_NO_CACHE_LOOKUP=2,
}
ResNsendFlags::bit_set[ResNsendFlagsBits;u32]
foreignandroid{
/**
* All functions below that return an i32 return 0 on success or -1
* on failure with an appropriate errno value set.
*/
/**
* Set the network to be used by the given socket file descriptor.
*
* To clear a previous socket binding, invoke with NETWORK_UNSPECIFIED.
*
* This is the equivalent of: [android.net.Network#bindSocket()](https://developer.android.com/reference/android/net/Network.html#bindSocket(java.net.Socket))
* Binds the current process to |network|. All sockets created in the future
* (and not explicitly bound via android_setsocknetwork()) will be bound to
* |network|. All host name resolutions will be limited to |network| as well.
* Note that if the network identified by |network| ever disconnects, all
* sockets created in this way will cease to work and all host name
* resolutions will fail. This is by design so an application doesn't
* accidentally use sockets it thinks are still bound to a particular network.
*
* To clear a previous process binding, invoke with NETWORK_UNSPECIFIED.
*
* This is the equivalent of: [android.net.ConnectivityManager#bindProcessToNetwork()](https://developer.android.com/reference/android/net/ConnectivityManager.html#bindProcessToNetwork(android.net.Network))
* Gets the |network| bound to the current process, as per android_setprocnetwork.
*
* This is the equivalent of: [android.net.ConnectivityManager#getBoundNetworkForProcess()](https://developer.android.com/reference/android/net/ConnectivityManager.html#getBoundNetworkForProcess(android.net.Network))
* Returns 0 on success, or -1 setting errno to EINVAL if a null pointer is
* Perform hostname resolution via the DNS servers associated with |network|.
*
* All arguments (apart from |network|) are used identically as those passed
* to getaddrinfo(3). Return and error values are identical to those of
* getaddrinfo(3), and in particular gai_strerror(3) can be used as expected.
* Similar to getaddrinfo(3):
* - |hints| may be NULL (in which case man page documented defaults apply)
* - either |node| or |service| may be NULL, but not both
* - |res| must not be NULL
*
* This is the equivalent of: [android.net.Network#getAllByName()](https://developer.android.com/reference/android/net/Network.html#getAllByName(java.lang.String))