
Modules | |
FQDN Cache Internals | |
Functions | |
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_list * | snmp_netFqdnFn (variable_list *Var, snint *ErrP) |
Detailed Description
Introduction
- 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.
- Parameters
-
addr address of the FQDN being resolved flags values are NULL or FQDN_LOOKUP_IF_MISS. default is NULL.
Definition at line 480 of file fqdncache.cc.
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 fqdncache.cc.
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 | ||
) |
- Parameters
-
addr IP address of domain to resolve. handler A pointer to the function to be called when the reply from the FQDN cache (or the DNS if the FQDN cache misses) handlerData Information that is passed to the handler and does not affect the FQDN cache.
Definition at line 413 of file fqdncache.cc.
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()
void fqdncache_purgelru | ( | void * | ) |
Definition at line 199 of file fqdncache.cc.
References dlink_node::data, debugs, eventAdd(), fqdncache_low, fqdncache_purgelru(), fqdncacheCount(), fqdncacheRelease(), fqdncache_entry::locks, lru_list, NULL, dlink_node::prev, and dlink_list::tail.
Referenced by fqdncache_purgelru(), and mainInitialize().
◆ 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 fqdncache.cc.
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 fqdncache.cc.
References fqdn_table, fqdncacheFreeEntry, hashFreeItems(), hashFreeMemory(), and NULL.
Referenced by SquidShutdown().
◆ fqdncacheHandleReply()
|
static |
Callback for handling DNS results.
Definition at line 389 of file fqdncache.cc.
References fqdncache_entry::age(), assert, StatHist::count(), data, StatCounters::dns, fqdncacheAddEntry(), fqdncacheCallback(), fqdncacheParse(), FqdncacheStats, _fqdn_cache_stats::replies, statCounter, and StatCounters::svcTime.
◆ purge_entries_fromhosts()
|
static |
Definition at line 228 of file fqdncache.cc.
References dlink_node::data, fqdncache_entry::flags, fqdncacheRelease(), fqdncache_entry::Flags::fromhosts, dlink_list::head, lru_list, dlink_node::next, and NULL.
Referenced by fqdncache_restart().
◆ snmp_netFqdnFn()
variable_list* snmp_netFqdnFn | ( | variable_list * | Var, |
snint * | ErrP | ||
) |
The function to return the FQDN statistics via SNMP
Definition at line 729 of file fqdncache.cc.
References debugs, FQDN_ENT, FQDN_GHBN, FQDN_HITS, FQDN_MISS, FQDN_NEGHIT, FQDN_PENDHIT, FQDN_REQ, fqdncacheCount(), FqdncacheStats, _fqdn_cache_stats::hits, LEN_SQ_NET, _fqdn_cache_stats::misses, variable_list::name, variable_list::name_length, _fqdn_cache_stats::negative_hits, NULL, _fqdn_cache_stats::requests, SMI_COUNTER32, SMI_GAUGE32, SNMP_ERR_NOERROR, SNMP_ERR_NOSUCHNAME, snmp_var_new_integer(), and snmpDebugOid().
Referenced by snmpInit().