1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2025-12-14 22:21:33 +03:00

Return and cache all addresses from DNS resolver

This commit is contained in:
Yihong Wu
2021-12-06 00:45:00 +08:00
parent a9239a6aab
commit e6bf956806
3 changed files with 146 additions and 54 deletions

View File

@ -24,8 +24,8 @@
struct DNS_CACHE
{
const char *Hostname;
IP IPv4;
IP IPv6;
LIST *IPList_v4;
LIST *IPList_v6;
UINT64 Expiration;
};
@ -39,8 +39,8 @@ struct DNS_CACHE_REVERSE
struct DNS_RESOLVER
{
const char *Hostname;
IP IPv4;
IP IPv6;
LIST *IPList_v4;
LIST *IPList_v6;
bool OK;
};
@ -63,11 +63,13 @@ void DnsCacheToggle(const bool enabled);
DNS_CACHE *DnsCacheFind(const char *hostname);
DNS_CACHE *DnsCacheUpdate(const char *hostname, const IP *ipv6, const IP *ipv4);
DNS_CACHE *DnsCacheUpdateEx(const char *hostname, const LIST *iplist_v6, const LIST *iplist_v4);
DNS_CACHE_REVERSE *DnsCacheReverseFind(const IP *ip);
DNS_CACHE_REVERSE *DnsCacheReverseUpdate(const IP *ip, const char *hostname);
bool DnsResolve(IP *ipv6, IP *ipv4, const char *hostname, UINT timeout, volatile const bool *cancel_flag);
bool DnsResolveEx(LIST *iplist_v6, LIST *iplist_v4, const char *hostname, UINT timeout, volatile const bool *cancel_flag);
void DnsResolver(THREAD *t, void *param);
bool DnsResolveReverse(char *dst, const UINT size, const IP *ip, UINT timeout, volatile const bool *cancel_flag);