include/net/dns_resolve.h
/**
 * @brief Get IP address info from DNS.
 *
 * @details This function can be used to resolve e.g., IPv4 or IPv6 address.
 * Note that this is asynchronous call, the function will return immediately
 * and system will call the callback after resolving has finished or timeout
 * has occurred.
 * We might send the query to multiple servers (if there are more than one
 * server configured), but we only use the result of the first received
 * response.
 * This variant uses system wide DNS servers.
 *
 * @param query What the caller wants to resolve.
 * @param type What kind of data the caller wants to get.
 * @param dns_id DNS id is returned to the caller. This is needed if one
 * wishes to cancel the query. This can be set to NULL if there is no need
 * to cancel the query.
 * @param cb Callback to call after the resolving has finished or timeout
 * has happened.
 * @param user_data The user data.
 * @param timeout The timeout value for the connection. Possible values:
 * K_FOREVER: the query is tried forever, user needs to cancel it manually
 *            if it takes too long time to finish
 * >0: start the query and let the system timeout it after specified ms
 *
 * @return 0 if resolving was started ok, < 0 otherwise
 */
@brief Get IP address info from DNS.
@details This function can be used to resolve e.g., IPv4 or IPv6 address.
Note that this is asynchronous call, the function will return immediately
and system will call the callback after resolving has finished or timeout
has occurred.
We might send the query to multiple servers (if there are more than one
server configured), but we only use the result of the first received
response.
This variant uses system wide DNS servers.

@param query What the caller wants to resolve.
@param type What kind of data the caller wants to get.
@param dns_id DNS id is returned to the caller. This is needed if one
wishes to cancel the query. This can be set to NULL if there is no need
to cancel the query.
@param cb Callback to call after the resolving has finished or timeout
has happened.
@param user_data The user data.
@param timeout The timeout value for the connection. Possible values:
K_FOREVER: the query is tried forever, user needs to cancel it manually
if it takes too long time to finish
>0: start the query and let the system timeout it after specified ms

@return 0 if resolving was started ok, < 0 otherwise
@brief Get IP address info from DNS . @details This function can be used to resolve e . g . IPv4 or IPv6 address . Note that this is asynchronous call the function will return immediately and system will call the callback after resolving has finished or timeout has occurred . We might send the query to multiple servers ( if there are more than one server configured ) but we only use the result of the first received response . This variant uses system wide DNS servers . @param query What the caller wants to resolve . @param type What kind of data the caller wants to get . @param dns_id DNS id is returned to the caller . This is needed if one wishes to cancel the query . This can be set to NULL if there is no need to cancel the query . @param cb Callback to call after the resolving has finished or timeout has happened . @param user_data The user data . @param timeout The timeout value for the connection . Possible values : K_FOREVER : the query is tried forever user needs to cancel it manually if it takes too long time to finish > 0 : start the query and let the system timeout it after specified ms @return 0 if resolving was started ok < 0 otherwise
static inline int dns_get_addr_info(const char *query,
				    enum dns_query_type type,
				    u16_t *dns_id,
				    dns_resolve_cb_t cb,
				    void *user_data,
				    s32_t timeout)
{
	return dns_resolve_name(dns_resolve_get_default(),
				query,
				type,
				dns_id,
				cb,
				user_data,
				timeout);
}
static inline int dns_get_addr_info ( const char * query , enum dns_query_type type , u16_t * dns_id , dns_resolve_cb_t cb , void * user_data , s32_t timeout ) { return dns_resolve_name ( dns_resolve_get_default ( ) , query , type , dns_id , cb , user_data , timeout ) ; }
@brief Get IP address info from DNS.
@brief Get IP address info from DNS .