58 #ifndef LWIP_HDR_DNS_H 59 #define LWIP_HDR_DNS_H 72 #define DNS_TMR_INTERVAL 1000 75 #define LWIP_DNS_ADDRTYPE_IPV4 0 76 #define LWIP_DNS_ADDRTYPE_IPV6 1 77 #define LWIP_DNS_ADDRTYPE_IPV4_IPV6 2 78 #define LWIP_DNS_ADDRTYPE_IPV6_IPV4 3 79 #if LWIP_IPV4 && LWIP_IPV6 80 #ifndef LWIP_DNS_ADDRTYPE_DEFAULT 81 #define LWIP_DNS_ADDRTYPE_DEFAULT LWIP_DNS_ADDRTYPE_IPV4_IPV6 84 #define LWIP_DNS_ADDRTYPE_DEFAULT LWIP_DNS_ADDRTYPE_IPV4 86 #define LWIP_DNS_ADDRTYPE_DEFAULT LWIP_DNS_ADDRTYPE_IPV6 89 #if DNS_LOCAL_HOSTLIST 91 struct local_hostlist_entry {
96 struct local_hostlist_entry *next;
98 #define DNS_LOCAL_HOSTLIST_ELEM(name, addr_init) {name, addr_init, NULL} 99 #if DNS_LOCAL_HOSTLIST_IS_DYNAMIC 100 #ifndef DNS_LOCAL_HOSTLIST_MAX_NAMELEN 101 #define DNS_LOCAL_HOSTLIST_MAX_NAMELEN DNS_MAX_NAME_LENGTH 103 #define LOCALHOSTLIST_ELEM_SIZE ((sizeof(struct local_hostlist_entry) + DNS_LOCAL_HOSTLIST_MAX_NAMELEN + 1)) 108 extern const ip_addr_t dns_mquery_v4group;
111 extern const ip_addr_t dns_mquery_v6group;
121 typedef void (*dns_found_callback)(
const char *name,
const ip_addr_t *ipaddr,
void *callback_arg);
125 void dns_setserver(u8_t numdns,
const ip_addr_t *dnsserver);
126 const ip_addr_t* dns_getserver(u8_t numdns);
127 err_t dns_gethostbyname(
const char *hostname, ip_addr_t *addr,
128 dns_found_callback found,
void *callback_arg);
129 err_t dns_gethostbyname_addrtype(
const char *hostname, ip_addr_t *addr,
130 dns_found_callback found,
void *callback_arg,
134 #if DNS_LOCAL_HOSTLIST 135 size_t dns_local_iterate(dns_found_callback iterator_fn,
void *iterator_arg);
136 err_t dns_local_lookup(
const char *hostname, ip_addr_t *addr, u8_t dns_addrtype);
137 #if DNS_LOCAL_HOSTLIST_IS_DYNAMIC 138 int dns_local_removehost(
const char *hostname,
const ip_addr_t *addr);
139 err_t dns_local_addhost(
const char *hostname,
const ip_addr_t *addr);