DNS cache. More...
DNS cache.
Files | |
file | cache.h |
DNS cache definitions. | |
Macros | |
#define | CONFIG_DNS_CACHE_SIZE 4 |
Maximum number of DNS cache entries. | |
#define | CONFIG_DNS_CACHE_A IS_USED(MODULE_IPV4) |
Handle to cache A records. | |
#define | CONFIG_DNS_CACHE_AAAA IS_USED(MODULE_IPV6) |
Handle to cache AAAA records. | |
Functions | |
int | dns_cache_query (const char *domain_name, void *addr_out, int family) |
Get IP address for a DNS name from the DNS cache. | |
void | dns_cache_add (const char *domain_name, const void *addr, int addr_len, uint32_t ttl) |
Add an IP address for a DNS name to the DNS cache. | |
#define CONFIG_DNS_CACHE_A IS_USED(MODULE_IPV4) |
#define CONFIG_DNS_CACHE_AAAA IS_USED(MODULE_IPV6) |
#define CONFIG_DNS_CACHE_SIZE 4 |
void dns_cache_add | ( | const char * | domain_name, |
const void * | addr, | ||
int | addr_len, | ||
uint32_t | ttl | ||
) |
Add an IP address for a DNS name to the DNS cache.
[in] | domain_name | DNS name to resolve into address |
[in] | addr | buffer containing the address |
[in] | addr_len | length of the address in bytes |
[in] | ttl | lifetime of the entry in seconds |
int dns_cache_query | ( | const char * | domain_name, |
void * | addr_out, | ||
int | family | ||
) |
Get IP address for a DNS name from the DNS cache.
[in] | domain_name | DNS name to resolve into address |
[out] | addr_out | buffer to write result into |
[in] | family | Either AF_INET, AF_INET6 or AF_UNSPEC |