mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 05:16:47 +08:00
libs/libc/netdb: add dns clear interface
Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
@@ -164,6 +164,31 @@ void dns_save_answer(FAR const char *hostname,
|
||||
dns_semgive();
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: dns_clear_answer
|
||||
*
|
||||
* Description:
|
||||
* Clear the resolved hostname in the DNS cache
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void dns_clear_answer(void)
|
||||
{
|
||||
/* Get exclusive access to the DNS cache */
|
||||
|
||||
dns_semtake();
|
||||
|
||||
/* Reset the circular of DNS cache */
|
||||
|
||||
g_dns_head = 0;
|
||||
g_dns_tail = 0;
|
||||
|
||||
dns_semgive();
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: dns_find_answer
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user