mirror of
https://github.com/espressif/esp-lwip.git
synced 2026-10-04 23:07:36 +00:00
dns: Add API to clear dns cache
Picked from espressif/esp-lwip@ee59f77d Ref IDF-4839
This commit is contained in:
@@ -382,6 +382,15 @@ dns_setserver(u8_t numdns, const ip_addr_t *dnsserver)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clears the DNS cache
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
dns_clear_cache(void)
|
||||||
|
{
|
||||||
|
memset(dns_table, 0, sizeof(struct dns_table_entry) * DNS_TABLE_SIZE);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ingroup dns
|
* @ingroup dns
|
||||||
* Obtain one of the currently configured DNS server.
|
* Obtain one of the currently configured DNS server.
|
||||||
|
|||||||
@@ -111,9 +111,7 @@ err_t dns_gethostbyname(const char *hostname, ip_addr_t *addr,
|
|||||||
err_t dns_gethostbyname_addrtype(const char *hostname, ip_addr_t *addr,
|
err_t dns_gethostbyname_addrtype(const char *hostname, ip_addr_t *addr,
|
||||||
dns_found_callback found, void *callback_arg,
|
dns_found_callback found, void *callback_arg,
|
||||||
u8_t dns_addrtype);
|
u8_t dns_addrtype);
|
||||||
#if ESP_DNS
|
void dns_clear_cache(void);
|
||||||
void dns_clear_servers(bool keep_fallback);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if DNS_LOCAL_HOSTLIST
|
#if DNS_LOCAL_HOSTLIST
|
||||||
size_t dns_local_iterate(dns_found_callback iterator_fn, void *iterator_arg);
|
size_t dns_local_iterate(dns_found_callback iterator_fn, void *iterator_arg);
|
||||||
|
|||||||
Reference in New Issue
Block a user