Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
CDNSNameCache Class Referencefinal

#include <DNSNameCache.h>

Public Member Functions

void Add (const std::string &strHostName, const std::string &strIpAddress)
 Add the IP for a hostname to the cache. From the time of adding it stays in the cache for TTL.
 
void AddPermanent (const std::string &strHostName, const std::string &strIpAddress)
 Add the IP for a hostname to the cache indefinitely.
 
bool GetCached (const std::string &strHostName, std::string &strIpAddress) const
 Get an IP for a hostname from the cache.
 
bool Lookup (const std::string &strHostName, std::string &strIpAddress)
 Get the IP for the hostname from the cache or query it form the DNS.
 

Member Function Documentation

◆ Add()

void CDNSNameCache::Add ( const std::string & strHostName,
const std::string & strIpAddress )

Add the IP for a hostname to the cache. From the time of adding it stays in the cache for TTL.

Parameters
strHostNameThe hostname
strIpAddressThe IP for that hostname. Can be IPv4 or IPv6

◆ AddPermanent()

void CDNSNameCache::AddPermanent ( const std::string & strHostName,
const std::string & strIpAddress )

Add the IP for a hostname to the cache indefinitely.

Parameters
strHostNameThe hostname
strIpAddressThe IP for that hostname. Can be IPv4 or IPv6

◆ GetCached()

bool CDNSNameCache::GetCached ( const std::string & strHostName,
std::string & strIpAddress ) const

Get an IP for a hostname from the cache.

Parameters
strHostNameThe hostname to look up
[out]strIpAddressContains the IP for the hostname if the info is in the cache, otherwise unchanged
Returns
true if the IP is cached

◆ Lookup()

bool CDNSNameCache::Lookup ( const std::string & strHostName,
std::string & strIpAddress )

Get the IP for the hostname from the cache or query it form the DNS.

If a successful DNS query was performed the result is added to the cache for the duration of TTL

Parameters
strHostNameThe hostname to look up
[out]strIpAddressContains the IP for the hostname if the info can be provided, otherwise unchanged
Returns
true if the IP is cached or the DNS query was successful

The documentation for this class was generated from the following files: