Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
dns_resolve.h File Reference

DNS resolving library. More...

#include <net/net_ip.h>
#include <net/net_context.h>

Go to the source code of this file.

Data Structures

struct  dns_addrinfo
 
struct  dns_resolve_context
 
struct  dns_resolve_context::dns_pending_query
 

Macros

#define DNS_MAX_NAME_SIZE   20
 

Typedefs

typedef void(* dns_resolve_cb_t) (enum dns_resolve_status status, struct dns_addrinfo *info, void *user_data)
 DNS resolve callback. More...
 

Enumerations

enum  dns_query_type { DNS_QUERY_TYPE_A = 1 , DNS_QUERY_TYPE_AAAA = 28 }
 
enum  dns_resolve_status {
  DNS_EAI_BADFLAGS = -1 , DNS_EAI_NONAME = -2 , DNS_EAI_AGAIN = -3 , DNS_EAI_FAIL = -4 ,
  DNS_EAI_NODATA = -5 , DNS_EAI_FAMILY = -6 , DNS_EAI_SOCKTYPE = -7 , DNS_EAI_SERVICE = -8 ,
  DNS_EAI_ADDRFAMILY = -9 , DNS_EAI_MEMORY = -10 , DNS_EAI_SYSTEM = -11 , DNS_EAI_OVERFLOW = -12 ,
  DNS_EAI_INPROGRESS = -100 , DNS_EAI_CANCELED = -101 , DNS_EAI_NOTCANCELED = -102 , DNS_EAI_ALLDONE = -103 ,
  DNS_EAI_IDN_ENCODE = -105
}
 
enum  dns_resolve_context_state { DNS_RESOLVE_CONTEXT_ACTIVE , DNS_RESOLVE_CONTEXT_DEACTIVATING , DNS_RESOLVE_CONTEXT_INACTIVE }
 

Functions

int dns_resolve_init (struct dns_resolve_context *ctx, const char *dns_servers_str[], const struct sockaddr *dns_servers_sa[])
 Init DNS resolving context. More...
 
int dns_resolve_close (struct dns_resolve_context *ctx)
 Close DNS resolving context. More...
 
int dns_resolve_reconfigure (struct dns_resolve_context *ctx, const char *servers_str[], const struct sockaddr *servers_sa[])
 Reconfigure DNS resolving context. More...
 
int dns_resolve_cancel (struct dns_resolve_context *ctx, uint16_t dns_id)
 Cancel a pending DNS query. More...
 
int dns_resolve_cancel_with_name (struct dns_resolve_context *ctx, uint16_t dns_id, const char *query_name, enum dns_query_type query_type)
 Cancel a pending DNS query using id, name and type. More...
 
int dns_resolve_name (struct dns_resolve_context *ctx, const char *query, enum dns_query_type type, uint16_t *dns_id, dns_resolve_cb_t cb, void *user_data, int32_t timeout)
 Resolve DNS name. More...
 
struct dns_resolve_contextdns_resolve_get_default (void)
 Get default DNS context. More...
 
static int dns_get_addr_info (const char *query, enum dns_query_type type, uint16_t *dns_id, dns_resolve_cb_t cb, void *user_data, int32_t timeout)
 Get IP address info from DNS. More...
 
static int dns_cancel_addr_info (uint16_t dns_id)
 Cancel a pending DNS query. More...
 

Detailed Description

DNS resolving library.

An API for applications to resolve a DNS name.