FQDN Cache Internals
[FQDN Cache API]
|
Classes | |
| struct | _fqdn_cache_stats |
Defines | |
| #define | FQDN_LOW_WATER 90 |
| #define | FQDN_HIGH_WATER 95 |
Functions | |
| static void | fqdncacheRelease (fqdncache_entry *) |
| static fqdncache_entry * | fqdncache_get (const char *) |
| static int | fqdncacheExpiredEntry (const fqdncache_entry *f) |
| static fqdncache_entry * | fqdncacheCreateEntry (const char *name) |
| static void | fqdncacheAddEntry (fqdncache_entry *f) |
| static void | fqdncacheCallback (fqdncache_entry *, int wait) |
| static int | fqdncacheParse (fqdncache_entry *f, const char *inbuf) |
| static void | fqdncacheRegisterWithCacheManager (void) |
| void | fqdnStats (StoreEntry *sentry) |
| static void | fqdncacheLockEntry (fqdncache_entry *f) |
| static void | fqdncacheUnlockEntry (fqdncache_entry *f) |
| static void | fqdncacheFreeEntry (void *data) |
Variables | |
| static struct _fqdn_cache_stats | FqdncacheStats |
| static dlink_list | lru_list |
| static hash_table * | fqdn_table = NULL |
| 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.
Define Documentation
| #define FQDN_HIGH_WATER 95 |
Definition at line 84 of file fqdncache.cc.
Referenced by fqdncache_init(), and fqdncache_restart().
| #define FQDN_LOW_WATER 90 |
Definition at line 81 of file fqdncache.cc.
Referenced by fqdncache_init(), and fqdncache_restart().
Function Documentation
| static fqdncache_entry * fqdncache_get | ( | const char * | name | ) | [static] |
- Parameters:
-
name FQDN hash string.
- Return values:
-
Match for given name
Definition at line 192 of file fqdncache.cc.
References hash_lookup(), and NULL.
Referenced by fqdncache_gethostbyaddr(), fqdncache_nbgethostbyaddr(), and fqdncacheAddEntryFromHosts().
| static void fqdncacheAddEntry | ( | fqdncache_entry * | f | ) | [static] |
Definition at line 293 of file fqdncache.cc.
References dlinkAdd(), fqdncacheRelease(), fqdncache_entry::hash, hash_join(), hash_lookup(), _hash_link::key, fqdncache_entry::lastref, fqdncache_entry::lru, NULL, and squid_curtime.
Referenced by fqdncacheAddEntryFromHosts(), and fqdncacheHandleReply().
| static void fqdncacheCallback | ( | fqdncache_entry * | f, | |
| int | wait | |||
| ) | [static] |
Walks down the pending list, calling handlers
Definition at line 314 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, NULL, and squid_curtime.
Referenced by fqdncache_nbgethostbyaddr(), and fqdncacheHandleReply().
| static fqdncache_entry * fqdncacheCreateEntry | ( | const char * | name | ) | [static] |
Create blank fqdncache_entry
Definition at line 282 of file fqdncache.cc.
References Config, fqdncache_entry::expires, fqdncache_entry::hash, _hash_link::key, MEM_FQDNCACHE_ENTRY, memAllocate(), SquidConfig::negativeDnsTtl, squid_curtime, and xstrdup().
Referenced by fqdncache_nbgethostbyaddr(), and fqdncacheAddEntryFromHosts().
| static int fqdncacheExpiredEntry | ( | const fqdncache_entry * | f | ) | [static] |
Definition at line 208 of file fqdncache.cc.
References fqdncache_entry::expires, fqdncache_entry::locks, and squid_curtime.
Referenced by fqdncache_gethostbyaddr(), fqdncache_nbgethostbyaddr(), and fqdncacheUnlockEntry().
| static void fqdncacheFreeEntry | ( | void * | data | ) | [static] |
Definition at line 780 of file fqdncache.cc.
References fqdncache_entry::error_message, fqdncache_entry::hash, _hash_link::key, MEM_FQDNCACHE_ENTRY, memFree(), fqdncache_entry::name_count, fqdncache_entry::names, and safe_free.
| static void fqdncacheLockEntry | ( | fqdncache_entry * | f | ) | [static] |
Definition at line 759 of file fqdncache.cc.
References dlinkAdd(), dlinkDelete(), fqdncache_entry::locks, and fqdncache_entry::lru.
Referenced by fqdncacheAddEntryFromHosts(), and fqdncacheCallback().
| static int fqdncacheParse | ( | fqdncache_entry * | f, | |
| const char * | buf | |||
| ) | [static] |
Definition at line 340 of file fqdncache.cc.
References assert, Config, debugs, DNS_INBUF_SZ, fqdncache_entry::error_message, fqdncache_entry::expires, fqdncache_entry::flags, fqdncache_entry::hash, _hash_link::key, LOCAL_ARRAY, name, fqdncache_entry::name_count, fqdncache_entry::names, SquidConfig::negativeDnsTtl, fqdncache_entry::negcached, NULL, SquidConfig::positiveDnsTtl, squid_curtime, w_space, xstrdup(), and xstrncpy().
Referenced by fqdncacheHandleReply().
| static void fqdncacheRegisterWithCacheManager | ( | void | ) | [static] |
Definition at line 587 of file fqdncache.cc.
References fqdnStats(), and CacheManager::GetInstance().
Referenced by fqdncache_init().
| static void fqdncacheRelease | ( | fqdncache_entry * | f | ) | [static] |
Removes the given fqdncache entry
Definition at line 167 of file fqdncache.cc.
References debugs, dlinkDelete(), hash_remove_link(), hashKeyStr(), _hash_link::key, MEM_FQDNCACHE_ENTRY, memFree(), and safe_free.
Referenced by fqdncache_gethostbyaddr(), fqdncache_nbgethostbyaddr(), fqdncache_purgelru(), fqdncacheAddEntry(), fqdncacheAddEntryFromHosts(), fqdncacheUnlockEntry(), and purge_entries_fromhosts().
| static void fqdncacheUnlockEntry | ( | fqdncache_entry * | f | ) | [static] |
Definition at line 769 of file fqdncache.cc.
References assert, fqdncacheExpiredEntry(), fqdncacheRelease(), and fqdncache_entry::locks.
Referenced by fqdncacheAddEntryFromHosts(), and fqdncacheCallback().
| void fqdnStats | ( | StoreEntry * | sentry | ) |
Process objects list
Definition at line 691 of file fqdncache.cc.
References fqdncache_entry::expires, fqdncache_entry::flags, FqdncacheStats, fqdncache_entry::fromhosts, fqdncache_entry::hash, hash_first(), hash_next(), hashKeyStr(), _fqdn_cache_stats::hits, MEM_FQDNCACHE_ENTRY, memInUse(), _fqdn_cache_stats::misses, fqdncache_entry::name_count, fqdncache_entry::names, _fqdn_cache_stats::negative_hits, fqdncache_entry::negcached, NULL, _fqdn_cache_stats::requests, squid_curtime, and storeAppendPrintf().
Referenced by fqdncacheRegisterWithCacheManager().
Variable Documentation
hash_table* fqdn_table = NULL [static] |
Definition at line 147 of file fqdncache.cc.
long fqdncache_high = 200 [static] |
Definition at line 153 of file fqdncache.cc.
Referenced by fqdncache_init(), and fqdncache_restart().
long fqdncache_low = 180 [static] |
Definition at line 150 of file fqdncache.cc.
Referenced by fqdncache_init(), fqdncache_purgelru(), and fqdncache_restart().
struct _fqdn_cache_stats FqdncacheStats [static] |
dlink_list lru_list [static] |
Definition at line 127 of file fqdncache.cc.
Referenced by external_acl::add().
Search
Introduction
- About Squid
- Why Squid?
- Squid Developers
- How to Help Out
- Getting Squid
- Donate
- Squid Deployment Case-Studies
Documentation
- FAQ | Wiki | Book
- Configuration Reference
- Configuration Guide - Visolve
- Configuration Examples
- Users guide
- Non-English
- Security Advisories
- More...
Support
- Bugzilla Database
- Mailing lists
- Contacting us
- Commercial services
- Project Sponsors
- Squid-based products
