Classes | |
struct | _fqdn_cache_stats |
Macros | |
#define | FQDN_LOW_WATER 90 |
#define | FQDN_HIGH_WATER 95 |
Functions | |
int | fqdncacheCount () |
static void | fqdncacheRelease (fqdncache_entry *) |
static fqdncache_entry * | fqdncache_get (const char *) |
static int | fqdncacheExpiredEntry (const fqdncache_entry *f) |
static void | fqdncacheAddEntry (fqdncache_entry *f) |
static void | fqdncacheCallback (fqdncache_entry *, int wait) |
static int | fqdncacheParse (fqdncache_entry *f, const rfc1035_rr *answers, int nr, const char *error_message) |
void | fqdnStats (StoreEntry *sentry) |
static void | fqdncacheLockEntry (fqdncache_entry *f) |
static void | fqdncacheUnlockEntry (fqdncache_entry *f) |
static void | fqdncacheRegisterWithCacheManager (void) |
Variables | |
static struct _fqdn_cache_stats | FqdncacheStats |
static dlink_list | lru_list |
static hash_table * | fqdn_table = nullptr |
static long | fqdncache_low = 180 |
static long | fqdncache_high = 200 |
Detailed Description
- Internally, the execution flow is as follows: On a miss, fqdncache_nbgethostbyaddr() checks whether a request for this name is already pending, and if positive, it creates a new entry using fqdncacheAddEntry(). Then it calls fqdncacheAddPending() to add a request to the queue together with data and handler. Else, ifqdncache_dnsDispatch() is called to directly create a DNS query or to fqdncacheEnqueue() if all no DNS port is free.
- fqdncacheCallback() is called regularly to walk down the pending list and call handlers.
- LRU clean-up is performed through fqdncache_purgelru() according to the fqdncache_high threshold.
Macro Definition Documentation
◆ FQDN_HIGH_WATER
#define FQDN_HIGH_WATER 95 |
Definition at line 71 of file fqdncache.cc.
◆ FQDN_LOW_WATER
#define FQDN_LOW_WATER 90 |
Definition at line 68 of file fqdncache.cc.
Function Documentation
◆ fqdncache_get()
|
static |
- Parameters
-
name FQDN hash string.
- Return values
-
Match for given name
Definition at line 169 of file fqdncache.cc.
References fqdn_table, and hash_lookup().
Referenced by fqdncache_gethostbyaddr(), fqdncache_nbgethostbyaddr(), and fqdncacheAddEntryFromHosts().
◆ fqdncacheAddEntry()
|
static |
Definition at line 270 of file fqdncache.cc.
References dlinkAdd(), fqdn_table, fqdncacheRelease(), fqdncache_entry::hash, hash_join(), hash_lookup(), hash_link::key, fqdncache_entry::lastref, fqdncache_entry::lru, lru_list, and squid_curtime.
Referenced by fqdncacheAddEntryFromHosts(), and fqdncacheHandleReply().
◆ fqdncacheCallback()
|
static |
Walks down the pending list, calling handlers
Definition at line 291 of file fqdncache.cc.
References cbdataReferenceValidDone, fqdncache_entry::error_message, fqdncacheLockEntry(), fqdncacheUnlockEntry(), fqdncache_entry::handler, fqdncache_entry::handlerData, fqdncache_entry::lastref, fqdncache_entry::name_count, fqdncache_entry::names, and squid_curtime.
Referenced by fqdncache_nbgethostbyaddr(), and fqdncacheHandleReply().
◆ fqdncacheCount()
|
inline |
Definition at line 142 of file fqdncache.cc.
References hash_table::count, and fqdn_table.
Referenced by fqdncache_purgelru(), fqdnStats(), and snmp_netFqdnFn().
◆ fqdncacheExpiredEntry()
|
static |
Definition at line 185 of file fqdncache.cc.
References fqdncache_entry::expires, fqdncache_entry::locks, and squid_curtime.
Referenced by fqdncache_gethostbyaddr(), fqdncache_nbgethostbyaddr(), and fqdncacheUnlockEntry().
◆ fqdncacheLockEntry()
|
static |
Definition at line 584 of file fqdncache.cc.
References dlinkAdd(), dlinkDelete(), fqdncache_entry::locks, fqdncache_entry::lru, and lru_list.
Referenced by fqdncacheAddEntryFromHosts(), and fqdncacheCallback().
◆ fqdncacheParse()
|
static |
Definition at line 316 of file fqdncache.cc.
References assert, Config, DBG_IMPORTANT, debugs, fqdncache_entry::error_message, fqdncache_entry::expires, fqdncache_entry::flags, FQDN_MAX_NAMES, fqdncache_entry::hash, hash_link::key, fqdncache_entry::name_count, fqdncache_entry::names, SquidConfig::negativeDnsTtl, fqdncache_entry::Flags::negcached, SquidConfig::positiveDnsTtl, RFC1035_CLASS_IN, RFC1035_TYPE_CNAME, RFC1035_TYPE_PTR, squid_curtime, rfc1035_rr::ttl, and xstrdup.
Referenced by fqdncacheHandleReply().
◆ fqdncacheRegisterWithCacheManager()
|
static |
Definition at line 671 of file fqdncache.cc.
References fqdnStats(), and Mgr::RegisterAction().
Referenced by fqdncache_init().
◆ fqdncacheRelease()
|
static |
Removes the given fqdncache entry
Definition at line 155 of file fqdncache.cc.
References debugs, dlinkDelete(), fqdn_table, fqdncache_entry::hash, hash_remove_link(), hashKeyStr(), fqdncache_entry::lru, and lru_list.
Referenced by fqdncache_gethostbyaddr(), fqdncache_nbgethostbyaddr(), fqdncache_purgelru(), fqdncacheAddEntry(), fqdncacheAddEntryFromHosts(), fqdncacheUnlockEntry(), and purge_entries_fromhosts().
◆ fqdncacheUnlockEntry()
|
static |
Definition at line 594 of file fqdncache.cc.
References assert, fqdncacheExpiredEntry(), fqdncacheRelease(), and fqdncache_entry::locks.
Referenced by fqdncacheAddEntryFromHosts(), and fqdncacheCallback().
◆ fqdnStats()
void fqdnStats | ( | StoreEntry * | sentry | ) |
Process objects list
Definition at line 530 of file fqdncache.cc.
References fqdncache_entry::expires, fqdncache_entry::flags, fqdn_table, fqdncacheCount(), FqdncacheStats, fqdncache_entry::Flags::fromhosts, fqdncache_entry::hash, hash_first(), hash_next(), hashKeyStr(), _fqdn_cache_stats::hits, int, _fqdn_cache_stats::misses, fqdncache_entry::name_count, fqdncache_entry::names, _fqdn_cache_stats::negative_hits, fqdncache_entry::Flags::negcached, _fqdn_cache_stats::requests, squid_curtime, and storeAppendPrintf().
Referenced by fqdncacheRegisterWithCacheManager().
Variable Documentation
◆ fqdn_table
|
static |
Definition at line 133 of file fqdncache.cc.
Referenced by fqdncache_get(), fqdncache_init(), fqdncacheAddEntry(), fqdncacheCount(), fqdncacheRelease(), and fqdnStats().
◆ fqdncache_high
|
static |
Definition at line 139 of file fqdncache.cc.
Referenced by fqdncache_init(), and fqdncache_restart().
◆ fqdncache_low
|
static |
Definition at line 136 of file fqdncache.cc.
Referenced by fqdncache_init(), fqdncache_purgelru(), and fqdncache_restart().
◆ FqdncacheStats
|
static |
◆ lru_list
|
static |
Definition at line 120 of file fqdncache.cc.
Referenced by fqdncache_init(), fqdncache_purgelru(), fqdncacheAddEntry(), fqdncacheLockEntry(), fqdncacheRelease(), and purge_entries_fromhosts().