DNS cache management. More...
Go to the source code of this file.
Data Structures | |
struct | DnsCacheEntry |
DNS cache entry. More... | |
Macros | |
#define | DNS_TICK_INTERVAL 200 |
#define | DNS_CACHE_SIZE 8 |
#define | DNS_MAX_NAME_LEN 63 |
#define | DNS_CACHE_INIT_POLLING_INTERVAL 10 |
#define | DNS_CACHE_MAX_POLLING_INTERVAL 1000 |
Enumerations | |
enum | DnsState { DNS_STATE_NONE = 0, DNS_STATE_IN_PROGRESS = 1, DNS_STATE_RESOLVED = 2, DNS_STATE_PERMANENT = 3 } |
DNS cache entry states. More... | |
Functions | |
error_t | dnsInit (void) |
DNS cache initialization. More... | |
void | dnsFlushCache (NetInterface *interface) |
Flush DNS cache. More... | |
DnsCacheEntry * | dnsCreateEntry (void) |
Create a new entry in the DNS cache. More... | |
void | dnsDeleteEntry (DnsCacheEntry *entry) |
Delete the specified DNS cache entry. More... | |
DnsCacheEntry * | dnsFindEntry (NetInterface *interface, const char_t *name, HostType type, HostnameResolver protocol) |
Search the DNS cache for a given domain name. More... | |
void | dnsTick (void) |
DNS timer handler. More... | |
Variables | |
systime_t | dnsTickCounter |
DnsCacheEntry | dnsCache [DNS_CACHE_SIZE] |
Detailed Description
DNS cache management.
License
SPDX-License-Identifier: GPL-2.0-or-later
Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.
This file is part of CycloneTCP Open.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- Version
- 2.4.4
Definition in file dns_cache.h.
Macro Definition Documentation
◆ DNS_CACHE_INIT_POLLING_INTERVAL
#define DNS_CACHE_INIT_POLLING_INTERVAL 10 |
Definition at line 61 of file dns_cache.h.
◆ DNS_CACHE_MAX_POLLING_INTERVAL
#define DNS_CACHE_MAX_POLLING_INTERVAL 1000 |
Definition at line 68 of file dns_cache.h.
◆ DNS_CACHE_SIZE
#define DNS_CACHE_SIZE 8 |
Definition at line 47 of file dns_cache.h.
◆ DNS_MAX_NAME_LEN
#define DNS_MAX_NAME_LEN 63 |
Definition at line 54 of file dns_cache.h.
◆ DNS_TICK_INTERVAL
#define DNS_TICK_INTERVAL 200 |
Definition at line 40 of file dns_cache.h.
Enumeration Type Documentation
◆ DnsState
enum DnsState |
DNS cache entry states.
Enumerator | |
---|---|
DNS_STATE_NONE | |
DNS_STATE_IN_PROGRESS | |
DNS_STATE_RESOLVED | |
DNS_STATE_PERMANENT |
Definition at line 83 of file dns_cache.h.
Function Documentation
◆ dnsCreateEntry()
DnsCacheEntry* dnsCreateEntry | ( | void | ) |
Create a new entry in the DNS cache.
- Returns
- Pointer to the newly created entry
Definition at line 103 of file dns_cache.c.
◆ dnsDeleteEntry()
void dnsDeleteEntry | ( | DnsCacheEntry * | entry | ) |
Delete the specified DNS cache entry.
- Parameters
-
[in] entry Pointer to the DNS cache entry to be deleted
Definition at line 152 of file dns_cache.c.
◆ dnsFindEntry()
DnsCacheEntry* dnsFindEntry | ( | NetInterface * | interface, |
const char_t * | name, | ||
HostType | type, | ||
HostnameResolver | protocol | ||
) |
Search the DNS cache for a given domain name.
- Parameters
-
[in] interface Underlying network interface [in] name Domain name [in] type Host type (IPv4 or IPv6) [in] protocol Host name resolution protocol
- Returns
- A pointer to the matching DNS entry is returned. NULL is returned if the specified domain name could not be found in the DNS cache
Definition at line 186 of file dns_cache.c.
◆ dnsFlushCache()
void dnsFlushCache | ( | NetInterface * | interface | ) |
Flush DNS cache.
- Parameters
-
[in] interface Underlying network interface
Definition at line 74 of file dns_cache.c.
◆ dnsInit()
error_t dnsInit | ( | void | ) |
◆ dnsTick()
void dnsTick | ( | void | ) |
DNS timer handler.
This routine must be periodically called by the TCP/IP stack to manage DNS cache
Definition at line 228 of file dns_cache.c.
Variable Documentation
◆ dnsCache
|
extern |
Definition at line 51 of file dns_cache.c.
◆ dnsTickCounter
|
extern |
Definition at line 49 of file dns_cache.c.