Collaboration diagram for FQDN Cache API:


 FQDN Cache Internals


void fqdncache_purgelru (void *)
static void purge_entries_fromhosts (void)
static void fqdncacheHandleReply (void *data, const rfc1035_rr *answers, int na, const char *error_message, const bool lastAnswer)
void fqdncache_nbgethostbyaddr (const Ip::Address &addr, FQDNH *handler, void *handlerData)
const char * fqdncache_gethostbyaddr (const Ip::Address &addr, int flags)
void fqdncacheFreeMemory (void)
void fqdncache_restart (void)
void fqdncache_init (void)
variable_listsnmp_netFqdnFn (variable_list *Var, snint *ErrP)

Detailed Description


The FQDN cache is a built-in component of squid providing Hostname to IP-Number translation functionality and managing the involved data-structures. Efficiency concerns require mechanisms that allow non-blocking access to these mappings. The FQDN cache usually doesn't block on a request except for special cases where this is desired (see below).

Function Documentation

◆ fqdncache_gethostbyaddr()

const char* fqdncache_gethostbyaddr ( const Ip::Address addr,
int  flags 

Is different in that it only checks if an entry exists in it's data-structures and does not by default contact the DNS, unless this is requested, by setting the flags to FQDN_LOOKUP_IF_MISS.

addraddress of the FQDN being resolved
flagsvalues are NULL or FQDN_LOOKUP_IF_MISS. default is NULL.

Definition at line 480 of file

References fqdncache_entry::flags, FQDN_LOOKUP_IF_MISS, fqdncache_get(), fqdncache_nbgethostbyaddr(), fqdncacheExpiredEntry(), fqdncacheRelease(), FqdncacheStats, _fqdn_cache_stats::hits, Ip::Address::isAnyAddr(), Ip::Address::isNoAddr(), fqdncache_entry::lastref, MAX_IPSTRLEN, _fqdn_cache_stats::misses, fqdncache_entry::names, _fqdn_cache_stats::negative_hits, fqdncache_entry::Flags::negcached, NULL, _fqdn_cache_stats::requests, squid_curtime, and Ip::Address::toStr().

Referenced by Format::Format::assemble(), clientdbDump(), ACLDestinationDomainStrategy::match(), ACLSourceDomainStrategy::match(), Log::Format::SquidIcap(), and ConnStateData::whenClientIpKnown().

◆ fqdncache_init()

void fqdncache_init ( void  )

Initialize the fqdncache. Called after IP cache initialization.

Definition at line 698 of file

References Config, debugs, FQDN_HIGH_WATER, FQDN_LOW_WATER, fqdn_table, SquidConfig::fqdncache, fqdncache_high, fqdncache_low, fqdncacheRegisterWithCacheManager(), FqdncacheStats, hash4, hash_create(), hashPrime(), lru_list, and SquidConfig::size.

Referenced by mainInitialize().

◆ fqdncache_nbgethostbyaddr()

void fqdncache_nbgethostbyaddr ( const Ip::Address addr,
FQDNH handler,
void *  handlerData 
addrIP address of domain to resolve.
handlerA pointer to the function to be called when the reply from the FQDN cache (or the DNS if the FQDN cache misses)
handlerDataInformation that is passed to the handler and does not affect the FQDN cache.

Definition at line 413 of file

References cbdataReference, current_time, debugs, fqdncache_entry::flags, fqdncache_get(), fqdncacheCallback(), fqdncacheExpiredEntry(), fqdncacheHandleReply, fqdncacheRelease(), FqdncacheStats, fqdncache_entry::handler, handler, fqdncache_entry::handlerData, _fqdn_cache_stats::hits, idnsPTRLookup(), MAX_IPSTRLEN, _fqdn_cache_stats::misses, _fqdn_cache_stats::negative_hits, fqdncache_entry::Flags::negcached, NULL, fqdncache_entry::request_time, _fqdn_cache_stats::requests, and Ip::Address::toStr().

Referenced by DestinationDomainLookup::checkForAsync(), SourceDomainLookup::checkForAsync(), and fqdncache_gethostbyaddr().

◆ fqdncache_purgelru()

◆ fqdncache_restart()

void fqdncache_restart ( void  )

Recalculate FQDN cache size upon reconfigure. Is called to clear the FQDN cache's data structures, cancel all pending requests.

Definition at line 633 of file

References Config, FQDN_HIGH_WATER, FQDN_LOW_WATER, SquidConfig::fqdncache, fqdncache_high, fqdncache_low, purge_entries_fromhosts(), and SquidConfig::size.

Referenced by mainReconfigureFinish().

◆ fqdncacheFreeMemory()

void fqdncacheFreeMemory ( void  )

Definition at line 618 of file

References fqdn_table, fqdncacheFreeEntry, hashFreeItems(), hashFreeMemory(), and NULL.

Referenced by SquidShutdown().

◆ fqdncacheHandleReply()

static void fqdncacheHandleReply ( void *  data,
const rfc1035_rr answers,
int  na,
const char *  error_message,
const bool  lastAnswer 

◆ purge_entries_fromhosts()

static void purge_entries_fromhosts ( void  )

◆ snmp_netFqdnFn()






Web Site Translations